build_tools/check.sh: check for Rust version updates; bump MSRV#11960
Closed
krobelus wants to merge 11 commits intofish-shell:masterfrom
Closed
build_tools/check.sh: check for Rust version updates; bump MSRV#11960krobelus wants to merge 11 commits intofish-shell:masterfrom
krobelus wants to merge 11 commits intofish-shell:masterfrom
Conversation
This was referenced Oct 16, 2025
added 2 commits
October 17, 2025 13:20
These comments should be placed on top of the line they're commenting on. Multi-line postfix comments will no longer be aligned using rustfmt's style edition 2024, so fix this now to prevent formatting issues later. For consistency, single-line postfix comments are also moved. Part of fish-shell#11959
This commit adds `style_edition = "2024"` as a rustfmt config setting. All other changes are automatically generated by `cargo fmt`. The 2024 style edition fixes several bugs and changes some defaults. https://doc.rust-lang.org/edition-guide/rust-2024/rustfmt-style-edition.html Most of the changes made to our code result from a different sorting method for `use` statements, improved ability to split long lines, and contraction of short trailing expressions into single-line expressions. While our MSRV is still 1.70, we use more recent toolchains for development, so we can already benefit from the improvements of the new style edition. Formatting is not require for building fish, so builds with Rust 1.70 are not affected by this change. More context can be found at fish-shell#11630 (comment) Closes fish-shell#11959
e84a192 to
d2b06f6
Compare
Update our MSRV to Rust 1.85. Includes fixes for lints which were previously suppressed due to them relying on features added after Rust 1.70. Rust 1.85 prints a warning when using `#[cfg(target_os = "cygwin")]`, so we work around the one instance where this is a problem for now. This workaround can be reverted when we update to Rust 1.86 or newer. Closes fish-shell#11961
The backport is no longer necessary with our new MSRV. Part of fish-shell#11964
The backport is no longer necessary with our new MSRV. Part of fish-shell#11964
Some annotations are no longer needed with more recent clippy (1.85+), so let's remove them. Closes fish-shell#11964
No particular reason for this specific MSRV policy, but it's better than nothing, since this will allow us to always update without thinking about it.
See fish-shell#11961 (comment) I didn't find a good way to add ~/.cargo/bin to $PATH only for fishuser, so hardcode it for all users for now. The default rustup behavior (source it in ~/.bashrc) only works for interactive shells, so it doesn't work in CI. I updated the images manually for now, because I'm not sure I want to test on master (see fish-shell#11884 and fish-shell#11961 (comment)) sed -i '/if: github.repository_owner/d' .github/workflows/build_docker_images.yml git commit # Upload new docker images. repo_owner=krobelus git push $repo_owner HEAD:tmp gh --repo=$repo_owner/fish-shell \ workflow run --ref=tmp \ .github/workflows/build_docker_images.yml # https://github.com/$repo_owner/fish-shell/actions/workflows/build_docker_images.yml sleep 3m # Enable Cirrus CI on fork. sed -i "s/OWNER == 'fish-shell'/OWNER == '$repo_owner'/g" .cirrus.yml git commit git push $repo_owner HEAD:tmp Part of fish-shell#11961
Opt-in because we don't want failures not related to local changes, see d93fc5e (Revert "build_tools/check.sh: check that stable rust is up-to-date", 2025-08-10). For the same reason, it's not currently checked by CI, though we could definitely have "renovatebot" do this in future.
d2b06f6 to
744d326
Compare
krobelus
commented
Oct 17, 2025
Comment on lines
+11
to
+67
| check_dependency_versions=false | ||
| if [ "${FISH_CHECK_DEPENDENCY_VERSIONS:-false}" != false ]; then | ||
| check_dependency_versions=true | ||
| fi | ||
|
|
||
| if $check_dependency_versions; then | ||
| command -v curl | ||
| command -v jq | ||
| command -v rustup | ||
| sort --version-sort </dev/null | ||
| # Check that we have latest stable. | ||
| if rustup check | grep ^stable- | grep 'Update available'; then | ||
| exit 1 | ||
| fi | ||
| # Check that GitHub CI uses latest stable Rust version. | ||
| stable_rust_version=$(rustc --version | cut -d' ' -f2) | ||
| stable_rust_version=${stable_rust_version%.*} | ||
| grep -q "(stable) echo $stable_rust_version ;;" \ | ||
| "$(project-root)/.github/actions/rust-toolchain/action.yml" | ||
|
|
||
| # Check that GitHub CI's MSRV is the Rust version available Debian stable. | ||
| debian_stable_codename=$( | ||
| curl -fsS https://ftp.debian.org/debian/dists/stable/Release | | ||
| grep '^Codename:' | cut -d' ' -f2) | ||
| debian_stable_rust_version=$( | ||
| curl -fsS https://sources.debian.org/api/src/rustc/ | | ||
| jq -r --arg debian_stable_codename "$debian_stable_codename" ' | ||
| .versions[] | select(.suites[] == $debian_stable_codename) | .version' | | ||
| sed 's/^\([0-9]\+\.[0-9]\+\).*/\1/' | | ||
| sort --version-sort | | ||
| tail -1) | ||
| grep -q "(msrv) *echo $debian_stable_rust_version ;;" \ | ||
| "$(project-root)/.github/actions/rust-toolchain/action.yml" | ||
|
|
||
| # Check that Cirrus CI uses the latest minor version of Alpine Linux. | ||
| alpine_latest_version=$( | ||
| curl -fsS "https://registry.hub.docker.com/v2/repositories/library/alpine/tags?page_size=10" \ | ||
| | jq -r '.results[].name' | grep '^[0-9]\+\.[0-9]\+$' | | ||
| sort --version-sort | | ||
| tail -1) | ||
| grep -qFx "FROM alpine:$alpine_latest_version" docker/alpine.Dockerfile | ||
|
|
||
| # Check that Cirrus CI uses the oldest version of Ubuntu that's not EOL. | ||
| ubuntu_oldest_alive_version=$( | ||
| today=$(date --iso-8601) | ||
| curl -fsS https://endoflife.date/api/ubuntu.json | | ||
| jq -r --arg today "$today" ' | ||
| .[] | ||
| | select(.eol >= $today) | ||
| | "\(.cycle)" | ||
| ' | | ||
| sort --version-sort | | ||
| head -1 | ||
| ) | ||
| grep -qFx "FROM ubuntu:$ubuntu_oldest_alive_version" docker/ubuntu-oldest-supported.Dockerfile | ||
| fi | ||
|
|
Contributor
Author
There was a problem hiding this comment.
I guess we should switch to Renovate straight away.
The upside is that it can generate PRs with automatic updates.
Possible downside is the extra notifications from all these PRs but I guess that's fine.
> give me configuration for renovatebot that does more or less the equivalent as lines
16 to 66 from build_tools/check.sh
● Read(build_tools/check.sh)
⎿ Read 60 lines (ctrl+r to expand)
● Here's a Renovate configuration that does the equivalent of the dependency checking
in lines 16-66:
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended"],
"regexManagers": [
{
"fileMatch": ["^\\.github/actions/rust-toolchain/action\\.yml$"],
"matchStrings": [
"\\(stable\\) echo (?<currentValue>\\d+\\.\\d+) ;;"
],
"depNameTemplate": "rust-stable",
"datasourceTemplate": "github-releases",
"packageNameTemplate": "rust-lang/rust"
},
{
"fileMatch": ["^\\.github/actions/rust-toolchain/action\\.yml$"],
"matchStrings": [
"\\(msrv\\) \\*?echo (?<currentValue>\\d+\\.\\d+) ;;"
],
"depNameTemplate": "rust-debian-stable",
"datasourceTemplate": "custom.debian-rust",
"packageNameTemplate": "rustc"
},
{
"fileMatch": ["^docker/alpine\\.Dockerfile$"],
"matchStrings": [
"FROM alpine:(?<currentValue>\\d+\\.\\d+)"
],
"depNameTemplate": "alpine",
"datasourceTemplate": "docker",
"packageNameTemplate": "alpine"
},
{
"fileMatch": ["^docker/ubuntu-oldest-supported\\.Dockerfile$"],
"matchStrings": [
"FROM ubuntu:(?<currentValue>\\d+\\.\\d+)"
],
"depNameTemplate": "ubuntu-oldest-supported",
"datasourceTemplate": "custom.ubuntu-eol",
"packageNameTemplate": "ubuntu"
}
],
"customDatasources": {
"debian-rust": {
"defaultRegistryUrlTemplate": "https://sources.debian.org/api/src/rustc/",
"transformTemplates": [
"{\"releases\": [{\"version\": \"${value}\"}]}"
]
},
"ubuntu-eol": {
"defaultRegistryUrlTemplate": "https://endoflife.date/api/ubuntu.json",
"transformTemplates": [
"{\"releases\": [${#each (filter releases 'eol >= \"${now}\"')}}{\"version\":
\"${cycle}\"}${#unless @last},{/unless}${/each}]}"
]
}
}
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Opt-in because we don't want failures not related to local changes,
see d93fc5e (Revert "build_tools/check.sh: check that stable rust
is up-to-date", 2025-08-10).
For the same reason, it's not currently checked by CI, though we
could definitely have "renovatebot" do this in future.
Also upgrade our MSRV to 1.85.