Override-build behavior changes for V3?


#1

Hi there,

I’m updating budgie-welcome to Snapcraft V3 - and to start I am just attempting a build of the existing snapcraft.yaml. I hit an error where the override-build section is failing (missing files - rebuild-translations.sh in this case).

So I jumped into the image with snapcraft --debug, and I cannot find the needed files as reported in the error. I was looking at /home/multipass/parts/budgie-welcome/build (as per docs).

In that directory I see:

.
├── hooks
│   ├── install
│   ├── post-refresh -> install
│   └── remove
├── scripts
│   └── welcome-wrapper
└── ubuntu-budgie-welcome_source.tar.bz2

Now the content I am trying to target (and that had previously built) sits in the top level scripts folder (in our repo):

(This is a pruned tree - just to exhibit where the script sits in the repo compared to the snap folder).

.
|-- LICENSE
|-- README.md
|-- debian
|   |-- budgie-welcome.install
|   |-- budgie-welcome.links
|   |-- changelog
|   |-- compat
|   |-- control
|   |-- copyright
|   |-- files
|   |-- rules
|   `-- source
|-- docs
|   `-- standards.md
|-- org.budgie.welcome.policy
|-- scripts
|   |-- rebuild-translations.sh
|   |-- regenerate-translation-templates.sh
|   |-- translation-support.py
|   |-- update-desktop-files.sh
|   `-- welcome-po.py
`-- snap
    |-- hooks
    |-- scripts
    `-- snapcraft.yaml

Am I missing something that changed?

snapcraft.yaml

https://raw.githubusercontent.com/UbuntuBudgie/budgie-welcome/snapcraft_3.x/snap/snapcraft.yaml

Full Repo

Thank you in advance.

Dustin


#2

This is odd. I added base: core18 to the same YAML.

Now it fails out with:

An error occurred when trying to execute 'sudo -i env SNAPCRAFT_HAS_TTY=True snapcraft snap' with 'multipass': returned exit code 2.

Googled around for that error (to no results). HM.


#3

Try running snapcraft with the SNAPCRAFT_ENABLE_DEVELOPER_DEBUG=yes environment variable.


#4

Is this run within multipass? Or on the host? (Assume host)


#5

Should be run on the host IIRC.


#6

Confirmed. I should have just tested. :blush:

Appreciate your time.


#7

Weuuffff. That’s verbose. :slight_smile:

If I read this correctly, it seems like my snapcraft does not want to play nice with multipass.

Running multipass stop snapcraft-ubuntu-budgie-welcome
Traceback (most recent call last):                                              
  File "/snap/snapcraft/2650/legacy_snapcraft/lib/python3.5/site-packages/snapcraft/internal/build_providers/_multipass/_multipass_command.py", line 160, in execute
    return runnable(cmd)
  File "/snap/snapcraft/2650/legacy_snapcraft/lib/python3.5/site-packages/snapcraft/internal/build_providers/_multipass/_multipass_command.py", line 31, in _run
    subprocess.check_call(command)
  File "/snap/snapcraft/2650/legacy_snapcraft/usr/lib/python3.5/subprocess.py", line 581, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['multipass', 'exec', 'snapcraft-ubuntu-budgie-welcome', '--', 'snapcraft', 'snap']' returned non-zero exit status 2

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/snap/snapcraft/2650/legacy_snapcraft/bin/snapcraft", line 11, in <module>
    load_entry_point('snapcraft==2.43.1', 'console_scripts', 'snapcraft')()
  File "/snap/snapcraft/2650/legacy_snapcraft/lib/python3.5/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/snap/snapcraft/2650/legacy_snapcraft/lib/python3.5/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/snap/snapcraft/2650/legacy_snapcraft/lib/python3.5/site-packages/click/core.py", line 1043, in invoke
    return Command.invoke(self, ctx)
  File "/snap/snapcraft/2650/legacy_snapcraft/lib/python3.5/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/snap/snapcraft/2650/legacy_snapcraft/lib/python3.5/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/snap/snapcraft/2650/legacy_snapcraft/lib/python3.5/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/snap/snapcraft/2650/legacy_snapcraft/lib/python3.5/site-packages/snapcraft/cli/_runner.py", line 114, in run
    ctx.forward(lifecyclecli.commands["snap"])
  File "/snap/snapcraft/2650/legacy_snapcraft/lib/python3.5/site-packages/click/core.py", line 553, in forward
    return self.invoke(cmd, **kwargs)
  File "/snap/snapcraft/2650/legacy_snapcraft/lib/python3.5/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/snap/snapcraft/2650/legacy_snapcraft/lib/python3.5/site-packages/snapcraft/cli/lifecycle.py", line 209, in snap
    _execute(steps.PRIME, parts=[], pack_project=True, output=output, **kwargs)
  File "/snap/snapcraft/2650/legacy_snapcraft/lib/python3.5/site-packages/snapcraft/cli/lifecycle.py", line 83, in _execute
    instance.pack_project(output=output)
  File "/snap/snapcraft/2650/legacy_snapcraft/lib/python3.5/site-packages/snapcraft/internal/build_providers/_base_provider.py", line 167, in pack_project
    self._run(command=command)
  File "/snap/snapcraft/2650/legacy_snapcraft/lib/python3.5/site-packages/snapcraft/internal/build_providers/_multipass/_multipass.py", line 40, in _run
    instance_name=self.instance_name, command=command, hide_output=hide_output
  File "/snap/snapcraft/2650/legacy_snapcraft/lib/python3.5/site-packages/snapcraft/internal/build_providers/_multipass/_multipass_command.py", line 166, in execute
    ) from process_error
snapcraft.internal.build_providers.errors.ProviderExecError: An error occurred when trying to execute 'snapcraft snap' with 'multipass': returned exit code 2.


#8

You snapcraft seemed to be still running in V2 mode…?

UDPATE: Oh you’re just starting the port, not already ported to V3


#9

@bashfulrobot can you paste the full log somewhere? The extracts you posted miss the meat of the problem.

Does multipass launch work OK?


#10

@Saviq I did a quick test, and it does in fact work (pulled an image and spun up a VM).

AS for the log - that was all of the output (terminal). Is there a better way to generate a more verbose log?


#11

journalctl --unit snap.multipass


#12

Boy - this is just stumping me.

journalctl --unit snap.multipass
-- Logs begin at Mon 2019-03-25 19:21:01 PDT, end at Wed 2019
-- No entries --

#13

Try adding a .* at the end:

$ journalctl -e --no-pager --unit snap.multipass.*
-- Logs begin at Thu 2018-10-18 09:38:29 CDT, end at Wed 2019-04-03 17:17:01 CDT. --
Apr 02 23:44:05 multipassd[28601]: /build/multipass/parts/multipass/src/src/ssh/ssh_process.cpp:119 read_stream(type = 0, timeout = -1): 
Apr 02 23:44:05 multipassd[28601]: /build/multipass/parts/multipass/src/src/ssh/ssh_process.cpp:137 read_stream(): num_bytes = 8
Apr 02 23:44:05 multipassd[28601]: /build/multipass/parts/multipass/src/src/ssh/ssh_process.cpp:137 read_stream(): num_bytes = 0