Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync Miri #102464

Closed
wants to merge 1 commit into from
Closed

sync Miri #102464

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 22 additions & 51 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -385,11 +385,12 @@ version = "0.1.0"
dependencies = [
"cargo_metadata 0.15.0",
"directories",
"rustc-build-sysroot",
"rustc-workspace-hack",
"rustc_tools_util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_version",
"serde",
"serde_json",
"vergen",
]

[[package]]
Expand Down Expand Up @@ -647,7 +648,7 @@ dependencies = [
"regex",
"rustc-semver",
"rustc-workspace-hack",
"rustc_tools_util",
"rustc_tools_util 0.2.0",
"semver",
"serde",
"syn",
Expand Down Expand Up @@ -1082,9 +1083,9 @@ dependencies = [

[[package]]
name = "directories"
version = "3.0.2"
version = "4.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e69600ff1703123957937708eb27f7a564e48885c537782722ed0ba3189ce1d7"
checksum = "f51c5d4ddabd36886dd3e1438cb358cdcb0d7c499cb99cb4ac2e38e18b5cb210"
dependencies = [
"dirs-sys",
]
Expand Down Expand Up @@ -1174,26 +1175,6 @@ dependencies = [
"log",
]

[[package]]
name = "enum-iterator"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c79a6321a1197d7730510c7e3f6cb80432dfefecb32426de8cea0aa19b4bb8d7"
dependencies = [
"enum-iterator-derive",
]

[[package]]
name = "enum-iterator-derive"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e94aa31f7c0dc764f57896dc615ddd76fc13b0d5dca7eb6cc5e018a5a09ec06"
dependencies = [
"proc-macro2",
"quote",
"syn",
]

[[package]]
name = "env_logger"
version = "0.7.1"
Expand Down Expand Up @@ -1531,18 +1512,6 @@ dependencies = [
"wasi 0.9.0+wasi-snapshot-preview1",
]

[[package]]
name = "getset"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24b328c01a4d71d2d8173daa93562a73ab0fe85616876f02500f53d82948c504"
dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
"syn",
]

[[package]]
name = "gimli"
version = "0.25.0"
Expand Down Expand Up @@ -3029,6 +2998,17 @@ dependencies = [
"mdbook",
]

[[package]]
name = "rustc-build-sysroot"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec5f3689b6c560d6a3a17fcbe54204cd870b4fcf46342d60de16715b660d2c92"
dependencies = [
"anyhow",
"rustc_version",
"tempfile",
]

[[package]]
name = "rustc-demangle"
version = "0.1.21"
Expand Down Expand Up @@ -4165,6 +4145,12 @@ dependencies = [
name = "rustc_tools_util"
version = "0.2.0"

[[package]]
name = "rustc_tools_util"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b725dadae9fabc488df69a287f5a99c5eaf5d10853842a8a3dfac52476f544ee"

[[package]]
name = "rustc_trait_selection"
version = "0.0.0"
Expand Down Expand Up @@ -5330,21 +5316,6 @@ version = "0.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c"

[[package]]
name = "vergen"
version = "5.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dfbc87f9a7a9d61b15d51d1d3547284f67b6b4f1494ce3fc5814c101f35a5183"
dependencies = [
"anyhow",
"chrono",
"enum-iterator",
"getset",
"git2",
"rustversion",
"thiserror",
]

[[package]]
name = "version_check"
version = "0.9.3"
Expand Down
12 changes: 0 additions & 12 deletions src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -494,16 +494,6 @@ impl Step for Miri {
// sysroot does not seem to populate it, so we do that first.
builder.ensure(compile::Std::new(compiler_std, host));
let sysroot = builder.sysroot(compiler_std);
let mut cargo =
builder.cargo(compiler, Mode::ToolRustc, SourceType::Submodule, host, "install");
cargo.arg("xargo");
// Configure `cargo install` path. cargo adds a `bin/`.
cargo.env("CARGO_INSTALL_ROOT", &builder.out);

let mut cargo = Command::from(cargo);
if !try_run(builder, &mut cargo) {
return;
}
oli-obk marked this conversation as resolved.
Show resolved Hide resolved

// # Run `cargo miri setup`.
let mut cargo = tool::prepare_tool_cargo(
Expand All @@ -525,8 +515,6 @@ impl Step for Miri {
cargo.env("MIRI", &miri);
// Debug things.
cargo.env("RUST_BACKTRACE", "1");
// Let cargo-miri know where xargo ended up.
cargo.env("XARGO_CHECK", builder.out.join("bin").join("xargo-check"));

let mut cargo = Command::from(cargo);
builder.run(&mut cargo);
Expand Down
5 changes: 3 additions & 2 deletions src/ci/scripts/should-skip-this.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ if [[ -n "${CI_ONLY_WHEN_SUBMODULES_CHANGED-}" ]]; then
# Submodules pseudo-files inside git have the 160000 permissions, so when
# those files are present in the diff a submodule was updated.
echo "Submodules were updated"
elif ! git diff --quiet "$BASE_COMMIT" -- src/tools/clippy src/tools/rustfmt; then
elif ! (git diff --quiet "$BASE_COMMIT" -- \
src/tools/clippy src/tools/rustfmt src/tools/miri); then
# There is not an easy blanket search for subtrees. For now, manually list
# the subtrees.
echo "Clippy or rustfmt subtrees were updated"
echo "Tool subtrees were updated"
elif ! (git diff --quiet "$BASE_COMMIT" -- \
src/test/rustdoc-gui \
src/librustdoc \
Expand Down
20 changes: 7 additions & 13 deletions src/tools/miri/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:
schedule:
- cron: '5 15 * * *' # At 15:05 UTC every day.

env:
CARGO_UNSTABLE_SPARSE_REGISTRY: 'true'

jobs:
build:
runs-on: ${{ matrix.os }}
Expand All @@ -38,14 +41,6 @@ jobs:
if: runner.os == 'Linux'
run: echo "MIRIFLAGS=-Zmiri-tag-gc=1" >> $GITHUB_ENV

# We install gnu-tar because BSD tar is buggy on macOS builders of GHA.
# See <https://github.com/actions/cache/issues/403>.
- name: Install GNU tar
if: runner.os == 'macOS'
run: |
brew install gnu-tar
echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH
# Cache the global cargo directory, but NOT the local `target` directory which
# we cannot reuse anyway when the nightly changes (and it grows quite large
# over time).
Expand All @@ -62,15 +57,14 @@ jobs:
# contains package information of crates installed via `cargo install`.
~/.cargo/.crates.toml
~/.cargo/.crates2.json
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock', 'cargo-miri/src/version.rs') }}
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo

- name: Install rustup-toolchain-install-master and xargo
if: ${{ steps.cache.outputs.cache-hit == 'false' }}
- name: Install rustup-toolchain-install-master
if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
shell: bash
run: |
cargo install rustup-toolchain-install-master
cargo install xargo
cargo install -f rustup-toolchain-install-master
- name: Install "master" toolchain
shell: bash
Expand Down
27 changes: 26 additions & 1 deletion src/tools/miri/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ for you. If you don't want all of these to happen, you can add individual `.auto
## Building and testing Miri

Invoking Miri requires getting a bunch of flags right and setting up a custom
sysroot with xargo. The `miri` script takes care of that for you. With the
sysroot. The `miri` script takes care of that for you. With the
build environment prepared, compiling Miri is just one command away:

```
Expand Down Expand Up @@ -275,3 +275,28 @@ see <https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html>.

With this, you should now have a working development setup! See
[above](#building-and-testing-miri) for how to proceed working on Miri.


### Fetching the latest changes from the rustc repo

Run the josh proxy locally

```
docker run -p 8000:8000 -e JOSH_REMOTE=https://github.com -v josh-vol:/data/git joshproject/josh-proxy:latest
```

Register the josh proxy as a remote

```
git remote add josh http://localhost:8000/rust-lang/rust.git:/src/tools/miri.git
```

Fetch (takes ca 5-10 min the first time)

```
git fetch josh
git checkout josh/master
git switch -c josh_sync
```

Now push `josh_sync` to your own miri fork and open a PR with it.
Loading