-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
make symlinking python3->python optional #7960
make symlinking python3->python optional #7960
Conversation
I vote for defaulting to True. That's what Anaconda does. |
From what I understand, the Python standard says to use: #!/usr/bin/env python3 for Python 3-only code, #!/usr/bin/env python2 for Python 2-only code, and #!/usr/bin/env python for code that is compatible with both. So symlinking |
Can we just follow PEP 394? https://legacy.python.org/dev/peps/pep-0394/
|
The problem with respecting PEP 394 is that it breaks stuff in practice. There are packages (I don't remember which from the top of my head) that REQUIRE I know at least of ArchLinux that does the
If spack has inconsistencies between python2 and python3 implementations I'd consider this a bug in spack! As @adamjstewart said if you use I'm not opposed to making it optional, but the default should be |
This would be a useful discussion to have; EXCEPT that it has already been had for us, and an answer decided upon by the wider Python community in PEP 394. At this point, the issue isn't what we think is right or wrong, or what we personally want, or what Anaconda or ArchLinux did; it's simply a matter of reading and following the standard.
Unfortunately, as the PEP 394 authors point out, NOT following PEP 394 breaks other stuff in practice. In fact, it broke things for me, which is how I noticed this in the first place. In cases like this, standards serve to determine where the bug lies, and therefore where more effort is required to make things work. PEP 394 makes it clear that a package that any package that REQUIRES Non-standard implementations of the platform only serve to perpetuate buggy (i.e. non-standard) packages that rely on it. We've seen similar stuff in C++ compilers for years. How many times has GNU removed a non-standard feature from their compiler, breaking existing non-standard code --- while adding a command-line switch for people who ABSOLUTELY HAVE to have the non-standard feature or behavior. As systems move toward increasing standards compliance, some people grumble, but eventually everything works better together. I do not dispute that some packages currently require non-standard Pythons. Moving the entire
Reliance on non-standard behavior is BY DEFINITION a system dependency.
Had you stuck with Ubuntu, you would also have this issue: Python3 is now the default and the |
@tgamblin @scheibelp I need this merged because #7103 breaks some builds. We are all in agreement on the PR, other than whether it should default to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine but I think the variant should be called pythoncmd
or something a bit more descriptive than “symlink”.
I would vote with @healther and @adamjstewart to default True
for now and to try to make packages in Spack follow this part of PEP 394:
python should be used in the shebang line only for scripts that are source compatible with both Python 2 and 3
I realize it also says that distros should ensure that python
is python2, but I think Spack can afford to be a bit more future looking than the distros, as we have options like this variant.
I’m fine to merge with the changes above.
I like the suggestion for the variant name. I didn't like `symlink` but couldn't think of anything better.
There was at least one package which didn't allow for this. That was the whole reason for adding the symlinking in the first place. I'd really say we should be future looking and not backwards. Adhering to a spec is not better per se. The argument should ALWAYS be "it makes sense" not "it was written ". This will come back an bite us. spack is supposed to serve the scientific community. Stuff that is NOW run and used and developed WILL be used far beyond 2020. I can override this for us, so it's not a showstopper for me... But really why assume |
@healther Did you see recent communication on this thread? Please review and speak up if you would like to see any further changes; otherwise, this PR is ready to merge. |
Yes I saw it, I'd prefer the default to be btw: I restarted Travis as the coverage stuff failed. |
Yes I saw it, I'd prefer the default to be +pythoncmd but if I'm the sole
one then merge it as is. My prediction is: It will end up coming back
annoying us later if we default to False.
The time for this kind of discussion is over. @tgamblin made a final
decision. As long as the current state of the PR corresponds to that
decision, it should be merged. @tgbamlin has affirmed that it meets his
decision by his approval of the PR.
I just re-checked the "Files changed" tab at the top of the PR, and it
defaults to `True`. Am I missing something?
|
@healther see the note at the bottom of http://spack.readthedocs.io/en/latest/contribution_guide.html#coverage |
@adamjstewart I know but it's also a step in Travis, if that fails with a non-zero error code the next stage is not triggered. I should have been more precise to say that the coverage report generation failed |
@adamjstewart @healther
This PR makes #7103 optional. I believe #7103 is not a good idea for the following reasons:
It is not the way the Python distro does things.
python3
is the standard name for the Python3 executable, andpython
, according to the standard, always means Python2. By default, Spack installations should conform to the standard.It does weird things to my Spack. Consider what I did:
module load
of my software stack.spack
command is now running with Python3, not Python2. What horrible inconsistencies might that cause, AFTER I've built a lot of stuff? (To be fair, Spack works with Python3 too. But it still makes me nervous).It breaks some builds. I have builds that assume, as per the standard, that "python" means Python2. (Admittedly, these builds should probably be fixed to use the
python2
executable).Anyway... I think it's best to leave the symlinking as optional. So now there's a
python+symlink
variant.