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

Add support for specifying a variant's supported architectures #1431

Merged
merged 2 commits into from
Apr 2, 2021

Conversation

zmrow
Copy link
Contributor

@zmrow zmrow commented Mar 30, 2021

Issue number:
Fixes #1404
Related to #1393

Description of changes:

buildsys: Add ability for variants to specify supported architectures

This change adds an additional key that can be specified in a variant's
`Cargo.toml`, `supported-arches`.  It is a list and the supported enum
values are `x86_64` and `aarch64`.  If `supported-arches` is specified,
the current `BUILDSYS_ARCH` is checked against the list.  If
`supported-arches` is not specified, the build continues as before.
 vmware-dev: Support x86_64 only

This change adds the `supported-arch` key to `vmware-dev`'s `Cargo.toml`
and ensure's the variant will only be built for `x86_64`.

Testing done:

  • Build an aws-k8s-1.18 image for both x86_64 and aarch64
  • Successfully build vmware-dev for x86_64
  • Attempt to build vmware-dev for aarch64 and it correctly fails
  process didn't exit successfully: `<long path>/bottlerocket/bottlerocket/variants/vmware-dev/target/debug/build/vmware-dev-bce40105c9e5560f/b
...
  --- stderr
  BuildAttempt: Unsupported architecture 'aarch64', check the variant's Cargo.toml for supported architectures

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

@zmrow zmrow self-assigned this Mar 30, 2021
tools/buildsys/src/manifest.rs Outdated Show resolved Hide resolved
tools/buildsys/src/main.rs Outdated Show resolved Hide resolved
tools/buildsys/src/main.rs Outdated Show resolved Hide resolved
tools/buildsys/src/manifest.rs Show resolved Hide resolved
@zmrow
Copy link
Contributor Author

zmrow commented Mar 31, 2021

^ addresses @bcressey 's comments

@zmrow
Copy link
Contributor Author

zmrow commented Mar 31, 2021

The build now stops before it tries to build packages if the current variant's supported architectures doesn't support the current architecture.

tools/buildsys/src/manifest.rs Show resolved Hide resolved
This change adds an additional key that can be specified in a variant's
`Cargo.toml`, `supported-arches`.  It is a list and the supported enum
values are `x86_64` and `aarch64`.  If `supported-arches` is specified,
the current `BUILDSYS_ARCH` is checked against the list.  If
`supported-arches` is not specified, the build continues as before.
This change adds the `supported-arch` key to `vmware-dev`'s `Cargo.toml`
and ensure's the variant will only be built for `x86_64`.
@zmrow
Copy link
Contributor Author

zmrow commented Apr 1, 2021

^ Addresses the comments!

@zmrow zmrow merged commit 2db2265 into bottlerocket-os:develop Apr 2, 2021
@zmrow zmrow deleted the supported_arch branch April 2, 2021 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

buildsys: Add ability for variants to support specific architectures
5 participants