diff --git a/.github/workflows/bake.yml b/.github/workflows/bake.yml index 8afa20ff..48da4c2a 100644 --- a/.github/workflows/bake.yml +++ b/.github/workflows/bake.yml @@ -42,6 +42,10 @@ on: type: string default: '[]' description: Matrix inclusions + rust_nightly: + type: string + default: ${{vars.RUST_NIGHTLY || 'nightly'}} + description: Override nightly toolchain with more specific nightly. checkout: type: string default: 'HEAD' @@ -135,6 +139,7 @@ jobs: CI_VERBOSE_ENV: ${{inputs.verbose_env}} CI_SILENT_BAKE: ${{inputs.silent_bake}} CI_PRINT_BAKE: ${{inputs.print_bake}} + rust_nightly: ${{inputs.rust_nightly}} git_checkout: ${{inputs.checkout}} run: | diff --git a/docker/bake.hcl b/docker/bake.hcl index 55476414..f8b9bf81 100644 --- a/docker/bake.hcl +++ b/docker/bake.hcl @@ -54,6 +54,9 @@ variable "install_prefix" { variable "rust_msrv" { default = "stable" } +variable "rust_nightly" { + default = "nightly" +} variable "rust_toolchains" { default = "[\"nightly\", \"stable\"]" } @@ -1762,8 +1765,12 @@ target "rust" { input = elem("target:rustup", [rust_target, sys_name, sys_version, sys_target]) } args = { - rust_toolchain = (rust_toolchain == "stable"? - rust_msrv: rust_toolchain + rust_toolchain = ( + rust_toolchain == "stable"? + rust_msrv: + rust_toolchain == "nightly"? + rust_nightly: + rust_toolchain ) rustup_components = join(" ", rustup_components) diff --git a/docker/bake.sh b/docker/bake.sh index e869c20f..52572246 100755 --- a/docker/bake.sh +++ b/docker/bake.sh @@ -57,11 +57,24 @@ sys_versions="${env_sys_versions:-$default_sys_versions}" docker_dir="$PWD/$BASEDIR" builder_name="${GITHUB_ACTOR:-owo}" + +# Translates 'nightly' in `rust_toolchains` to some other value. Needed for +# github actions to pass some specific nightly. Local users can add the specific +# nightly to the `rust_toolchains` array as intended. see bake.hcl +rust_nightly="${rust_nightly:-nightly}" + +# Translates 'stable' in `rust_toolchains` to some specific toolchain. Used +# by default for all callers to ensure the msrv is used instead of latest +# stable. see bake.hcl toolchain_toml="$docker_dir/../rust-toolchain.toml" rust_msrv=$(grep "channel = " "$toolchain_toml" | cut -d'=' -f2 | sed 's/\s"\|"$//g') + +# override the source position with another ref +git_checkout="${git_checkout:-HEAD}" + +# other options rocksdb_opt_level=3 rocksdb_portable=1 -git_checkout="${git_checkout:-HEAD}" use_chef="true" set +a