Skip to content

rustup: update to nightly-2025-05-09 (~1.88) and Rust 2024 edition. #249

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

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
1cb0a8a
intrinsics: use `GLOp::RoundEven` for `round_ties_even`.
eddyb May 7, 2025
4ca2243
rustup: update to `nightly-2024-12-01`.
eddyb May 6, 2025
a927d80
Update target specs (remove os=unknown, add crt-static-respected).
eddyb May 2, 2025
b557305
Fix new `clippy::unnecessary_map_or` warnings.
eddyb May 10, 2025
7447b60
rustup: update to `nightly-2024-12-10`.
eddyb May 6, 2025
1c6daba
rustup: update to `nightly-2024-12-15`.
eddyb May 6, 2025
cf06a6f
rustup: update to `nightly-2024-12-16`.
eddyb May 6, 2025
2ac98d4
builder: always `pointercast` first before attempting to merge `OpAcc…
eddyb May 7, 2025
f8de946
rustup: update to `nightly-2024-12-17`.
eddyb May 6, 2025
1dfdd32
rustup: update to `nightly-2024-12-20`.
eddyb May 6, 2025
40c0ecd
rustup: update to `nightly-2024-12-25`.
eddyb May 6, 2025
e0f808a
rustup: update to `nightly-2025-01-03` (~1.85).
eddyb May 4, 2025
aed0303
Fix new `clippy::precedence` warnings.
eddyb May 10, 2025
f99ce97
rustfmt using `nightly-2025-02-16`.
eddyb May 7, 2025
2826514
rustup: update to `nightly-2025-02-16` (~1.86).
eddyb May 7, 2025
1854c70
Fix new clippy warnings.
eddyb May 10, 2025
8416c4e
rustc_codegen_spirv: switch to Rust 2024 edition.
eddyb May 7, 2025
4fb83b4
rustup: update to `nightly-2025-03-29` (~1.87).
eddyb May 7, 2025
2a26250
abi: more workarounds for old-style `#[repr(simd)] struct`s.
eddyb May 7, 2025
90caf3a
Fix new clippy warnings.
eddyb May 12, 2025
9f6c45a
rustup: update to `nightly-2025-04-13`.
eddyb May 12, 2025
fd29042
rustup: update to `nightly-2025-04-14`.
eddyb May 12, 2025
aad713c
abi: unhide `bool`'s niche, breaking `Option<bool>` for Rust-GPU but …
eddyb May 12, 2025
8a2ddaa
Switch all crates to Rust 2024 edition.
LegNeato Apr 30, 2025
839fc43
rustup: update to `nightly-2025-04-27`.
eddyb May 12, 2025
e0f8b81
Fix new `clippy::uninlined_format_args` warnings.
eddyb May 12, 2025
9df1950
rustup to `nightly-2025-04-28`
LegNeato Apr 30, 2025
9a35769
rustup: update to `nightly-2025-05-09` (~1.88).
eddyb May 12, 2025
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
1 change: 0 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ rustflags = [
"-Wclippy::map_err_ignore",
"-Wclippy::map_flatten",
"-Wclippy::map_unwrap_or",
"-Wclippy::match_on_vec_items",
"-Wclippy::match_same_arms",
"-Wclippy::match_wild_err_arm",
"-Wclippy::match_wildcard_for_single_variants",
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ members = [
[workspace.package]
version = "0.9.0"
authors = ["rust-gpu developers", "Embark <[email protected]>"]
edition = "2021"
edition = "2024"
license = "MIT OR Apache-2.0"
repository = "https://github.com/rust-gpu/rust-gpu"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"arch": "spirv",
"crt-objects-fallback": "false",
"crt-static-allows-dylibs": true,
"crt-static-respected": true,
"data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64",
"dll-prefix": "",
"dll-suffix": ".spv.json",
Expand All @@ -19,7 +20,6 @@
"std": null,
"tier": null
},
"os": "unknown",
"panic-strategy": "abort",
"simd-types-indirect": false,
"target-pointer-width": "32"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"arch": "spirv",
"crt-objects-fallback": "false",
"crt-static-allows-dylibs": true,
"crt-static-respected": true,
"data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64",
"dll-prefix": "",
"dll-suffix": ".spv.json",
Expand All @@ -19,7 +20,6 @@
"std": null,
"tier": null
},
"os": "unknown",
"panic-strategy": "abort",
"simd-types-indirect": false,
"target-pointer-width": "32"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"arch": "spirv",
"crt-objects-fallback": "false",
"crt-static-allows-dylibs": true,
"crt-static-respected": true,
"data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64",
"dll-prefix": "",
"dll-suffix": ".spv.json",
Expand All @@ -19,7 +20,6 @@
"std": null,
"tier": null
},
"os": "unknown",
"panic-strategy": "abort",
"simd-types-indirect": false,
"target-pointer-width": "32"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"arch": "spirv",
"crt-objects-fallback": "false",
"crt-static-allows-dylibs": true,
"crt-static-respected": true,
"data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64",
"dll-prefix": "",
"dll-suffix": ".spv.json",
Expand All @@ -19,7 +20,6 @@
"std": null,
"tier": null
},
"os": "unknown",
"panic-strategy": "abort",
"simd-types-indirect": false,
"target-pointer-width": "32"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"arch": "spirv",
"crt-objects-fallback": "false",
"crt-static-allows-dylibs": true,
"crt-static-respected": true,
"data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64",
"dll-prefix": "",
"dll-suffix": ".spv.json",
Expand All @@ -19,7 +20,6 @@
"std": null,
"tier": null
},
"os": "unknown",
"panic-strategy": "abort",
"simd-types-indirect": false,
"target-pointer-width": "32"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"arch": "spirv",
"crt-objects-fallback": "false",
"crt-static-allows-dylibs": true,
"crt-static-respected": true,
"data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64",
"dll-prefix": "",
"dll-suffix": ".spv.json",
Expand All @@ -19,7 +20,6 @@
"std": null,
"tier": null
},
"os": "unknown",
"panic-strategy": "abort",
"simd-types-indirect": false,
"target-pointer-width": "32"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"arch": "spirv",
"crt-objects-fallback": "false",
"crt-static-allows-dylibs": true,
"crt-static-respected": true,
"data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64",
"dll-prefix": "",
"dll-suffix": ".spv.json",
Expand All @@ -19,7 +20,6 @@
"std": null,
"tier": null
},
"os": "unknown",
"panic-strategy": "abort",
"simd-types-indirect": false,
"target-pointer-width": "32"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"arch": "spirv",
"crt-objects-fallback": "false",
"crt-static-allows-dylibs": true,
"crt-static-respected": true,
"data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64",
"dll-prefix": "",
"dll-suffix": ".spv.json",
Expand All @@ -19,7 +20,6 @@
"std": null,
"tier": null
},
"os": "unknown",
"panic-strategy": "abort",
"simd-types-indirect": false,
"target-pointer-width": "32"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"arch": "spirv",
"crt-objects-fallback": "false",
"crt-static-allows-dylibs": true,
"crt-static-respected": true,
"data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64",
"dll-prefix": "",
"dll-suffix": ".spv.json",
Expand All @@ -19,7 +20,6 @@
"std": null,
"tier": null
},
"os": "unknown",
"panic-strategy": "abort",
"simd-types-indirect": false,
"target-pointer-width": "32"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"arch": "spirv",
"crt-objects-fallback": "false",
"crt-static-allows-dylibs": true,
"crt-static-respected": true,
"data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64",
"dll-prefix": "",
"dll-suffix": ".spv.json",
Expand All @@ -19,7 +20,6 @@
"std": null,
"tier": null
},
"os": "unknown",
"panic-strategy": "abort",
"simd-types-indirect": false,
"target-pointer-width": "32"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"arch": "spirv",
"crt-objects-fallback": "false",
"crt-static-allows-dylibs": true,
"crt-static-respected": true,
"data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64",
"dll-prefix": "",
"dll-suffix": ".spv.json",
Expand All @@ -19,7 +20,6 @@
"std": null,
"tier": null
},
"os": "unknown",
"panic-strategy": "abort",
"simd-types-indirect": false,
"target-pointer-width": "32"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"arch": "spirv",
"crt-objects-fallback": "false",
"crt-static-allows-dylibs": true,
"crt-static-respected": true,
"data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64",
"dll-prefix": "",
"dll-suffix": ".spv.json",
Expand All @@ -19,7 +20,6 @@
"std": null,
"tier": null
},
"os": "unknown",
"panic-strategy": "abort",
"simd-types-indirect": false,
"target-pointer-width": "32"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"arch": "spirv",
"crt-objects-fallback": "false",
"crt-static-allows-dylibs": true,
"crt-static-respected": true,
"data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64",
"dll-prefix": "",
"dll-suffix": ".spv.json",
Expand All @@ -19,7 +20,6 @@
"std": null,
"tier": null
},
"os": "unknown",
"panic-strategy": "abort",
"simd-types-indirect": false,
"target-pointer-width": "32"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"arch": "spirv",
"crt-objects-fallback": "false",
"crt-static-allows-dylibs": true,
"crt-static-respected": true,
"data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64",
"dll-prefix": "",
"dll-suffix": ".spv.json",
Expand All @@ -19,7 +20,6 @@
"std": null,
"tier": null
},
"os": "unknown",
"panic-strategy": "abort",
"simd-types-indirect": false,
"target-pointer-width": "32"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"arch": "spirv",
"crt-objects-fallback": "false",
"crt-static-allows-dylibs": true,
"crt-static-respected": true,
"data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64",
"dll-prefix": "",
"dll-suffix": ".spv.json",
Expand All @@ -19,7 +20,6 @@
"std": null,
"tier": null
},
"os": "unknown",
"panic-strategy": "abort",
"simd-types-indirect": false,
"target-pointer-width": "32"
Expand Down
57 changes: 52 additions & 5 deletions crates/rustc_codegen_spirv/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ use std::{env, fs, mem};
/// `cargo publish`. We need to figure out a way to do this properly, but let's hardcode it for now :/
//const REQUIRED_RUST_TOOLCHAIN: &str = include_str!("../../rust-toolchain.toml");
const REQUIRED_RUST_TOOLCHAIN: &str = r#"[toolchain]
channel = "nightly-2024-11-22"
channel = "nightly-2025-05-09"
components = ["rust-src", "rustc-dev", "llvm-tools"]
# commit_hash = b19329a37cedf2027517ae22c87cf201f93d776e"#;
# commit_hash = 50aa04180709189a03dde5fd1c05751b2625ed37"#;

