Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binary on Ubuntu 16.04 #16

Open
b-studios opened this issue Apr 15, 2020 · 7 comments
Open

Binary on Ubuntu 16.04 #16

b-studios opened this issue Apr 15, 2020 · 7 comments
Labels
bug Something isn't working

Comments

@b-studios
Copy link
Collaborator

b-studios commented Apr 15, 2020

On Ubuntu 16.04 it has been reported that Effekt cannot be exeucted since
java -jar is treated as one command instead of a command and an argument.


The Effekt "binary" is created by prefixing:

#! /usr/bin/env java -jar

to the jar file itself. Installing it with npm makes the binary available (almost) platform independently. In particular on Windows, npm analyses the shebang and automatically generates scripts that correctly start Effekt by invoking java -jar.

We could change the shebang to

#! java -jar

which seems to work on MacOS X, Windows 10 and Ubuntu 16.04 -- however, now we cannot start Effekt as a subprocess from node. This is necessary to start the language server in the VSCode extension.

@b-studios b-studios added the bug Something isn't working label Apr 15, 2020
@b-studios
Copy link
Collaborator Author

I could also reproduce the bug on a fresh 18.04 VM:

$ effekt
/usr/bin/env: 'java -jar': No such file or directory

@b-studios
Copy link
Collaborator Author

b-studios commented Apr 15, 2020

As a workaround, one can of course run java -jar /usr/local/bin/effekt, but this is not satisfactory. However, getting vscode on Ubuntu to work is a bit more tricky since adjusting the path in the settings will not work for reasons similar to the ones described above.

@b-studios
Copy link
Collaborator Author

b-studios commented Apr 15, 2020

A more reliable workaround is the following:

Create a script effekt.sh with the following contents:

#!/bin/bash
java -jar /usr/bin/local/effekt $@

and make it executable. Put this script in your PATH and use effekt.sh instead of effekt. This also works for VSCode:

  • Enter settings
  • navigate to Effekt / path to executable
  • enter effekt.sh (or the absolute path to the script) there

This solution also interacts well with updating the effekt package. Since the script only forwards to effekt, updating it under the hood just works.

@b-studios
Copy link
Collaborator Author

As a workaround I added the script to the distribution (87a4b0) and link it as effekt.sh. So linux users for now need to call effekt.sh instead of effekt. Also VSCode can now be configured to point to effekt.sh if effekt does not work.

@b-studios
Copy link
Collaborator Author

This needs to be documented on the website.

@waterlens
Copy link

So why not just pass -S to env to make it recognize the multiple arguments?

@JonathanStarup
Copy link
Contributor

So why not just pass -S to env to make it recognize the multiple arguments?

This -S flag breaks on windows :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants