patchelf is missing from snapcraft Depends:
Metadata
Current evaluation
Closed. Package dependencies were updated to include patchelf, resolving the missing binary error during snap builds.
Suggested action: —
No scores available.
Issue body
Since snapcraft 2.38 patchelf is required. Installing snapcraft via apt does not also install patchelf.
## Expected behaviour
`apt install snapcraft` should also install `patchelf`.
## Actual behaviour
`apt install snapcraft` does not install `patchelf`.
## Steps to reproduce the behaviour
Standup a clean 16.04 VM or container, and run the following:
sudo apt-add-repository ppa:snappy-dev/snapcraft-daily
sudo apt update
sudo apt install snapcraft
Trying a build a snap with snapcraft and the following traceback is generated:
Traceback (most recent call last):
File "/usr/bin/snapcraft", line 9, in <module>
load_entry_point('snapcraft===2.38-201801031632-af6551a-ubuntu16.04.1', 'console_scripts', 'snapcraft')()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 542, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2569, in load_entry_point
return ep.load()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2229, in load
return self.resolve()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2235, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/lib/python3/dist-packages/snapcraft/cli/__main__.py", line 19, in <module>
run(prog_name='snapcraft')
File "/usr/lib/python3/dist-packages/click/core.py", line 716, in __call__
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 696, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/click/core.py", line 1037, in invoke
return Command.invoke(self, ctx)
File "/usr/lib/python3/dist-packages/click/core.py", line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3/dist-packages/click/core.py", line 534, in invoke
return callback(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/lib/python3/dist-packages/snapcraft/cli/__init__.py", line 124, in run
ctx.forward(lifecyclecli.commands['snap'])
File "/usr/lib/python3/dist-packages/click/core.py", line 552, in forward
return self.invoke(cmd, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 534, in invoke
return callback(*args, **kwargs)
File "/usr/lib/python3/dist-packages/snapcraft/cli/lifecycle.py", line 139, in snap
project_options, directory=directory, output=output)
File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_packer.py", line 45, in snap
execute('prime', project_options)
File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 79, in execute
_Executor(config, project_options).run(step, part_names)
File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 184, in run
self._run_step(step, part, part_names)
File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 221, in _run_step
getattr(part, step)()
File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/__init__.py", line 564, in prime
elf_patcher.patch(elf_file=elf_file)
File "/usr/lib/python3/dist-packages/snapcraft/internal/elf.py", line 208, in patch
self._patch_rpath(elf_file)
File "/usr/lib/python3/dist-packages/snapcraft/internal/elf.py", line 224, in _patch_rpath
elf_file_path=elf_file.path)
File "/usr/lib/python3/dist-packages/snapcraft/internal/elf.py", line 143, in wrapper
return f(*args, **kwargs)
File "/usr/lib/python3/dist-packages/snapcraft/internal/elf.py", line 230, in _run_patchelf
[elf_file_path])
File "/usr/lib/python3.5/subprocess.py", line 576, in check_call
retcode = call(*popenargs, **kwargs)
File "/usr/lib/python3.5/subprocess.py", line 557, in call
with Popen(*popenargs, **kwargs) as p:
File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'patchelf'
## Ubuntu version
Ubuntu 16.04.3.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Closed. Package dependencies were updated to include patchelf, resolving the missing binary error during snap builds. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed. The missing patchelf dependency was addressed by updating the snapcraft apt package dependencies. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1860766 Patchelf misses some libraries when I build MicroStack with 3.9.7 or 3.9.8 | snapcraft (launchpad) | closed | Closed without resolution. The patchelf library omission in snapcraft 3.9.7/3.9.8 was abandoned due to inactivity, with no fix or official workaround implemented. | |
| #1864 debian/control: Add patchelf to Depends: | snapcraft | closed | Closed without merging. Maintainers declined adding patchelf to Debian dependencies due to Xenial version constraints, noting it is supplied via build snaps or Docker images. Abandoned in favor of existing distribution methods. | |
| #1888 elf: make patchelf a dependency | snapcraft | merged | Merged after reviewer approval and CI checks. The change corrects patchelf handling by removing it from build_tools and properly configuring it as a dependency via debian/control for deb packages and snapcraft bundling for snaps. | |
| #1854458 snapcraft comes with an old version of pyelftools, some builds fail due to this | snapcraft (launchpad) | closed | Closed without resolution. The issue stemmed from an outdated pyelftools dependency triggering a Unicode decode error during ELF parsing. No patch was applied, leaving the snap build failure unresolved. | |
| #2045895 patchelf missing snap libdir rpath | snapcraft (launchpad) | open | patchelf inconsistent rpath for classic snaps: proposed rpath missing snap libdir that linter expects. Unlabelled, 1002 days old, no maintainer engagement. |