Repository navigation
setup.py: only link objects built inside the build tree - #269
Merged
Merged
Conversation
When building from an unpacked sdist, setup.py looked for pacparser.o and pacparser.h in the parent directory and linked/included whatever it found there. That directory is outside the package (for pip installs of a local sdist it is $TMPDIR itself), so in the sdist layout only use objects and headers from the build tree, compiled from the shipped sources. Detect the sdist layout by its generated PKG-INFO, drop the redundant Windows object override, and make the libquickjs.a Makefile rule depend on the QuickJS sources so a stale archive is rebuilt. Also document the scope of security reports in SECURITY.md.
The cibuildwheel build copies the C sources into src/pymod and builds the objects there, but has no PKG-INFO, so it was treated as the source tree and linked against ../pacparser.o.
ubuntu-latest is now Ubuntu 26.04, for which actions/setup-python has no Python 3.8 or 3.9 builds. Linux wheels for those versions are still built by cibuildwheel.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



When building from an unpacked sdist,
setup.pysearched the parent directory forpacparser.o(andpacparser.hviainclude_dirs) and used whatever it found. That directory is outside the package. Forpip install ./pacparser-x.tar.gzit is$TMPDIRitself, since pip unpacks local sdists to$TMPDIR/pip-req-build-*.Changes:
setup.py(an unpacked sdist, or the cibuildwheel build, which copies them in), compile and link only./pacparser.oand./quickjs/libquickjs.a, and include only..make -C src pymod) still uses the Makefile's objects insrc/. The separate Windows override is removed because it now matches the default.quickjs/libquickjs.ainsrc/Makefilenow depends onquickjs.candquickjs.h, so a stale archive gets rebuilt.SECURITY.md: document what is in and out of scope for security reports.Testing:
NO_INTERNET=1 make -C src,make -C src pymod, andtests/test_sdist_metadata.pypass.pip install -v --no-binary pacparser ./pacparser-1.0.0.tar.gzwith junkpacparser.o,pacparser.h, andquickjs/libquickjs.aplanted in$TMPDIR: before this change the link used../pacparser.o; after it, the link uses the local objects and the module imports fine.