From 65009e0ee8687251e52dea17bf7644978d8197c4 Mon Sep 17 00:00:00 2001 From: Caetano Melone Date: Thu, 19 Feb 2026 16:02:53 -0800 Subject: [PATCH 1/2] fix: libseccomp+python build libseccomp's python extension Makefile does a check for out of source builds, but fails when srcdir and builddir are different strings but point to the same underlying directory (ie `dir` and `.`). ``` [ /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 adds a patch that checks if the file to be copied already exists in the builddir before attempting to copy it over. --- .../builtin/packages/libseccomp/fix-pyx-copy.patch | 11 +++++++++++ .../spack_repo/builtin/packages/libseccomp/package.py | 1 + 2 files changed, 12 insertions(+) create mode 100644 repos/spack_repo/builtin/packages/libseccomp/fix-pyx-copy.patch diff --git a/repos/spack_repo/builtin/packages/libseccomp/fix-pyx-copy.patch b/repos/spack_repo/builtin/packages/libseccomp/fix-pyx-copy.patch new file mode 100644 index 00000000000..287e5a58b20 --- /dev/null +++ b/repos/spack_repo/builtin/packages/libseccomp/fix-pyx-copy.patch @@ -0,0 +1,11 @@ +--- a/src/python/Makefile.in 2026-02-19 ++++ b/src/python/Makefile.in 2026-02-19 +@@ -36,7 +36,7 @@ + all-local: build + + build: ../libseccomp.la libseccomp.pxd seccomp.pyx setup.py +- [ ${srcdir} = ${builddir} ] || cp ${srcdir}/seccomp.pyx ${builddir} ++ test -f ${builddir}/seccomp.pyx || cp ${srcdir}/seccomp.pyx ${builddir} + ${PY_BUILD} && touch build + + install-exec-local: build diff --git a/repos/spack_repo/builtin/packages/libseccomp/package.py b/repos/spack_repo/builtin/packages/libseccomp/package.py index 736b4689ba4..8364b9ca03d 100644 --- a/repos/spack_repo/builtin/packages/libseccomp/package.py +++ b/repos/spack_repo/builtin/packages/libseccomp/package.py @@ -35,6 +35,7 @@ class Libseccomp(AutotoolsPackage, PythonExtension): # https://github.com/seccomp/libseccomp/commit/afbde6ddaec7c58c3b281d43b0b287269ffca9bd depends_on("python@:3.11", type=("run", "link", "build"), when="@:2.5") depends_on("py-setuptools", type="build", when="@2.6:") + patch("fix-pyx-copy.patch", when="@2.6") def configure_args(self): return self.enable_or_disable("python", variant="python") From 348f71c48582e22e32e81de01550e8b7a47d51a9 Mon Sep 17 00:00:00 2001 From: Caetano Melone Date: Sat, 21 Feb 2026 10:57:16 -0800 Subject: [PATCH 2/2] add link to upstream PR --- repos/spack_repo/builtin/packages/libseccomp/package.py | 1 + 1 file changed, 1 insertion(+) diff --git a/repos/spack_repo/builtin/packages/libseccomp/package.py b/repos/spack_repo/builtin/packages/libseccomp/package.py index 8364b9ca03d..25e7d5295ac 100644 --- a/repos/spack_repo/builtin/packages/libseccomp/package.py +++ b/repos/spack_repo/builtin/packages/libseccomp/package.py @@ -35,6 +35,7 @@ class Libseccomp(AutotoolsPackage, PythonExtension): # https://github.com/seccomp/libseccomp/commit/afbde6ddaec7c58c3b281d43b0b287269ffca9bd depends_on("python@:3.11", type=("run", "link", "build"), when="@:2.5") depends_on("py-setuptools", type="build", when="@2.6:") + # upstream PR: https://github.com/seccomp/libseccomp/pull/482 patch("fix-pyx-copy.patch", when="@2.6") def configure_args(self):