examples/py2-project fails to build
Metadata
Current evaluation
Resolved in Snapcraft r164; commit e8fc4bd0f added libpython2.7-dev build packages to the Python 2 example, fixing the missing Python.h build failure.
Resolution: closed resolved
Reason: Commit e8fc4bd0f added libpython2.7-dev to the example's build packages, and maintainer ~dholbach confirmed after testing that the issue was fixed in r164.
Evaluated by: mr-cal-bot
No scores available.
Issue body
Using trunk code r157, running snapcraft from the examples/py2-project directory returns this on wily:
[...]
Building spongeshaker
python2 setup.py install --install-layout=deb --prefix=/home/fgimenez/workspace/snapcraft/build-examples-test/examples/py2-project/parts/spongeshaker/install/usr
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/spongeshaker
copying spongeshaker/test.py -> build/lib.linux-x86_64-2.7/spongeshaker
copying spongeshaker/sponge.py -> build/lib.linux-x86_64-2.7/spongeshaker
copying spongeshaker/stream_cipher.py -> build/lib.linux-x86_64-2.7/spongeshaker
copying spongeshaker/sha3.py -> build/lib.linux-x86_64-2.7/spongeshaker
copying spongeshaker/prng.py -> build/lib.linux-x86_64-2.7/spongeshaker
copying spongeshaker/spongewrap.py -> build/lib.linux-x86_64-2.7/spongeshaker
copying spongeshaker/hashing.py -> build/lib.linux-x86_64-2.7/spongeshaker
copying spongeshaker/__init__.py -> build/lib.linux-x86_64-2.7/spongeshaker
copying spongeshaker/util.py -> build/lib.linux-x86_64-2.7/spongeshaker
running build_ext
building 'spongeshaker.keccak' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -I/home/fgimenez/workspace/snapcraft/build-examples-test/examples/py2-project/parts/python2/install/include -I/home/fgimenez/workspace/snapcraft/build-examples-test/examples/py2-project/parts/python2/install/usr/include -I/home/fgimenez/workspace/snapcraft/build-examples-test/examples/py2-project/parts/python2/install/include/x86_64-linux-gnu -I/home/fgimenez/workspace/snapcraft/build-examples-test/examples/py2-project/parts/python2/install/usr/include/x86_64-linux-gnu -fPIC -I/usr/include/python2.7 -c src/keccak.c -o build/temp.linux-x86_64-2.7/src/keccak.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -I/home/fgimenez/workspace/snapcraft/build-examples-test/examples/py2-project/parts/python2/install/include -I/home/fgimenez/workspace/snapcraft/build-examples-test/examples/py2-project/parts/python2/install/usr/include -I/home/fgimenez/workspace/snapcraft/build-examples-test/examples/py2-project/parts/python2/install/include/x86_64-linux-gnu -I/home/fgimenez/workspace/snapcraft/build-examples-test/examples/py2-project/parts/python2/install/usr/include/x86_64-linux-gnu -fPIC -I/usr/include/python2.7 -c src/pykeccak.c -o build/temp.linux-x86_64-2.7/src/pykeccak.o
src/pykeccak.c:20:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Failed doing build for spongeshaker!
Thanks!
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Resolved in Snapcraft r164; commit e8fc4bd0f added libpython2.7-dev build packages to the Python 2 example, fixing the missing Python.h build failure. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed in r164: python2-plugin stage-packages list concat TypeError corrected; maintainer @~dholbach confirmed examples/py2-project builds after the fix. | |
| stealth/space-bunny-alpha | — | closed stale | Closed as stale with no fix: spongeshaker’s C extension could not compile because Python.h was missing in examples/py2-project (Launchpad #1494825). | |
| qwen/qwen3.6-35b-a3b | — | — | Closed due to inactivity. The example failed to build because the Python.h header was missing during C extension compilation. No resolution or fix was applied. | |
| qwen/qwen3.6-35b-a3b | — | — | Abandoned and closed without resolution due to prolonged inactivity. The build failure stemmed from a missing Python.h header during C extension compilation. The example was likely superseded by Python 3 updates and snapcraft improvements. |
Update history
| Date | Change |
|---|---|
| created |
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1501977 py2-project example fails to snap | snapcraft (launchpad) | closed | Fixed by adding the required Make plugin to the py2-project example in snapcraft commit 0ea109f98. | |
| #1501997 python projects might fail to snap if the package python-dev is not installed | snapcraft (launchpad) | closed | Fixed by adding libpython2.7-dev as a Python plugin build package in commit d436aa787, originally proposed in e8fc4bd0f. |