mirror of https://github.com/rust-lang/rust.git
Auto merge of #112746 - matthiaskrgr:rollup-se59bfd, r=matthiaskrgr
Rollup of 5 pull requests Successful merges: - #110805 (Github action to periodically `cargo update` to keep dependencies current) - #112435 (Allow overwriting the sysroot compile flag via --rustc-args) - #112610 (Bump stdarch) - #112619 (Suggest bumping download-ci-llvm-stamp if the build config for llvm changes) - #112738 (make ice msg "Unknown runtime phase" a bit nicer) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
3b2073f076
|
@ -0,0 +1,139 @@
|
||||||
|
# Automatically run `cargo update` periodically
|
||||||
|
|
||||||
|
---
|
||||||
|
name: Bump dependencies in Cargo.lock
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
# Run weekly
|
||||||
|
- cron: '0 0 * * Sun'
|
||||||
|
workflow_dispatch:
|
||||||
|
# Needed so we can run it manually
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
# So cargo doesn't complain about unstable features
|
||||||
|
RUSTC_BOOTSTRAP: 1
|
||||||
|
PR_TITLE: Weekly `cargo update`
|
||||||
|
PR_MESSAGE: |
|
||||||
|
Automation to keep dependencies in `Cargo.lock` current.
|
||||||
|
|
||||||
|
The following is the output from `cargo update`:
|
||||||
|
COMMIT_MESSAGE: "cargo update \n\n"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
not-waiting-on-bors:
|
||||||
|
name: skip if S-waiting-on-bors
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
# Fetch state and labels of PR
|
||||||
|
# Or exit successfully if PR does not exist
|
||||||
|
JSON=$(gh pr view cargo_update --repo $GITHUB_REPOSITORY --json labels,state || exit 0)
|
||||||
|
STATE=$(echo "$JSON" | jq -r '.state')
|
||||||
|
WAITING_ON_BORS=$(echo "$JSON" | jq '.labels[] | any(.name == "S-waiting-on-bors"; .)')
|
||||||
|
|
||||||
|
# Exit with error if open and S-waiting-on-bors
|
||||||
|
if [[ "$STATE" == "OPEN" && "$WAITING_ON_BORS" == "true" ]]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
update:
|
||||||
|
name: update dependencies
|
||||||
|
needs: not-waiting-on-bors
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: checkout the source code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
- name: install the bootstrap toolchain
|
||||||
|
run: |
|
||||||
|
# Extract the stage0 version
|
||||||
|
TOOLCHAIN=$(jq -r '.compiler | {version,date} | join("-")' -- src/stage0.json)
|
||||||
|
# Install and set as default
|
||||||
|
rustup toolchain install --no-self-update --profile minimal $TOOLCHAIN
|
||||||
|
rustup default $TOOLCHAIN
|
||||||
|
|
||||||
|
- name: cargo update
|
||||||
|
# Remove first line that always just says "Updating crates.io index"
|
||||||
|
run: cargo update 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log
|
||||||
|
- name: upload Cargo.lock artifact for use in PR
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: Cargo-lock
|
||||||
|
path: Cargo.lock
|
||||||
|
retention-days: 1
|
||||||
|
- name: upload cargo-update log artifact for use in PR
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: cargo-updates
|
||||||
|
path: cargo_update.log
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
|
pr:
|
||||||
|
name: amend PR
|
||||||
|
needs: update
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
steps:
|
||||||
|
- name: checkout the source code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: download Cargo.lock from update job
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: Cargo-lock
|
||||||
|
- name: download cargo-update log from update job
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: cargo-updates
|
||||||
|
|
||||||
|
- name: craft PR body and commit message
|
||||||
|
run: |
|
||||||
|
echo "${COMMIT_MESSAGE}" > commit.txt
|
||||||
|
cat cargo_update.log >> commit.txt
|
||||||
|
|
||||||
|
echo "${PR_MESSAGE}" > body.md
|
||||||
|
echo '```txt' >> body.md
|
||||||
|
cat cargo_update.log >> body.md
|
||||||
|
echo '```' >> body.md
|
||||||
|
|
||||||
|
- name: commit
|
||||||
|
run: |
|
||||||
|
git config user.name github-actions
|
||||||
|
git config user.email github-actions@github.com
|
||||||
|
git switch --force-create cargo_update
|
||||||
|
git add ./Cargo.lock
|
||||||
|
git commit --no-verify --file=commit.txt
|
||||||
|
|
||||||
|
- name: push
|
||||||
|
run: git push --no-verify --force --set-upstream origin cargo_update
|
||||||
|
|
||||||
|
- name: edit existing open pull request
|
||||||
|
id: edit
|
||||||
|
# Don't fail job if we need to open new PR
|
||||||
|
continue-on-error: true
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
# Exit with error if PR is closed
|
||||||
|
STATE=$(gh pr view cargo_update --repo $GITHUB_REPOSITORY --json state --jq '.state')
|
||||||
|
if [[ "$STATE" != "OPEN" ]]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
gh pr edit cargo_update --title "${PR_TITLE}" --body-file body.md --repo $GITHUB_REPOSITORY
|
||||||
|
|
||||||
|
- name: open new pull request
|
||||||
|
# Only run if there wasn't an existing PR
|
||||||
|
if: steps.edit.outcome != 'success'
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: gh pr create --title "${PR_TITLE}" --body-file body.md --repo $GITHUB_REPOSITORY
|
|
@ -145,7 +145,7 @@ impl MirPhase {
|
||||||
}
|
}
|
||||||
"analysis" => Self::Analysis(AnalysisPhase::parse(phase)),
|
"analysis" => Self::Analysis(AnalysisPhase::parse(phase)),
|
||||||
"runtime" => Self::Runtime(RuntimePhase::parse(phase)),
|
"runtime" => Self::Runtime(RuntimePhase::parse(phase)),
|
||||||
_ => panic!("Unknown MIR dialect {}", dialect),
|
_ => bug!("Unknown MIR dialect: '{}'", dialect),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -159,7 +159,7 @@ impl AnalysisPhase {
|
||||||
match &*phase.to_ascii_lowercase() {
|
match &*phase.to_ascii_lowercase() {
|
||||||
"initial" => Self::Initial,
|
"initial" => Self::Initial,
|
||||||
"post_cleanup" | "post-cleanup" | "postcleanup" => Self::PostCleanup,
|
"post_cleanup" | "post-cleanup" | "postcleanup" => Self::PostCleanup,
|
||||||
_ => panic!("Unknown analysis phase {}", phase),
|
_ => bug!("Unknown analysis phase: '{}'", phase),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -174,7 +174,7 @@ impl RuntimePhase {
|
||||||
"initial" => Self::Initial,
|
"initial" => Self::Initial,
|
||||||
"post_cleanup" | "post-cleanup" | "postcleanup" => Self::PostCleanup,
|
"post_cleanup" | "post-cleanup" | "postcleanup" => Self::PostCleanup,
|
||||||
"optimized" => Self::Optimized,
|
"optimized" => Self::Optimized,
|
||||||
_ => panic!("Unknown runtime phase {}", phase),
|
_ => bug!("Unknown runtime phase: '{}'", phase),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 7e2cdc675b92165c5f8c4c794620252be4605e74
|
Subproject commit d77878b7299dd7e286799a6e8447048b65d2a861
|
|
@ -1951,7 +1951,9 @@ impl<'test> TestCx<'test> {
|
||||||
rustc.arg("-Ztranslate-remapped-path-to-local-path=no");
|
rustc.arg("-Ztranslate-remapped-path-to-local-path=no");
|
||||||
|
|
||||||
// Optionally prevent default --sysroot if specified in test compile-flags.
|
// Optionally prevent default --sysroot if specified in test compile-flags.
|
||||||
if !self.props.compile_flags.iter().any(|flag| flag.starts_with("--sysroot")) {
|
if !self.props.compile_flags.iter().any(|flag| flag.starts_with("--sysroot"))
|
||||||
|
&& !self.config.host_rustcflags.iter().any(|flag| flag == "--sysroot")
|
||||||
|
{
|
||||||
// In stage 0, make sure we use `stage0-sysroot` instead of the bootstrap sysroot.
|
// In stage 0, make sure we use `stage0-sysroot` instead of the bootstrap sysroot.
|
||||||
rustc.arg("--sysroot").arg(&self.config.sysroot_base);
|
rustc.arg("--sysroot").arg(&self.config.sysroot_base);
|
||||||
}
|
}
|
||||||
|
|
|
@ -477,6 +477,13 @@ message = "This PR changes src/bootstrap/defaults/config.compiler.toml. If appro
|
||||||
[mentions."src/bootstrap/defaults/config.codegen.toml"]
|
[mentions."src/bootstrap/defaults/config.codegen.toml"]
|
||||||
message = "This PR changes src/bootstrap/defaults/config.codegen.toml. If appropriate, please also update `config.compiler.toml` so the defaults are in sync."
|
message = "This PR changes src/bootstrap/defaults/config.codegen.toml. If appropriate, please also update `config.compiler.toml` so the defaults are in sync."
|
||||||
|
|
||||||
|
[mentions."src/bootstrap/llvm.rs"]
|
||||||
|
message = "This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp."
|
||||||
|
[mentions."compiler/rustc_llvm/build.rs"]
|
||||||
|
message = "This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp."
|
||||||
|
[mentions."compiler/rustc_llvm/llvm-wrapper"]
|
||||||
|
message = "This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp."
|
||||||
|
|
||||||
[mentions."tests/ui/deriving/deriving-all-codegen.stdout"]
|
[mentions."tests/ui/deriving/deriving-all-codegen.stdout"]
|
||||||
message = "Changes to the code generated for builtin derived traits."
|
message = "Changes to the code generated for builtin derived traits."
|
||||||
cc = ["@nnethercote"]
|
cc = ["@nnethercote"]
|
||||||
|
|
Loading…
Reference in New Issue