-
-
Notifications
You must be signed in to change notification settings - Fork 581
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
python3 spkg-configure: Only search for "python3", implement "configure --with-python=/PATH/TO/PYTHON" #30546
Comments
comment:1
perhaps copypasted comments in .m4 file may be trimmed. |
Upstream: Reported upstream. No feedback yet. |
comment:3
I don't know if this is a defect. If you have a directory containing python3 in the front of your path, shouldn't that be the python we are using? |
comment:5
Why is that the case? It's perfectly fine to have different fully-featured python3.x installed. E.g. that's what I have on a Gentoo box, without doing anything special:
On Ubuntu 18.04 one can install python3.8 (the system python is 3.6, and I'm not sure if it works well in Sage) |
comment:7
Replying to @dimpase:
Because the user seems to have expressed a preference for the python3 provided by the directory in the front of the PATH. |
comment:8
Replying to @mkoeppe:
for this, we should revive Besides, as I said, it's not always safe to prepend stuff to your PATH. |
comment:9
Putting the bin directory of a Python installation in the front of the PATH is the standard way of activating a venv, for example. |
Replying to @dimpase:
I would think this needs some elaboration. |
comment:11
Replying to @mkoeppe:
Say, you build under Homebrew, but want to use system Python, in /usr/bin. Same with Conda - it prepends stuff to PATH, and prepending /usr/bin or /usr/local/bin to PATH under active Conda will likely break it. In general, many Python-dependent environments have the concept of "main" Python. We discussed on
Prepending to the PATH here might open a can of worms. |
comment:12
I think I agree with Matthias here. Prepending locations to the search path is the "standard" way of encouraging autotools to find your preferred version of something, and our widespread use of e.g. In this case maybe it is unexpected that a copy of python-3.6 in |
comment:13
I don't understand - I have given you an example: prepending /usr/bin to PATH on Homebrew or Conda is basically not possible. Yet I want to build Sage with Python3.8 in /usr/bin, as opposed to an earlier version which is 1st in the PATH. |
comment:14
Replying to @dimpase:
Yes, it's represented by the unversioned "python3" in the front of the PATH. |
comment:15
Replying to @dimpase:
Why would anyone want to prepend /usr/bin? |
comment:16
Sorry, I don't see evidence of a "critical defect" anywhere here |
comment:17
Replying to @dimpase:
Yes, I think so. Note that it is already possible to do |
comment:18
Replying to @dimpase:
I understand. Can you prepend your preferred location to Bringing back |
comment:19
Replying to @orlitzky:
This is a very fragile solution. There are many things in /usr/bin that might wreak havoc, imagine some
my solution has one advantage - it makes the outcome independent of the order of things in PATH, which is something that users might - and will - screw up.
it is a bit pointless to discuss whether it works on a box at hand, as it is obviously a very fragile solution, and I explained why. |
comment:20
Replying to @dimpase:
We probably don't want normal users doing it to override one specific program (python) and not others, sure. I was just curious. And I had forgotten that I guess we all agree |
comment:21
Replying to @dimpase:
But I don't think this is what users want. If there's a |
comment:63
Actually... this still needs to ensure an absolute path for PYTHON_FOR_VENV |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:65
I think this version is good. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:67
Merged #30576 to avoid merge conflict |
Dependencies: #30576 |
Branch pushed to git repo; I updated commit sha1. Last 10 new commits:
|
comment:70
Meregd #29500 to avoid merge conflict |
comment:71
it is broken:
(while just It seems you are repeating the error that took me hours to sort out today, you have two |
comment:73
Perhaps it's just that AC_PATH_PROGS_FEATURE_CHECK does not like it if the searched executable is already an absolute path? I may only have tested with executable names without directory... |
Changed branch from u/mkoeppe/build/py3x_conf to u/dimpase/build/py3x_conf |
comment:74
OK, this appears to work. I just convert the name into an absolute one, if needed, by calling New commits:
|
comment:76
I think we really want this in 9.2, not the least as it documents stuff. |
Changed branch from u/dimpase/build/py3x_conf to |
We make the
configure
search for a suitablepython3
more straightforward.Instead of searching for various names such as
python3.8
,python3.7
etc., we only look forpython3
.As is standard practice, users will set their
PATH
so that thepython3
that is accessible from thePATH
is the desired Python version.As an additional mechanism, we add
configure --with-python=/PATH/TO/PYTHON
. In contrast to the (undocumented)configure PYTHON3=/PATH/TO/PYTHON
, it runs the usual tests whether this python is actually suitable.Depends on #30576
Depends on #29500
CC: @mkoeppe @embray @orlitzky
Component: build: configure
Author: Matthias Koeppe, Dima Pasechnik
Branch/Commit:
f19d9a4
Reviewer: Dima Pasechnik, Matthias Koeppe
Issue created by migration from https://trac.sagemath.org/ticket/30546
The text was updated successfully, but these errors were encountered: