← Back to issue list

Building classic snap without core snap installed succeeds, but creates snap that doesn't run

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1752957
Type
issue
State
open
Author
~kyrofa
Labels
—
Created
Updated
Closed
—

Current evaluation

Legacy Snapcraft 2.x classic builds could emit a non-running snap when core was absent; the affected base and implementation are now obsolete.

Suggested action: close stale

Reason: The reporter confirmed 2.40 removed the traceback but reopened tracking because silently using /snap/core/current/lib64/ld-linux-x86-64.so.2 was not desired. Current documentation states that latest Snapcraft no longer supports old bases and directs core builds to the legacy 4.x track; the current ELF implementation also no longer contains the reported get_core_dynamic_linker path, making this 2.x-only issue obsolete.

Evaluated by: mr-cal-bot

Impact: 35 Quick Win: 1 Complexity: 80 Confidence: 94 Actionability: 12

Issue body

Using the 2.39.2 deb, building a classic snap without the core snap installed results in: Priming python3 Traceback (most recent call last): File "/usr/bin/snapcraft", line 9, in <module> load_entry_point('snapcraft==2.39.3', '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 43, 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/_runner.py", line 72, 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 46, 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 185, in run self._run_step(step, part, part_names) File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 222, in _run_step getattr(part, step)() File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/__init__.py", line 578, in prime elf_patcher.patch(elf_file=elf_file) File "/usr/lib/python3/dist-packages/snapcraft/internal/elf.py", line 392, in patch elf_file_path=elf_file.path) File "/usr/lib/python3/dist-packages/snapcraft/internal/elf.py", line 297, in wrapper return f(*args, **kwargs) File "/usr/lib/python3/dist-packages/snapcraft/internal/elf.py", line 407, in _run_patchelf subprocess.check_call(cmd) 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 1490, in _execute_child restore_signals, start_new_session, preexec_fn) TypeError: Can't convert 'NoneType' object to str implicitly This traces back to project_options.get_core_dynamic_linker() returning None in the pluginhandler.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 35
Quick Win: 1
Complexity: 80
Confidence: 94
Actionability: 12
close stale Legacy Snapcraft 2.x classic builds could emit a non-running snap when core was absent; the affected base and implementation are now obsolete.
stealth/space-bunny-alpha
Impact: 24
Quick Win: 21
Complexity: 5
Confidence: 82
Actionability: 90
close stale Classic base:core builds no longer require a host-installed core snap; the old 2.39.2 traceback and preflight requirement are obsolete in current Snapcraft.
qwen/qwen3.6-35b-a3b
Impact: 30
Quick Win: 19
Complexity: 20
Confidence: 90
Actionability: 80
close resolved Classic snap build crashed when core snap not installed due to get_core_dynamic_linker returning None. Resolved via refactoring to get_dynamic_linker with proper exception handling.
qwen/qwen3.8-27b
Impact: 40
Quick Win: 26
Staleness: 95
Complexity: 35
Confidence: 65
Support Request: 10
close stale Snapcraft 2.39.x crashes with TypeError building a classic snap without the core snap installed, as get_core_dynamic_linker() returns None during patchelf. No comments or labels; 2.x series is EOL and the code path no longer exists in the current codebase.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 40
Confidence: 90
Support Request: 10
close stale Snapcraft 2.39.x crashes with a TypeError during the prime step when building a classic snap without the core snap installed. Issue is over 8 years old with no maintainer interaction.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 45
Confidence: 95
Support Request: 10
close stale Bug report from 2016 describing a TypeError when building classic snaps without the core snap installed. Issue is completely inactive and applies to a legacy snapcraft version.
qwen3.6-35b-a3b-mtp-q6
Staleness: 98
Complexity: 35
Confidence: 90
Support Request: 10
close stale Bug in snapcraft 2.39 where building a classic snap without the core snap causes a TypeError during the prime step. Issue is over 8 years old with no activity and targets a deprecated version.

Update history

Date Change
created

Related work

  • Related To: snapcraft (launchpad)#1665081 (confidence 63%)

    Also concerns host-installed core handling during classic snap builds, but tracks a distinct cleanup behavior.

Related issues

Issue Project State Summary Similarity
#1647699 Support classic building in snapcraft snapcraft (launchpad) closed Classic-snap builds were implemented by merged snapcore/snapcraft#949 (commit 058f5626d), resolving libraries from the core/base snap.
78%
#1665081 building a classic snap does'nt remove /snap/core/current snapcraft (launchpad) closed Closed without a code fix; the maintainer clarified that SNAPCRAFT_SETUP_CLASSIC=1 is only intended for CI use.
78%
#3087 meta: remove snapd workaround for classic for core20 onwards snapcraft merged Merged canonical/snapcraft#3087 as commit 244b997ca, removing the automatic classic snapcraft-runner workaround for core20 and newer while retaining it for legacy bases.
72%
#1857019 cannot build snapd snap with build-base: core w/o base: core snapcraft (launchpad) closed Resolved in Snapcraft 3.10 by skipping ELF dependency checks when no runtime base is set, allowing snapd to use build-base: core.
71%
#1793261 Vendor legacy snapcraft to maintain backward compatibility snapcraft (launchpad) closed Legacy Snapcraft was vendored into the snapcraft snap, dispatching projects without bases to it. Delivered via merged PRs canonical/snapcraft#2283 (commit f9592939a, override-build refactor) and #2285 (commit 5c1ee3b88).
71%
#1650946 unhelpful error when building a classic snap: classic confinement requires the core_dynamic_linker to be set snapcraft (launchpad) closed Resolved: the cryptic "classic confinement requires the core_dynamic_linker to be set" error was fixed by snapcore/snapcraft PR #1025 (better diagnostic) and PR #1112 / commit 49b39ef9a, which auto-installs/unpacks the core snap; Launchpad builds snapcraft 2.27+ via LP: #1650946.
71%
#1765482 Building a classic snap on trusty doesn't work snapcraft (launchpad) closed Trusty classic-snap build segfaults traced to core paths in LD_LIBRARY_PATH. Proposed fix PR canonical/snapcraft#2128 was closed unmerged as unnecessary, leaving the bug unfixed.
70%