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

architectures: allow same arch in multiple build-ons in core20 #4341

Open
mr-cal opened this issue Aug 30, 2023 · 3 comments
Open

architectures: allow same arch in multiple build-ons in core20 #4341

mr-cal opened this issue Aug 30, 2023 · 3 comments
Labels
enhancement New features or optimizations

Comments

@mr-cal
Copy link
Collaborator

mr-cal commented Aug 30, 2023

What needs to get done

core20 snaps should allow the same architecture in multiple build-ons, when a target arch is supplied with snapcraft --target-arch armhf --enable-experimental-target-arch --destructive-mode.

Caevaets:

  • all 3 cli options in snapcraft --target-arch armhf --enable-experimental-target-arch --destructive-mode must be used everytime
  • the snap will not be able to be built with snapcraft remote-build

Why it needs to get done

Currently, core20 snaps do not allow the same architecture to be present in multiple build-ons.

Consider the following snapcraft.yaml:

base: core20
architectures:
  - build-on: [amd64, arm64, armhf]
    run-on: armhf
  - build-on: [amd64, arm64]
    run-on: arm64

Running snapcraft with or without a target arch produces the following error:
Issues while validating snapcraft.yaml: The 'architectures' property does not match the required schema: 'amd64' and 'arm64' are present in the 'build-on' of multiple items, which means snapcraft doesn't know which 'run-on' to use when building on those architectures

When a target arch is supplied, snapcraft has enough information to determine which build-on/run-on tuple to use.

source: https://bugs.launchpad.net/snapcraft/+bug/2009520

@mr-cal mr-cal added the enhancement New features or optimizations label Aug 30, 2023
@dilyn-corner
Copy link

I believe this is also an issue for core22 snaps, and extending this to supporting those bases would also be nice.

@mr-cal
Copy link
Collaborator Author

mr-cal commented Sep 1, 2023

I believe this is also an issue for core22 snaps, and extending this to supporting those bases would also be nice.

Can you double-check?

The same yaml should work on core22 and create 2 snaps by default. It can also take --build-for=<arch> to create one snap.

base: core22
architectures:
  - build-on: [amd64, arm64, armhf]
    build-for: armhf
  - build-on: [amd64, arm64]
    build-for: arm64

@dilyn-corner
Copy link

Seems you're right... Perhaps I'm misremembering. I'll see if I can dig up what I was doing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features or optimizations
Projects
None yet
Development

No branches or pull requests

2 participants