python2 plugin: no 'build' directory found by setup.py under distribution root
Metadata
Current evaluation
⚠️ This summary may be outdated — the issue content or evaluation prompts have changed since this evaluation was made.
Closed without resolution, likely abandoned or superseded due to Python 2 deprecation and snapcraft updates. No fix or merge details provided.
Suggested action: —
No scores available.
Issue body
I have a project (www.tizonia.org) that depends on pycryptodome. When downloading this from PyPi, snapcraft fails to build pycryptodome as there seems to be no 'build' directory under the distribution root.
This is the error:
Running setup.py install for pycryptodome ... error
Complete output from command /home/joni/work/snap2/parts/pypidep/install/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ZVmvKs/pycryptodome/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" build_ext -I/home/joni/work/snap2/parts/pypidep/install/usr/include/python2.7 install --record /tmp/pip-NBmK13-record/install-record.txt --single-version-externally-managed --compile --home=/tmp/tmphu0myF:
running build_ext
error: [Errno 2] No such file or directory: 'build/test1.c'
----------------------------------------
Command "/home/joni/work/snap2/parts/pypidep/install/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ZVmvKs/pycryptodome/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" build_ext -I/home/joni/work/snap2/parts/pypidep/install/usr/include/python2.7 install --record /tmp/pip-NBmK13-record/install-record.txt --single-version-externally-managed --compile --home=/tmp/tmphu0myF" failed with error code 1 in /tmp/pip-build-ZVmvKs/pycryptodome/
Traceback (most recent call last):
File "/usr/bin/snapcraft", line 31, in <module>
snapcraft.main.main()
File "/usr/lib/python3/dist-packages/snapcraft/main.py", line 203, in main
return run(args, project_options)
File "/usr/lib/python3/dist-packages/snapcraft/main.py", line 259, in run
lifecycle.snap(project_options, args['<directory>'], args['--output'])
File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle.py", line 256, in snap
snap = execute('prime', project_options)
File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle.py", line 98, in execute
_Executor(config, project_options).run(step, part_names)
File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle.py", line 127, in run
self._run_step(step, part, part_names, dirty, recursed)
File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle.py", line 165, in _run_step
getattr(part, step)()
File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler.py", line 276, in pull
self.code.pull()
File "/usr/lib/python3/dist-packages/snapcraft/plugins/python2.py", line 106, in pull
self._pip()
File "/usr/lib/python3/dist-packages/snapcraft/plugins/python2.py", line 147, in _pip
self.options.python_packages)
File "/usr/lib/python3/dist-packages/snapcraft/_baseplugin.py", line 221, in run
return common.run(cmd, cwd=cwd, **kwargs)
File "/usr/lib/python3/dist-packages/snapcraft/internal/common.py", line 61, in run
subprocess.check_call(['/bin/sh', f.name] + cmd, **kwargs)
File "/usr/lib/python3.5/subprocess.py", line 581, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/bin/sh', '/tmp/tmpthhb56dp', 'python2', '/home/joni/work/snap2/parts/pypidep/install/usr/bin/pip2', 'install', '--global-option=build_ext', '--global-option=-I/home/joni/work/snap2/parts/pypidep/install/usr/include/python2.7', '--target', '/home/joni/work/snap2/parts/pypidep/install/usr/lib/python2.7/site-packages', '--upgrade', 'pycryptodome']' returned non-zero exit status 1
This is a snapcraft.yaml file that reproduces this issue:
name: test
version: 0.1.0
summary: test snap
description: test snap
confinement: devmode # use "strict" to enforce system access only via declared interfaces
parts:
pypidep:
plugin: python2
python-packages:
- pycryptodome
filesets:
modules:
- lib/python2.7/dist-packages/*
stage:
- $modules
snap:
- $modules
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution, likely abandoned or superseded due to Python 2 deprecation and snapcraft updates. No fix or merge details provided. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution. The python2 plugin build failure appears abandoned, likely superseded by updated snapcraft plugins following Python 2 deprecation. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed without resolution. The python2 plugin failed to locate the build directory during pycryptodome installation, causing snapcraft to fail. Issue appears abandoned. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1673658 python package failed to install because of directories in the source | snapcraft (launchpad) | open | Snapcraft 2.27.1-era report that the python plugin fails to install packages when the source contains directories, leaving the executable unstaged. No comments, author account deactivated, and the affected version is long obsolete. | |
| #1501977 py2-project example fails to snap | snapcraft (launchpad) | closed | The py2-project example failed to snap due to a missing plugin keyword in snapcraft.yaml. Closed after over 11 years with no activity, the issue was abandoned and superseded by updated snapcraft versions. |