Skip to content

Commit

Permalink
Merge pull request #399 from cbgbt/cross-build-with-golang
Browse files Browse the repository at this point in the history
cross: install golang in the cross container
  • Loading branch information
cbgbt authored Oct 11, 2024
2 parents a54ac6d + 35f375d commit 929a517
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ jobs:
# do agree on 'cat' and '$()' so we use that to marshal values between commands.
run: |
export PATH=$CARGO_HOME/bin:$PATH
# cargo-cross warns us that multiple cross configurations are present in our
# workspace (ie dependencies have configurations), but it picks the appropriate one from
# the twoliter workspace.
#
# These warnings cause the tool to fail, so we disable them.
export CROSS_NO_WARNINGS=0
# Actually do builds and make zips and whatnot
cargo dist build --tag="${GITHUB_REF_NAME}" --output-format=json ${MATRIX_DIST_ARGS} > dist-manifest.json
echo "dist ran successfully"
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ installers = []
# Target platforms to build apps for (Rust target-triple syntax)
targets = ["x86_64-unknown-linux-musl", "aarch64-unknown-linux-musl"]

[workspace.metadata.cross.build]
pre-build = [
# install golang for krane-bundle
"apt update && apt --assume-yes install golang-1.22",
"update-alternatives --install /usr/bin/go go /usr/lib/go-1.22/bin/go 10",
# give the builder access to the go build and module caches
"mkdir /.cache && chmod a+rw /.cache",
"mkdir /go && chmod a+rw /go",
]

[workspace.dependencies]
bottlerocket-types = { version = "0.0.14", git = "https://github.com/bottlerocket-os/bottlerocket-test-system", tag = "v0.0.14" }
bottlerocket-variant = { version = "0.1", path = "tools/bottlerocket-variant" }
Expand All @@ -51,7 +61,7 @@ pubsys-setup = { version = "0.1", path = "tools/pubsys-setup", artifact = [ "bin
testsys = { version = "0.1", path = "tools/testsys", artifact = [ "bin:testsys" ] }
testsys-config = { version = "0.1", path = "tools/testsys-config" }
testsys-model = { version = "0.0.14", git = "https://github.com/bottlerocket-os/bottlerocket-test-system", tag = "v0.0.14" }
twoliter = { version = "0.5.0-rc3", path = "twoliter", artifact = [ "bin:twoliter" ] }
twoliter = { version = "0.5.0-rc4", path = "twoliter", artifact = [ "bin:twoliter" ] }
unplug = { version = "0.1", path = "tools/unplug", artifact = [ "bin:unplug" ] }
update-metadata = { version = "0.1", path = "tools/update-metadata" }

Expand Down
2 changes: 1 addition & 1 deletion twoliter/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "twoliter"
version = "0.5.0-rc3"
version = "0.5.0-rc4"
edition = "2021"
description = "A command line tool for creating custom builds of Bottlerocket"
authors = ["Matthew James Briggs <brigmatt@amazon.com>"]
Expand Down

0 comments on commit 929a517

Please sign in to comment.