remote build: fail if launchpad fails to create artifacts
Metadata
Current evaluation
Fixed via #4826. Snapcraft remote-build now exits with an error when Launchpad fails to produce artifacts due to architecture mismatches, replacing the previous silent success with explicit failure reporting and validation.
Suggested action: —
No scores available.
Issue body
### 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](https://bugs.launchpad.net/snapcraft/+bug/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
```shell
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:
```shell
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:
```shell
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_
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Fixed via #4826. Snapcraft remote-build now exits with an error when Launchpad fails to produce artifacts due to architecture mismatches, replacing the previous silent success with explicit failure reporting and validation. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed via #4826 by implementing validation to fail the remote build when Launchpad fails to create artifacts, preventing silent success exits on architecture mismatches. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed via PR #4826 by adding validation to fail the remote build when Launchpad produces no artifacts, resolving the silent success issue caused by architecture mismatches. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Fixed via PR #4826. Snapcraft now exits with an error when Launchpad remote builds fail to produce artifacts, resolving the silent success issue caused by architecture mismatches. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Fixed via PR #4826. Snapcraft remote-build now exits with an error when Launchpad fails to produce artifacts, resolving the silent success issue caused by architecture mismatches. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #5265 fix(remotebuild): don't fail when cross-compiling | snapcraft | merged | Merged fix resolving remote build cross-compilation failures. Snapcraft now passes build-on architectures to Launchpad instead of build-for, enabling correct cross-compilation and addressing issue #4996. Approved by reviewers and passed CI. | |
| #1807141 Launchpad builds failing today | snapcraft (launchpad) | closed | Closed without comments. The reported Launchpad and Snapcraft build failures were resolved externally or abandoned, as the issue stems from an upstream build service rather than repository code. | |
| #5005 fix(remotebuild): error early for multiple artifacts per build-on | snapcraft | merged | Merged. Adds early validation to prevent Launchpad build failures when multiple artifacts share the same build-on architecture. Replaces cryptic errors with a clear message, resolving issue #4995. Approved and passed CI. | |
| #4821 remote build: hangs when logging into Launchpad | snapcraft | closed | Resolved via craft-application#337 with improved Launchpad API retry logic. The CI-specific login hang was explicitly rejected since remote-build is unsupported in CI environments. | |
| #5517 remote build: internal error from 400 response | snapcraft | open | Snapcraft remote build exposes an internal error when Launchpad returns a 400 (BadRequest) during repo push; the lazr.restfulclient.errors.BadRequest exception is not caught. Triaged as a bug, fix likely needed upstream in Craft Application. |