| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c2ca772 commit 9e863fa
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1616,6 +1616,8 @@ Programs/_bootstrap_python.o: Programs/_bootstrap_python.c $(BOOTSTRAP_HEADERS) | |||
| 1616 | 1616 | _bootstrap_python: $(LIBRARY_OBJS_OMIT_FROZEN) Programs/_bootstrap_python.o Modules/getpath.o Modules/Setup.local | |
| 1617 | 1617 | $(LINKCC) $(PY_LDFLAGS_NOLTO) -o $@ $(LIBRARY_OBJS_OMIT_FROZEN) \ | |
| 1618 | 1618 | Programs/_bootstrap_python.o Modules/getpath.o $(LIBS) $(MODLIBS) $(SYSLIBS) | |
| 1619 | + # Dummy pybuilddir.txt is needed for _bootstrap_python to be runnable | ||
| 1620 | + @echo "none" > ./pybuilddir.txt | ||
| 1619 | 1621 | ||
| 1620 | 1622 | ||
| 1621 | 1623 | ############################################################################ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,4 @@ | |||
| 1 | + :file:`Modules/Setup.local` is no longer used as a landmark to discover | ||
| 2 | + whether Python is running in a source tree, as it could potentially affect | ||
| 3 | + actual installs. The :file:`pybuilddir.txt` file is now the sole indicator | ||
| 4 | + of running in a source tree. | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -129,8 +129,7 @@ | |||
| 129 | 129 | # checked by looking for the BUILDDIR_TXT file, which contains the | |
| 130 | 130 | # relative path to the platlib dir. The executable_dir value is | |
| 131 | 131 | # derived from joining the VPATH preprocessor variable to the | |
| 132 | - # directory containing pybuilddir.txt. If it is not found, the | ||
| 133 | - # BUILD_LANDMARK file is found, which is part of the source tree. | ||
| 132 | + # directory containing pybuilddir.txt. | ||
| 134 | 133 | # prefix is then found by searching up for a file that should only | |
| 135 | 134 | # exist in the source tree, and the stdlib dir is set to prefix/Lib. | |
| 136 | 135 | ||
@@ -177,7 +176,6 @@ | |||
| 177 | 176 | ||
| 178 | 177 | if os_name == 'posix' or os_name == 'darwin': | |
| 179 | 178 | BUILDDIR_TXT = 'pybuilddir.txt' | |
| 180 | - BUILD_LANDMARK = 'Modules/Setup.local' | ||
| 181 | 179 | DEFAULT_PROGRAM_NAME = f'python{VERSION_MAJOR}' | |
| 182 | 180 | STDLIB_SUBDIR = f'{platlibdir}/python{VERSION_MAJOR}.{VERSION_MINOR}{ABI_THREAD}' | |
| 183 | 181 | STDLIB_LANDMARKS = [f'{STDLIB_SUBDIR}/os.py', f'{STDLIB_SUBDIR}/os.pyc'] | |
@@ -190,7 +188,6 @@ | |||
| 190 | 188 | ||
| 191 | 189 | elif os_name == 'nt': | |
| 192 | 190 | BUILDDIR_TXT = 'pybuilddir.txt' | |
| 193 | - BUILD_LANDMARK = f'{VPATH}\\Modules\\Setup.local' | ||
| 194 | 191 | DEFAULT_PROGRAM_NAME = f'python' | |
| 195 | 192 | STDLIB_SUBDIR = 'Lib' | |
| 196 | 193 | STDLIB_LANDMARKS = [f'{STDLIB_SUBDIR}\\os.py', f'{STDLIB_SUBDIR}\\os.pyc'] | |
@@ -513,13 +510,9 @@ def search_up(prefix, *landmarks, test=isfile): | |||
| 513 | 510 | platstdlib_dir = real_executable_dir | |
| 514 | 511 | build_prefix = joinpath(real_executable_dir, VPATH) | |
| 515 | 512 | except (FileNotFoundError, PermissionError): | |
| 516 | - if isfile(joinpath(real_executable_dir, BUILD_LANDMARK)): | ||
| 517 | - build_prefix = joinpath(real_executable_dir, VPATH) | ||
| 518 | - if os_name == 'nt': | ||
| 519 | - # QUIRK: Windows builds need platstdlib_dir to be the executable | ||
| 520 | - # dir. Normally the builddir marker handles this, but in this | ||
| 521 | - # case we need to correct manually. | ||
| 522 | - platstdlib_dir = real_executable_dir | ||
| 513 | + # We used to check for an alternate landmark here, but now we require | ||
| 514 | + # BUILDDIR_TXT to exist. (gh-151544; CVE-2026-12003) | ||
| 515 | + pass | ||
| 523 | 516 | ||
| 524 | 517 | if build_prefix: | |
| 525 | 518 | if os_name == 'nt': | |
| Back | FazBrowse Home | New Git URL |
0 commit comments