Skip to content

fix: in-source python builds#482

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

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

Conversation

@cmelone
Copy link

@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.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments