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

Hash bang syntax not portable #2

Open
fredcooke opened this issue Jan 7, 2017 · 7 comments
Open

Hash bang syntax not portable #2

fredcooke opened this issue Jan 7, 2017 · 7 comments

Comments

@fredcooke
Copy link
Contributor

In your fuct launch scripts you have #!python however on Debian Jessie that results in:

python: bad interpreter: No such file or directory

As it uses it as a path. Because Python is found in various places on various OSes, a better approach that I learned from John's 'haruspex' tool is to include it as #!/usr/bin/env python2 or similar.

@MrOnion
Copy link
Owner

MrOnion commented Jun 23, 2018

Forgot to answer this but the env has been used already and I think it's the distutils that strips it out from the final package when doing the build. This might need some tweaking to get it right if it's actually causing trouble.

@fredcooke
Copy link
Contributor Author

Doh. Should have known that you'd be doing it properly and it was a gotcha. Yes, I think it does/did cause issues. Haven't tried it on Ubunut Bionic, but might do shortly just because. I have my "fuct-dev" package installed so it should just work, aside from possibly this.

@fredcooke
Copy link
Contributor Author

BUILD FAILED - Missing plugin dependency 'pypandoc~=1.3.0': Installing collected packages: pypandoc

sudo pip install --upgrade pypandoc

pycollada 0.4 has requirement python-dateutil==1.5, but you'll have python-dateutil 2.6.1 which is incompatible.

[INFO] Installing plugin dependency pypandoc
[ERROR] Failed to install 'pypandoc':
Uninstalling pypandoc-1.4:

fred@karma:~/fuct/target/dist/fuct-0.9.1$ fuctloader
bash: /usr/local/bin/fuctloader: python: bad interpreter: No such file or directory

Yeah, still an issue.

@MrOnion
Copy link
Owner

MrOnion commented Jun 23, 2018

Ok, i'll look into this. The build script might also need some work to finish the python3 changes.

@fredcooke
Copy link
Contributor Author

fredcooke commented Jun 23, 2018 via email

@MrOnion
Copy link
Owner

MrOnion commented Jun 23, 2018

The pybuilder distutils plugin creates the broken shebang scripts and when you run 'python setup.py install' they are copied as-is. Although it's not mandatory to have them ready as the setup.py can produce them as well. For example if you clean the current build dir before installing by running 'python setup.py clean install', then the correct (your env) interpreter path is used. That could be added to the readme...

One way to generate working script files from the start could be to force the pybuilder distutils plugin to use overridden interpreter path that is the env one. Not clean, but you will end up with scripts with either the env path or the current system path which should both work.

@MrOnion
Copy link
Owner

MrOnion commented Jun 23, 2018

There is a workaround now in dev branch. Feel free to test it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants