File tree Expand file tree Collapse file tree 5 files changed +39
-5
lines changed Expand file tree Collapse file tree 5 files changed +39
-5
lines changed Original file line number Diff line number Diff line change 1717 # Save a little typing (path relative to $CIRRUS_WORKING_DIR)
1818 SCRIPT_BASE : " ./contrib/cirrus"
1919 FEDORA_NAME : " fedora-35"
20- IMAGE_SUFFIX : " c4560539387953152 "
20+ IMAGE_SUFFIX : " c6118659411148800 "
2121 FEDORA_NETAVARK_IMAGE : " fedora-netavark-${IMAGE_SUFFIX}"
2222
2323
@@ -113,6 +113,15 @@ unit_task:
113113 setup_script : *setup
114114 main_script : *main
115115
116+ build_cross_task :
117+ alias : " build_cross"
118+ depends_on :
119+ - " build"
120+ cargo_cache : *ro_cargo_cache
121+ targets_cache : *ro_targets_cache
122+ bin_cache : *ro_bin_cache
123+ setup_script : *setup
124+ main_script : *main
116125
117126integration_task :
118127 alias : " integration"
@@ -152,6 +161,7 @@ success_task:
152161 alias : success
153162 depends_on :
154163 - " build"
164+ - " build_cross"
155165 - " validate"
156166 - " verify_vendor"
157167 - " unit"
Original file line number Diff line number Diff line change @@ -75,6 +75,15 @@ test: unit integration
7575build_unit : $(CARGO_TARGET_DIR )
7676 cargo test --no-run
7777
78+ # Test build cross-architecture
79+ .PHONY : build_cross
80+ build_cross : $(CARGO_TARGET_DIR )
81+ cargo install cross
82+ rustup target add aarch64-unknown-linux-gnu
83+ rustup target add arm-unknown-linux-gnueabi
84+ cross build --target aarch64-unknown-linux-gnu
85+ cross build --target arm-unknown-linux-gnueabi
86+
7887.PHONY : unit
7988unit : $(CARGO_TARGET_DIR )
8089 cargo test
Original file line number Diff line number Diff line change @@ -29,10 +29,9 @@ SECRET_ENV_RE='(ACCOUNT)|(GC[EP]..+)|(SSH)|(PASSWORD)|(TOKEN)'
2929if [[ -r " /etc/ci_environment" ]]; then
3030 source /etc/ci_environment
3131else # set default values - see make_cienv() below
32- # Install rust packages globally instead of per-user
33- CARGO_HOME=" ${CARGO_HOME:-/ usr/ local/ cargo} "
34- # Ensure cargo packages can be executed
35- PATH=" $PATH :$CARGO_HOME /bin"
32+ # VM Images are built with this setup
33+ CARGO_HOME=" ${CARGO_HOME:-/ var/ cache/ cargo} "
34+ source $CARGO_HOME /env
3635fi
3736
3837# END Global export of all variables
Original file line number Diff line number Diff line change 3535}
3636
3737_run_validate () {
38+ rustup install stable
39+ rustup default stable
3840 make validate
3941}
4042
43+ _run_build_cross () {
44+ make build_cross
45+ }
46+
4147_run_verify_vendor () {
4248 # N/B: current repo. dir. contents produced by _run_build() above.
4349 if ! git diff --no-ext-diff --quiet --exit-code; then
Original file line number Diff line number Diff line change @@ -14,7 +14,17 @@ if [[ -r "/etc/ci_environment" ]]; then
1414fi
1515trap " complete_setup" EXIT
1616
17+
1718msg " ************************************************************"
1819msg " Setting up runtime environment"
1920msg " ************************************************************"
21+
22+ dnf -y install make automake gcc gcc-c++ kernel-devel
23+
2024show_env_vars
25+
26+ if [[ " $CIRRUS_TASK_NAME " == " build_cross" ]]; then
27+ # Setup short-name for rustembedded/cross
28+ # TODO: We can move this to quay.io if we reach rate-limits, hopefully that's not gonna happen for netavark
29+ echo ' "rustembedded/cross" = "docker.io/rustembedded/cross"' >> /etc/containers/registries.conf.d/000-shortnames.conf
30+ fi
You can’t perform that action at this time.
0 commit comments