-
Notifications
You must be signed in to change notification settings - Fork 103
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
Update jas_realpath to use python3 for python3-only environment #365
Conversation
I don't like this change for a few reasons. First, it unnecessarily duplicates the Python code. Second, and more importantly, there should really be an executable called "python" on the system (that provides some unspecified version of python) and the Python code from this script should work with any Python version (i.e., Python 2 or 3). A better solution would be to simply to have the user provide a wrapper script named "python" that invokes whatever their python executable is called, if it is not called "python". Otherwise, we are heading down a slippery slope since I have seen systems that have Python installed as "python3.x" or "python2.x" and so on ad nauseam (but not as "python"). |
Thanks for a quick reply. However in some system, they do distinguish python3 from python. For example, in Ubuntu22.04 and Rocky Linux-8 they don't have "python" for executing python3 by default, and we are not able to modify the HPC environment. I don't think there should be python3.x or python2.x but only python and python3 should be sufficient. This does not work if you still use bash shell to call python, that some system does not recognize python for python3. |
If you are building JasPer, obvioulsy you must have write access somewhere in the filesystem. So, you can just create a script called "python" (in some directory where you can create files) that invokes the real python on your system and place this script on your search path. It is not necessary to place the script in a system directory. |
This is for CI/CD. And therefore anything can help for installing the JasPer from scratch without specific-site tuning will be helpful. |
The standard program name for Python is "python". I have seen people use many different suffixes for variants of Python, but these suffixes are not limited to just "2" and "3". Some systems have multiple 2.x or 3.x versions installed and use suffixes like "2.6", "2.7", "3.9", "3.10", etc.. If I support the suffix "3", I must (as a matter of principle) support all suffixes that people might choose to use, and I don't want to go down that path. The better way to do address this issue would be to have the user configure the name of the Python command when building the code. I don't think that this is really worth the complexity, however, as most users do not run the test suite and, for the ones who do, providing a wrapper script is an easy solution. |
Is there any reason why not use |
@jubalh Some platforms do not have realpath and/or readlink. macOS is one such example. Since Python is quite well supported across most mainstream platforms, I implemented a dumb version of realpath using python. |
Ok I see. |
@hydrogencl The following did not occur to me previously, but on a more fundamental level, why are you using the jas_realpath script? As far as I can tell, it is only invoked by scripts used internally by the JasPer project for GitHub CI. In particular, the jas_realpath script seems to only be used by the build/build and build/build_all scripts. How is it that you are causing jas_realpath to be invoked? |
On our HPC system |
@hydrogencl You should not be running the build/build script. This script is only for internal use by the JasPer project for GitHub CI. If you would like to build and install JasPer, you should follow the instructions in the INSTALL.txt file for JasPer. |
@hydrogencl I have performed some refactoring of some of the Bash scripts used by JasPer, and as a consequence of this refactoring the build/build script might work now in the unsupported way in which you are trying to use it. In any case, what you are trying to do is unsupported so if you want to build JasPer in a reliable way, you should use the instructions in the INSTALL.txt file. |
Just a small update for python3 only environment