Library-path glitch, again

Eric S. Raymond esr at thyrsus.com
Fri Oct 6 13:32:06 UTC 2017


Fred Wright writes:
>Sorry for the lateness, but I realized that the current code still has a
>bug (as well as a couple of deficiencies of a more-or-less cosmetic
>nature).  It's currently checking sys.path in the *running* Python, but it
>needs to be checking it in the *target* Python.  Specifying a different
>Python otherwise works, so this should respect the difference.
>
>One ofthe "cosmetic" issues is that the directory existence check is
>superfluous.  The case table looks like this:
>
>Exists?         In sys.path?    Usable?
>-------         ------------    -------
>No              No              Unknown
>No              Yes             Yes, but this can't happen (*)
>Yes             No              No
>Yes             Yes             Yes
>
>* site.py's sys.path setup filters nonexistent directories
>
>Since the install procedure would create the directory if needed, testing
>for its preexistence is at best useless.
>
>The other "cosmetic" issue is that there's no need to "manually" construct
>'localized' at all, since that's what get_python_lib() with the prefix
>supplied already does.  The only reason to avoid the value that waf comes
>up with is that it might not be in sys.path, but *conditionally* using
>that value is fine, and simpler.

But Gary replies:

>Uh, I disagree on the 3rd case (Yes, No).  I install, then add my
>dir to PYTHONPATH.
>
>I guess we could document that: for people that want to be HFS
>conformant, add PYTHONPATH before doing the install.

Then Daniele Nicolodi says:

>I alredy suggested that, but it has been ignored. Let's try again.
>
>If you want to install in /usr/local or wherever else:
>
>python3 -m venv --system-site-packages --without-pip /usr/local/
>waf configure --python=/usr/local/bin/python3
>
>and all should work (assuming that waf does the right thing when a
>python interpreter is specified at configure time, ie replace the right
>executable on the shebang of the installed scripts).

Fred, your timing is awful and you shouldn't have submitted multiple
changes as a single MR.  Three days ago I might have taken a single,
simple change that fixed the one bug.  Now I can't justify doing that
- especially when Gary has raised a question about your analysis.

This is not a time for cosmetic fixes.

Daniele, you weren't ignored.  I read and processed what you said,
but it's way too late in the cycle to redo the build around a technique
(virtual environments) that the senior devs don't have experience with.

Unless somebody explains a *release-blocking* bug in the build to me,
we're going to ship the recipe as-is and futz with it after 1.0. It's
time to get the scientists away from them thar rocket and shoot it.

The one patch I would like to see is to devel/TODO explaining the
source/target bug.
-- 
		<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>

The Constitution is not neutral. It was designed to take the
government off the backs of the people.
	-- Justice William O. Douglas 


More information about the devel mailing list