Skip to content

BUG: fix in-source python builds#482

Closed
cmelone wants to merge 1 commit intoseccomp:mainfrom
cmelone:fix/py-makefile
Closed

BUG: fix in-source python builds#482
cmelone wants to merge 1 commit intoseccomp:mainfrom
cmelone:fix/py-makefile

Conversation

@cmelone
Copy link
Copy Markdown
Contributor

@cmelone cmelone commented Feb 20, 2026

the Makefile for the python bindings does a check for out of source builds to see if it should copy the .pyx file. However, if srcdir and builddir are different strings but point to the same directory, the cp command will fail.

[ /var/tmp/melone1/spack-stage/spack-stage-libseccomp-2.6.0-w24sgwofjl4355bnza4sfvikvesxqawt/spack-src/src/python = . ] || cp /var/tmp/melone1/spack-stage/spack-stage-libseccomp-2.6.0-w24sgwofjl4355bnza4sfvikvesxqawt/spack-src/src/python/seccomp.pyx .
cp: '/var/tmp/melone1/spack-stage/spack-stage-libseccomp-2.6.0-w24sgwofjl4355bnza4sfvikvesxqawt/spack-src/src/python/seccomp.pyx' and './seccomp.pyx' are the same file

This patch makes the build step more robust by checking if the .pyx file exists in the builddir (will resolve to true if srcdir==builddir). Otherwise, it will copy the file over.

@pcmoore pcmoore changed the title fix: in-source python builds BUG: fix in-source python builds Apr 8, 2026
@pcmoore
Copy link
Copy Markdown
Member

pcmoore commented Apr 8, 2026

Thanks for the patch @cmelone! Overall I think it looks fine to me, just two small nitpicks (above).

the Makefile for the python bindings does a check for out of source
builds to see if it should copy the .pyx file. However, if `srcdir` and
`builddir` are different strings but point to the same directory, the
`cp` command will fail.

This patch makes the build step more robust by checking if the .pyx file
exists in the `builddir` (will resolve to true if srcdir==builddir).
Otherwise, it will copy the file over.

Signed-off-by: Caetano Melone <melone1@llnl.gov>
@pcmoore pcmoore added this to the v2.6.1 milestone Apr 9, 2026
@pcmoore
Copy link
Copy Markdown
Member

pcmoore commented Apr 9, 2026

The CI test failure above is due to a bad merge in the main branch that has since been fixed. No need to rebase @cmelone, that will resolve itself normally when merging.

@pcmoore
Copy link
Copy Markdown
Member

pcmoore commented Apr 9, 2026

Thank for the updates @cmelone, as this is a small and obviously good fix I've merged this into main via d891cb8 and release-2.6 via c144002. Thanks!

@pcmoore pcmoore closed this Apr 9, 2026
@cmelone cmelone deleted the fix/py-makefile branch April 9, 2026 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants