Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remote build: fails with some architecture definitions #4780

Closed
mr-cal opened this issue May 1, 2024 · 5 comments
Closed

remote build: fails with some architecture definitions #4780

mr-cal opened this issue May 1, 2024 · 5 comments
Assignees
Labels
bug Actual bad behavior that don't fall into maintenance or documentation triaged

Comments

@mr-cal
Copy link
Collaborator

mr-cal commented May 1, 2024

Bug Description

Snapcraft does not handle some definitions of architectures for remote builds and fails immediately with no error or explanation.

It's possible that other variations of architectures: will fail too, so we should add a set of regression tests.

To Reproduce

snapcraft remote-build

Environment

n/a

snapcraft.yaml

name: test-snap
version: '0.1'
summary: test
description: test

grade: devel
confinement: devmode

base: core22

architectures:
  - build-on: arm64


parts:
  my-part:
    plugin: nil

Relevant log output

All data sent to remote builders will be publicly available. Are you sure you want to continue? [y/N]: y
remote-build is experimental and is subject to change. Use with caution.
Build completed.
Log files:
Artifacts:

Additional context

From @jnsgruk on the snapcrafters channel (source)

@mr-cal mr-cal added the bug Actual bad behavior that don't fall into maintenance or documentation label May 1, 2024
Copy link

Thank you for reporting us your feedback!

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

This message was autogenerated

@AlanGriffiths
Copy link

I've also seen failures without architectures(or platforms) in the .yaml. With, for example,

snapcraft remote-build --launchpad-accept-public-upload --build-for armhf

(Which works for Miriway, but not for several of canonical's Mir based projects. Not spotted what the significant difference between these is.)

@popey
Copy link
Contributor

popey commented May 2, 2024

Also:

This works: snapcraft remote-build --build-for riscv64

This does not: snapcraft remote-build --build-for amd64,riscv64,arm64

2024-05-02 23:33:24.773 Starting snapcraft, version 8.2.3
2024-05-02 23:33:24.773 Log verbosity level set to BRIEF
2024-05-02 23:33:24.774 Configuring application...
2024-05-02 23:33:24.774 Preparing application...
2024-05-02 23:33:24.774 Build plan: platform=None, build_for=amd64,riscv64,arm64
2024-05-02 23:33:24.774 Loading project file '/home/alan/Temp/Test/snap/snapcraft.yaml'
2024-05-02 23:33:24.779 Architecture 'amd64,riscv64,arm64' is not supported.
2024-05-02 23:33:24.779 Traceback (most recent call last):
2024-05-02 23:33:24.779   File "/snap/snapcraft/11591/lib/python3.10/site-packages/craft_application/application.py", line 508, in run
2024-05-02 23:33:24.779     self.services.project = self.get_project(
2024-05-02 23:33:24.779   File "/snap/snapcraft/11591/lib/python3.10/site-packages/craft_application/application.py", line 303, in get_project
2024-05-02 23:33:24.779     yaml_data = self._transform_project_yaml(yaml_data, build_on, build_for)
2024-05-02 23:33:24.779   File "/snap/snapcraft/11591/lib/python3.10/site-packages/craft_application/application.py", line 601, in _transform_project_yaml
2024-05-02 23:33:24.779     self._expand_environment(yaml_data=yaml_data, build_for=build_for)
2024-05-02 23:33:24.779   File "/snap/snapcraft/11591/lib/python3.10/site-packages/craft_application/application.py", line 629, in _expand_environment
2024-05-02 23:33:24.779     info = craft_parts.ProjectInfo(
2024-05-02 23:33:24.779   File "/snap/snapcraft/11591/lib/python3.10/site-packages/craft_parts/infos.py", line 99, in __init__
2024-05-02 23:33:24.779     self._set_machine(arch)
2024-05-02 23:33:24.779   File "/snap/snapcraft/11591/lib/python3.10/site-packages/craft_parts/infos.py", line 333, in _set_machine
2024-05-02 23:33:24.779     raise errors.InvalidArchitecture(arch)
2024-05-02 23:33:24.779 craft_parts.errors.InvalidArchitecture: Architecture 'amd64,riscv64,arm64' is not supported.
2024-05-02 23:33:24.779 Make sure the architecture name is correct.
2024-05-02 23:33:24.779 Recommended resolution: Make sure the architecture name is correct.
2024-05-02 23:33:24.779 Full execution log: '/home/alan/.local/state/snapcraft/log/snapcraft-20240502-233324.772745.log'

@AlanGriffiths
Copy link

snapcraft 2.8.4 appears to have fixed some cases. canonical/mir#3369 builds mir-libs for a matrix of core{22,24}, {amd64,armhf,arm64). The only one failing now is core24,armhf

https://github.com/canonical/mir/actions/runs/8939586899/job/24620012565?pr=3369

Running locally, doesn't retrieve any build results to investigate further

$ cp snap/local/core24~snapcraft.yaml snap/snapcraft.yaml 
$ sed -i 's@version: testing@version: '$(git describe)'@' snap/snapcraft.yaml
$ snapcraft remote-build --launchpad-accept-public-upload --build-for armhf
$ snapcraft remote-build --launchpad-accept-public-upload --build-for armhf
remote-build is experimental and is subject to change. Use with caution.           
Build completed.rtifacts...                                                        
Log files: 
Artifacts:                                            
$

@lengau lengau self-assigned this May 7, 2024
lengau added a commit that referenced this issue May 7, 2024
This fixes the initial reported bug in #4780. However, I haven't tested
some other use cases listed in that bug report.
lengau added a commit that referenced this issue May 8, 2024
This fixes the initial reported bug in #4780. However, I haven't tested
some other use cases listed in that bug report.
lengau added a commit that referenced this issue May 9, 2024
This fixes the initial reported bug in #4780. However, I haven't tested
some other use cases listed in that bug report.

- [x] Have you followed the [guidelines for
contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [x] Have you signed the
[CLA](http://www.ubuntu.com/legal/contributors/)?
- [x] Have you successfully run `tox run -m lint`?
- [x] Have you successfully run `tox run -e test-py310`? (supported
versions: `py39`, `py310`, `py311`, `py312`)

-----
@mr-cal
Copy link
Collaborator Author

mr-cal commented Jun 3, 2024

Fixes via #4793 and canonical/craft-application#343

@mr-cal mr-cal closed this as completed Jun 3, 2024
@mr-cal mr-cal added the triaged label Aug 21, 2024
@mr-cal mr-cal changed the title New remote-build fails with some architecture definitions remote build: fails with some architecture definitions Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Actual bad behavior that don't fall into maintenance or documentation triaged
Projects
None yet
Development

No branches or pull requests

4 participants