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

Bug #1752957 reported by Kyle Fazzari
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
New
Undecided
Unassigned

Bug Description

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.

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

Kyle, this is solved with the latest 2.40 (to be released) version, right?

Changed in snapcraft:
status: New → Incomplete
Revision history for this message
Kyle Fazzari (kyrofa) wrote :

Indeed, the traceback no longer occurs. However, there's still a behavior change when compared to 2.35, which errors out with "classic confinement requires the core snap to be installed. Install it by running `snap install core`." 2.40 just happily uses '/snap/core/current/lib64/ld-linux-x86-64.so.2'. Is that desired? I'll set back to New just in case, but if this is working as desired, feel free to set to Fix Committed.

Changed in snapcraft:
status: Incomplete → New
Revision history for this message
Kyle Fazzari (kyrofa) wrote :

Turns out this is _not_ desired behavior, so using this bug to track the fix.

summary: - Traceback if classic snap is built without core snap installed
+ Building classic snap without core snap installed succeeds, but creates
+ snap that doesn't run
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.