Stream: shorthand
Topic: More problems executing Sushi
Grahame Grieve (Jan 12 2022 at 06:26):
I've got a wrapper around the IG publisher that runs the IG publisher and manages my workflow for me. Works fine on windows. but on unix systems, the IG publisher can't run sushi when I launch it myself. I suspect it's got something to do with non-interactive shells and not hooking NPM in, but (as always for unix) there is a myriad of proposed solutions, none of which seem like a general solution. @Chris Moesel am I making sense, and how would you recommend solving it. (the most general solutions seems to be 'set the BASH_ENV variable' but what do you set it too?)
Chris Moesel (Jan 12 2022 at 13:23):
Hmmm... I use Mac (not Linux) and I don't generally have to do anything special, but I'm not running your wrapper either. That said, the _genonce.sh
script is a wrapper of sorts, and it "just works". Is your wrapper a shell script or something else? What is the specific error you get when IG Publisher fails to launch SUSHI?
Grahame Grieve (Jan 12 2022 at 17:17):
it's not a shell script, it's an exe file. And the error is that fsh is an unknown command.
Chris Moesel (Jan 12 2022 at 17:22):
Do you mean that sushi
is an unknown command? Or is it really saying fsh
is an unknown command? And, pardon my ignorance, but if it is an exe then how are you running it on Linux?
David Pyke (Jan 12 2022 at 17:22):
fsh? not sushi?
Chris Moesel (Jan 27 2022 at 13:54):
@Grahame Grieve -- did you get past this? If it's still a problem, could you provide a little more info (by clarifying some of my questions above)? And if there is a way to reproduce, that would be cool.
Grahame Grieve (Jan 27 2022 at 19:20):
sushi not fsh. I haven't got back to this - too many other problems to look at. It's certainly something to do with a non-interactive shell though
Grahame Grieve (Feb 09 2022 at 19:36):
this is now jumped to the very top of my todo list. I've switched to OSX, which is much more traumatic than I expected. grr. But I can't run sushi from eclipse. I can run it from the terminal:
Grahame Grieve (Feb 09 2022 at 19:36):
sushi
info path-to-fsh-defs defaulted to current working directory
info Running SUSHI v2.2.6 (implements FHIR Shorthand specification v1.2.0)
info Arguments:
info /Users/grahamegrieve
Grahame Grieve (Feb 09 2022 at 19:36):
but trying to run it from the IG publisher under the debugger gives:
Grahame Grieve (Feb 09 2022 at 19:37):
Sushi couldn't be run. Complete output from running Sushi : (00:00.0025)
Note: Check that Sushi is installed correctly ("npm install -g fsh-sushi". On windows, get npm from https://www.npmjs.com/get-npm) (00:00.0025)
Exception: Cannot run program "sushi" (in directory "/Users/grahamegrieve/temp/igs/swissnoso"): error=2, No such file or directory (00:00.0025)
Publishing Content Failed: Cannot run program "sushi" (in directory "/Users/grahamegrieve/temp/igs/swissnoso"): error=2, No such file or directory (00:00.0026)
Grahame Grieve (Feb 09 2022 at 19:56):
this presumably is the answer: https://stackoverflow.com/questions/40503074/how-to-run-npm-command-in-java-using-process-builder
Grahame Grieve (Feb 09 2022 at 19:56):
answer 2
Grahame Grieve (Feb 09 2022 at 19:56):
but what should the hardcoded path be?
Elliot Silver (Feb 09 2022 at 22:10):
@Grahame Grieve I don't have any suggestions for you, but I've got sushi working on my mac. Let me know if there's anything you'd like me to try out.
Chris Moesel (Feb 09 2022 at 22:12):
I don't know how the publisher tries to invoke SUSHI, but if you think answer 2 in the stack overflow article is right, then you can find out where your npm lives by running which npm
in your terminal. E.g., for me it is:
... so I would want /Users/cmoesel/.nvm/versions/node/bin` in my env path. But this is of course very user-specific, so if you're looking for something that will work for everyone, we'd need to find a more robust solution.
I am using Mac. Is this something I can easily reproduce? I've never tried running IGP in Eclipse or a debugger.
Elliot Silver (Feb 09 2022 at 22:18):
hmm which npm
gives me /user/local/bin/npm.
Chris Moesel (Feb 09 2022 at 22:48):
Right. The location is user-specific, depending on how you installed node (and what version). This is why I said we'd need to find a more robust solution if Grahame needs something that will work for everyone. On the other hand, if he only needs something that will work for his own personal debugging, this might get him by.
Grahame Grieve (Feb 09 2022 at 23:48):
well, it needs to work for anyone who runs the IG publisher from a GUI application, not from terminal
Grahame Grieve (Feb 09 2022 at 23:48):
and setting environment variables is just crazy hard - if not impossible - on a mac.
Grahame Grieve (Feb 09 2022 at 23:49):
that is, system wide environment variables that GUI applications can see
Chris Moesel (Feb 10 2022 at 17:06):
@Grahame Grieve -- I think you implied in another thread that you resolved the SUSHI issue. Is that true? Or is there still more to be done here?
Grahame Grieve (Feb 10 2022 at 20:20):
actually, I did. From the next release, there's a file ~/.fhir/fhir-tool-settings.conf, which in format is a windows ini file. If you put the npm pathway in there, the IG publisher will add that path when running sushi.
[paths]
npm=/Users/grahamegrieve/.nvm/versions/node/v17.4.0/bin
ruby=/Users/grahamegrieve/.gem/ruby/3.1.0/bin:/Users/grahamegrieve/.gem/ruby/3.1.0/bin:/opt/homebrew/opt/ruby/bin:/Users/grahamegrieve/.nvm/versions/node/v17.4.0/bin:/opt/homebrew/bin:/opt/homebrew/sbin
tests=/Users/grahamegrieve/work/test-cases
compare=opendiff
temp=/Users/grahamegrieve/temp
Grahame Grieve (Feb 10 2022 at 22:31):
https://confluence.hl7.org/display/FHIR/Using+fhir-tool-settings.conf
Nick George (Feb 14 2022 at 17:30):
I was suggesting in an earlier thread, it would be nice to allow a flag for location of sushi binary, rather than relying on path resolution for unqualified sushi
Grahame Grieve (Feb 14 2022 at 18:52):
well i think this is what you were looking for
Last updated: Apr 12 2022 at 19:14 UTC