ci: Add specific nightly toolchain override.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2026-02-12 01:45:15 +00:00
parent 94162974f9
commit f8ffbbf161
3 changed files with 28 additions and 3 deletions

View File

@@ -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: |

View File

@@ -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)

View File

@@ -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