fn rustc_output(arg: &str) -> Result<String, Box<dyn Error>> {
let rustc = env::var("RUSTC").unwrap_or_else(|_| "rustc".into());
Expand Down Expand Up @@ -159,9 +159,9 @@ fn generate_pqp_cg_ssa() -> Result<(), Box<dyn Error>> {
}
}

// HACK(eddyb) remove `windows` dependency (from MSVC linker output
// parsing, which `rustc_codegen_spirv` will never invoke anyway).
if relative_path == Path::new("src/back/link.rs") {
// HACK(eddyb) remove `windows` dependency (from MSVC linker output
// parsing, which `rustc_codegen_spirv` will never invoke anyway).
src = src.replace(
"#[cfg(not(windows))]
fn escape_linker_output(",
Expand All @@ -179,6 +179,36 @@ mod win {",
"#[cfg(any())]
mod win {",
);
// HACK(eddyb) remove `object` dependency (for Windows `raw_dylib`
// handling, which `rustc_codegen_spirv` will never invoke anyway).
src = src.replace("mod raw_dylib;", "// mod raw_dylib;");
src = src.replace(
"
for output_path in raw_dylib::",
"
#[cfg(any())]
for output_path in raw_dylib::",
);
src = src.replace(
"
for link_path in raw_dylib::",
"
#[cfg(any())]
for link_path in raw_dylib::",
);
}
if relative_path == Path::new("src/back/metadata.rs") {
// HACK(eddyb) remove `object` dependency.
src = src.replace(
"
pub(crate) fn create_object_file(sess: &Session) -> Option<write::Object<'static>> {",
"
pub(crate) fn create_object_file(_: &Session) -> Option<write::Object<'static>> {
None
}
#[cfg(any())]
pub(crate) fn create_object_file(sess: &Session) -> Option<write::Object<'static>> {",
);
}

// HACK(eddyb) "typed alloca" patches.
Expand All @@ -198,8 +228,16 @@ mod win {",
} else if relative_path == Path::new("src/mir/operand.rs") {
src = src.replace("alloca(field.size,", "typed_alloca(llfield_ty,");

// HACK(eddyb) non-array `#[repr(simd)]` workaround (see `src/abi.rs`).
// HACK(eddyb) non-array `#[repr(simd)]` workarounds (see `src/abi.rs`).
src = src.replace("if constant_ty.is_simd() {", "if false {");
src = src.replace(
"match (self.val, self.layout.backend_repr) {",
"match (self.val, self.layout.backend_repr) {
// `#[repr(simd)]` types are also immediate.
(OperandValue::Immediate(llval), BackendRepr::SimdVector { element, .. }) => {
(Some(element), bx.extract_element(llval, bx.cx().const_usize(i as u64)))
}",
);
}

fs::write(out_path, src)?;
Expand Down Expand Up @@ -259,6 +297,9 @@ mod win {",
println!("cargo::warning={line}");
}
println!("cargo::warning=");

// HACK(eddyb) allow the warning to be cleared after `lib.rs` is fixed.
println!("cargo:rerun-if-changed=src/lib.rs");
}

// HACK(eddyb) write a file that can be `include!`d from `lib.rs`.
Expand All @@ -276,6 +317,12 @@ mod maybe_pqp_cg_ssa;

println!("cargo::rustc-check-cfg=cfg(rustc_codegen_spirv_disable_pqp_cg_ssa)");

// HACK(eddyb) `if cfg!(llvm_enzyme)` added upstream for autodiff support.
println!("cargo::rustc-check-cfg=cfg(llvm_enzyme)");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh cool, I didn't know you could put those here.


// HACK(eddyb) `cfg_attr(bootstrap, ...` used upstream temporarily.
println!("cargo::rustc-check-cfg=cfg(bootstrap)");

Ok(())
}

Expand Down
Loading