cxcsds / ciao-contrib

Extra scripts and code to enhance the capabilities of CIAO.
GNU General Public License v3.0
8 stars 6 forks source link

Replace shebang? #128

Open kglotfelty opened 6 years ago

kglotfelty commented 6 years ago

@DougBurke has mentioned this before and I'm just recording this here as something to be considered. I'm not necessarily advocating for it.

Part of the issue related to #127 is that we use the shebang

#!/usr/bin/env python

in the contrib scripts.

This is convenient but leaves us open to problems where users (or OTS) change the PATH such that CIAO's python is no longer first.

Q: Should we change to a hard-coded shebang that gets configured?

That is in the contirb tar file we would ship contrib/bin/foo.in with a shebang macro

#!@PYTHON@

kind of thing. Then CIAO's configure would need to replace that with the hard coded location to CIAO, eg

#!/soft/ciao/bin/python

I think bin rather than ots/bin to deal with .ciaorc stuff?

This would require two changes

I actually thought this is what was happening with the DS scripts, eg acis_streak_map, but it's not. The macro is expanded when the script is built and installed, and for CIAO it sets it to the same generic /usr/bin/env python . Oddly arfcorr is just hard-coded that way (no .in file).

Thoughts?

DougBurke commented 4 years ago

I guess this is still an issue even with the python setup.py install work (it's less relevant for the conda builds I think since they do there own path munging).

kglotfelty commented 4 years ago

yes, it's still an issue because it bakes in the ots/bin/python path -- but it needs the wrapper to set the env. variables.

On Fri, Nov 15, 2019 at 3:35 PM Doug Burke notifications@github.com wrote:

I guess this is still an issue even with the python setup.py install work (it's less relevant for the conda builds I think since they do there own path munging).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cxcsds/ciao-contrib/issues/128?email_source=notifications&email_token=ABS2QI6J2AB4JDZZJSM26DTQT4BZTA5CNFSM4FA5LJW2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEGUP7I#issuecomment-554518525, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABS2QIYHF7SF3SZC7NXNIG3QT4BZTANCNFSM4FA5LJWQ .