Skip to content

Subtree sync for rustc_codegen_cranelift #119470

New issue

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

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

Already on GitHub? # to your account

Merged
merged 21 commits into from
Dec 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
7e213fe
Remove `Session` methods that duplicate `DiagCtxt` methods.
nnethercote Dec 18, 2023
93c86f7
Remove more `Session` methods that duplicate `DiagCtxt` methods.
nnethercote Dec 21, 2023
7325d0d
Merge commit '26c02eb2904da9a53d2220d4f3069b19a3c81d3d' into sync_cg_…
bjorn3 Dec 24, 2023
39f0dac
Merge branch 'sync_from_rust'
bjorn3 Dec 24, 2023
653121c
Fix borked subtree syncs
bjorn3 Dec 24, 2023
bcae781
Auto merge of #119146 - nnethercote:rm-DiagCtxt-api-duplication, r=co…
bors Dec 26, 2023
e101a1b
Avoid warning about the jobserver fd not being open for recursive rus…
bjorn3 Dec 26, 2023
4c0ad60
Sync from rust 89e2160c4ca5808657ed55392620ed1dbbce78d1
bjorn3 Dec 28, 2023
1dbb249
Rustup to rustc 1.77.0-nightly (89e2160c4 2023-12-27)
bjorn3 Dec 28, 2023
6b1a3ad
Remove movability from TyKind::Coroutine
compiler-errors Dec 21, 2023
fa9cce0
Sync from rust 3cdd004e55c869faa2b7b25efd3becf50346e7d6
bjorn3 Dec 30, 2023
5c95200
Rustup to rustc 1.77.0-nightly (3cdd004e5 2023-12-29)
bjorn3 Dec 30, 2023
75f1c2b
Rustup to rustc 1.77.0-nightly (2a3e63551 2023-12-30)
bjorn3 Dec 31, 2023
4b239fa
Install hyperfine using the system package manager
bjorn3 Dec 31, 2023
e2502ac
Update the GHA artifacts actions to v4
bjorn3 Dec 31, 2023
3fa4eff
Install ripgrep using the system package manager
bjorn3 Dec 31, 2023
d58de3e
Suppress progress notifications for all git commands
bjorn3 Dec 31, 2023
02183f7
Suppress default config change warnings
bjorn3 Dec 31, 2023
c55aaa5
Remove no longer needed config option from setup_rust_fork.sh
bjorn3 Dec 31, 2023
6d355f6
Merge pull request #1440 from rust-lang/ci_speedup_and_cleanup
bjorn3 Dec 31, 2023
d1d134e
Merge commit '6d355f6844323db03bfd608899613e363e701951' into sync_cg_…
bjorn3 Dec 31, 2023
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
16 changes: 6 additions & 10 deletions compiler/rustc_codegen_cranelift/.github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,10 @@ jobs:
path: build/cg_clif
key: ${{ runner.os }}-x86_64-unknown-linux-gnu-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}

- name: Cache cargo bin dir
uses: actions/cache@v3
with:
path: ~/.cargo/bin
key: ${{ runner.os }}-${{ matrix.env.TARGET_TRIPLE }}-cargo-bin-dir-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}

- name: Install hyperfine
run: cargo install hyperfine || true
run: |
sudo apt update
sudo apt install -y hyperfine

- name: Prepare dependencies
run: ./y.sh prepare
Expand Down Expand Up @@ -257,14 +253,14 @@ jobs:

- name: Upload prebuilt cg_clif
if: matrix.os == 'windows-latest' || matrix.env.TARGET_TRIPLE != 'x86_64-pc-windows-gnu'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: cg_clif-${{ matrix.env.TARGET_TRIPLE }}
path: cg_clif.tar.xz

- name: Upload prebuilt cg_clif (cross compile)
if: matrix.os != 'windows-latest' && matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: cg_clif-${{ runner.os }}-cross-x86_64-mingw
path: cg_clif.tar.xz
Expand All @@ -283,7 +279,7 @@ jobs:
- uses: actions/checkout@v3

- name: Download all built artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: artifacts/

Expand Down
5 changes: 5 additions & 0 deletions compiler/rustc_codegen_cranelift/.github/workflows/rustc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ jobs:
path: build/cg_clif
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}

- name: Install ripgrep
run: |
sudo apt update
sudo apt install -y ripgrep

- name: Prepare dependencies
run: ./y.sh prepare

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_cranelift/rust-toolchain
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "nightly-2023-12-24"
channel = "nightly-2023-12-31"
components = ["rust-src", "rustc-dev", "llvm-tools"]
15 changes: 7 additions & 8 deletions compiler/rustc_codegen_cranelift/scripts/setup_rust_fork.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -e

# CG_CLIF_FORCE_GNU_AS will force usage of as instead of the LLVM backend of rustc as we
# CG_CLIF_FORCE_GNU_AS will force usage of as instead of the LLVM backend of rustc as
# the LLVM backend isn't compiled in here.
export CG_CLIF_FORCE_GNU_AS=1

Expand All @@ -11,20 +11,19 @@ export CG_CLIF_FORCE_GNU_AS=1
CG_CLIF_STDLIB_REMAP_PATH_PREFIX=/rustc/FAKE_PREFIX ./y.sh build

echo "[SETUP] Rust fork"
git clone https://github.com/rust-lang/rust.git --filter=tree:0 || true
git clone --quiet https://github.com/rust-lang/rust.git --filter=tree:0 || true
pushd rust
git fetch
git checkout -- .
git checkout "$(rustc -V | cut -d' ' -f3 | tr -d '(')"
git checkout --no-progress -- .
git checkout --no-progress "$(rustc -V | cut -d' ' -f3 | tr -d '(')"

git submodule update --quiet --init src/tools/cargo library/backtrace library/stdarch

git -c user.name=Dummy -c user.email=dummy@example.com -c commit.gpgSign=false \
am ../patches/*-stdlib-*.patch

cat > config.toml <<EOF
change-id = 115898

[llvm]
ninja = false
change-id = 999999

[build]
rustc = "$(pwd)/../dist/bin/rustc-clif"
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_cranelift/src/driver/jit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ fn dep_symbol_lookup_fn(
Linkage::NotLinked | Linkage::IncludedFromDylib => {}
Linkage::Static => {
let name = crate_info.crate_name[&cnum];
let mut err = sess.struct_err(format!("Can't load static lib {}", name));
let mut err = sess.dcx().struct_err(format!("Can't load static lib {}", name));
err.note("rustc_codegen_cranelift can only load dylibs in JIT mode.");
err.emit();
}
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_codegen_cranelift/src/global_asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ pub(crate) fn compile_global_asm(
}
} else {
let mut child = Command::new(std::env::current_exe().unwrap())
// Avoid a warning about the jobserver fd not being passed
.env_remove("CARGO_MAKEFLAGS")
.arg("--target")
.arg(&config.target)
.arg("--crate-type")
Expand Down