canonical/snapcraft

remote build: fail if launchpad fails to create artifacts

Closed this issue · 2 comments

Bug Description

If architectures are defined in a snapcraft.yaml file and provided with --build-for, launchpad will fail to create artifacts but snapcraft will exit successfully with no error messages.

Defining architectures in a snapcraft.yaml file and providing --build-for is a known issue (LP#1885150), but this bug report is about the UX - there is no validation, warning, or error message.

Possible solutions

  • Warn if architectures are defined in a snapcraft.yaml and provided as a build argument
  • Error if no artifacts are produced
  • Work with the launchpad team to improve how builds are planned

To Reproduce

snapcraft remote-build --launchpad-accept-public-upload --verbosity=trace --build-for arm64

Environment

n/a

snapcraft.yaml

name: hello-world
title: test
summary: test
description: test
version: 7.6.0

base: core22
grade: stable
confinement: strict
compression: lzo

architectures:
  - amd64
  - arm64

parts:
  my-part:
    plugin: nil

Relevant log output

remote-build logs:

2024-05-01 16:51:12.860 remote: Resolving deltas:  82% (437/527)
2024-05-01 16:51:12.860 remote: Resolving deltas: 100% (527/527)
2024-05-01 16:51:12.861 remote: Resolving deltas: 100% (527/527), done.
2024-05-01 16:51:14.239 Trying to create snap recipe 'snapcraft-hello-world-15700e74b7e84ef8caaf7accd3dc4ee0' (attempt 1/4)
2024-05-01 16:51:15.502 Monitoring build
2024-05-01 16:51:15.698 Stopped: arm64
2024-05-01 16:51:46.147 Building: arm64 / (30.4s)
2024-05-01 16:51:46.147 Building: arm64 / (60.8s)
2024-05-01 16:51:46.147 Building: arm64 \ (91.5s)
2024-05-01 16:51:46.147 Building: arm64 | (122.0s)
2024-05-01 16:51:46.147 Building: arm64 | (152.5s)
2024-05-01 16:51:46.147 Building: arm64 \ (184.5s)
2024-05-01 16:51:46.147 Building: arm64 \ (214.9s)
2024-05-01 16:51:46.147 Building: arm64 - (245.3s)
2024-05-01 16:51:46.147 Building: arm64 \ (275.8s)
2024-05-01 16:51:46.147 Building: arm64
2024-05-01 16:56:52.515 Uploading: arm64
2024-05-01 16:57:23.036 Stopped: arm64
2024-05-01 16:57:23.037 Fetching 1 build logs...
2024-05-01 16:57:24.112 Downloading https://launchpad.net/~mr-cal/mr-cal-craft-remote-build/+snap/snapcraft-hello-world-15700e74b7e84ef8caaf7accd3dc4ee0/+build/2469914/+files/buildlog_snap_ubuntu_jammy_arm64_snapcraft-hello-world-15700e74b7e84ef8caaf7accd3dc4ee0_BUILDING.txt.gz (--->)
2024-05-01 16:57:24.186 Downloading https://launchpad.net/~mr-cal/mr-cal-craft-remote-build/+snap/snapcraft-hello-world-15700e74b7e84ef8caaf7accd3dc4ee0/+build/2469914/+files/buildlog_snap_ubuntu_jammy_arm64_snapcraft-hello-world-15700e74b7e84ef8caaf7accd3dc4ee0_BUILDING.txt.gz (<---)
2024-05-01 16:57:24.187 Fetching build artifacts...
Build completed.
Log files: hello_arm64-2024-05-01T16:57:23.txt
Artifacts:
2024-05-01 16:57:24.372 Cleaning up

launchpad logs:

2024-05-01T21:55:07Z INFO Waiting for automatic snapd restart...
snapcraft 8.2.1 from Canonical** installed
Running repo phase...
Cloning into 'snapcraft-hello-world-15700e74b7e84ef8caaf7accd3dc4ee0'...
[01/May/2024:21:55:42 +0000] "CONNECT git.launchpad.net:443 HTTP/1.1" 200 360884 "-" "git/2.34.1"
Running pull phase...
Initializing parts lifecycle
Installing build-packages
Installing build-snaps
Pulling my-part
Running build phase...
Could not make build plan: build-on architectures in snapcraft.yaml does not match host architecture (arm64).
Revoking proxy token...
RUN: /usr/share/launchpad-buildd/bin/in-target scan-for-processes --backend=lxd --series=jammy --arch=arm64 SNAPBUILD-2469914
Scanning for processes to kill in build SNAPBUILD-2469914

Additional context

No response

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-2871.

This message was autogenerated

Fixed via #4826