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

Update jas_realpath to use python3 for python3-only environment #365

Closed
wants to merge 1 commit into from

Conversation

hydrogencl
Copy link

@hydrogencl hydrogencl commented Nov 30, 2023

Just a small update for python3 only environment

@mdadams
Copy link
Collaborator

mdadams commented Nov 30, 2023

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").

@hydrogencl
Copy link
Author

hydrogencl commented Nov 30, 2023

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.

@mdadams
Copy link
Collaborator

mdadams commented Dec 4, 2023

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.

@hydrogencl
Copy link
Author

This is for CI/CD. And therefore anything can help for installing the JasPer from scratch without specific-site tuning will be helpful.

@mdadams
Copy link
Collaborator

mdadams commented Dec 13, 2023

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.

@jubalh
Copy link
Member

jubalh commented Jan 24, 2024

Is there any reason why not use realpath (1) or readlink (1)? Both are provided via the coreutils package.

@mdadams
Copy link
Collaborator

mdadams commented Jan 24, 2024

@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.

@jubalh
Copy link
Member

jubalh commented Jan 25, 2024

Ok I see.

@mdadams
Copy link
Collaborator

mdadams commented Jan 31, 2024

@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?

@hydrogencl
Copy link
Author

On our HPC system python3 is not soft-linked to python. I am not using the jas_realpath, it's build/build want to use jas_realpath.

@mdadams
Copy link
Collaborator

mdadams commented Jan 31, 2024

@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.

@mdadams
Copy link
Collaborator

mdadams commented Feb 5, 2024

@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.

@mdadams mdadams closed this Feb 5, 2024
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

Successfully merging this pull request may close these issues.

3 participants