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

Hack around blockers to update toolchain all the way to nightly-2024-11-22 (~1.84). #170

Merged
merged 11 commits into from
Dec 18, 2024
Merged
3 changes: 2 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ compiletest = "run --release -p compiletests --"

[target.'cfg(all())']
rustflags = [
# FIXME(eddyb) update/review these lints.
#
# BEGIN - Embark standard lints v6 for Rust 1.55+
# do not change or add/remove here, but one can add exceptions after this section
# for more info see: <https://github.com/EmbarkStudios/rust-ecosystem/issues/59>
Expand Down Expand Up @@ -47,7 +49,6 @@ rustflags = [
"-Wclippy::match_wild_err_arm",
"-Wclippy::match_wildcard_for_single_variants",
"-Wclippy::mem_forget",
"-Wclippy::mismatched_target_os",
"-Wclippy::missing_enforced_import_renames",
"-Wclippy::mut_mut",
"-Wclippy::mutex_integer",
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,18 @@ jobs:
- name: build example shaders
if: ${{ matrix.target != 'aarch64-linux-android' }}
env:
OUT_DIR: "target/tmp"
PROFILE: release
OUT_DIR: "target/release/ci/out"
run: cargo run -p example-runner-wgpu-builder --release --no-default-features --features "use-installed-tools"

- name: build example shaders dev
if: ${{ matrix.target != 'aarch64-linux-android' && matrix.target != 'x86_64-apple-darwin' }}
- name: build example shaders (dev aka "debug mode")
if: ${{ matrix.target != 'aarch64-linux-android' }}
env:
OUT_DIR: "target/tmp"
# HACK(eddyb) see `[profile.dev]` in `Cargo.toml` for more on why
# `-Zshare-generics=off` is useful (and why it had to be moved here).
RUSTFLAGS: -Zshare-generics=off
PROFILE: debug
OUT_DIR: "target/debug/ci/out"
run: cargo run -p example-runner-wgpu-builder --no-default-features --features "use-installed-tools"

- name: Build WGPU Example for Android
Expand Down Expand Up @@ -155,4 +160,4 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1
- uses: EmbarkStudios/cargo-deny-action@v2
13 changes: 13 additions & 0 deletions .github/workflows/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,16 @@ function version_test() {
# FIXME(eddyb) try to get this working for `spirv-builder`, which has a larger
# dependency graph, with too much imprecision in upstream `Cargo.toml` files.
version_test crates/spirv-std

# 3. Ensure `rustc_codegen_spirv` still compiles with `rustc_codegen_ssa`.

# HACK(eddyb) see `crates/rustc_codegen_spirv/build.rs` for more on `pqp_cg_ssa`
# (a patched copy of `rustc_codegen_ssa`).
echo ::group::rustc_codegen_spirv_disable_pqp_cg_ssa
cargo clippy \
--manifest-path "crates/rustc_codegen_spirv/Cargo.toml" \
--no-default-features \
--features "$FEAT" \
--all-targets \
-- -D warnings --cfg rustc_codegen_spirv_disable_pqp_cg_ssa
echo ::endgroup::
133 changes: 132 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# HACK(eddyb) meant for `[profile.dev]` `rustflags` overrides below, but sadly
# not configurable w/o breaking `Cargo.toml` parsing from non-nightly Cargo.
#
# cargo-features = ["profile-rustflags"]

[workspace]
resolver = "2"
members = [
Expand Down Expand Up @@ -60,3 +65,15 @@ codegen-units = 256
opt-level = 3
incremental = true
codegen-units = 256

# HACK(eddyb) reduce the number of linker exports and/or imports, by avoiding
# inter-CGU linkage, to stay under the 64Ki MSVC limit for `rustc_codegen_spirv`
# when building it in "debug mode" (only relevant to CI for now, realistically),
# i.e. working around this issue: https://github.com/rust-lang/rust/issues/53014.
[profile.dev]
# HACK(eddyb) fewer inter-crate exports/imports (not just inter-CGU), but sadly
# not configurable w/o breaking `Cargo.toml` parsing from non-nightly Cargo
# (moved to `.github/workflows/ci.yaml` as `RUSTFLAGS: -Zshare-generics=off`).
#
# rustflags = ["-Zshare-generics=off"]
codegen-units = 1
10 changes: 9 additions & 1 deletion crates/rustc_codegen_spirv/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ num-traits = { workspace = true, default-features = true }
once_cell = "1"
regex = { version = "1", features = ["perf"] }

# HACK(eddyb) deps of `rustc_codegen_ssa`, for `pqp_cg_ssa` (see `build.rs`),
# that cannot be handled with just `extern crate` pulling out of the sysroot.
object = { version = "0.36.2", default-features = false, features = ["read_core", "elf", "macho", "pe", "xcoff", "unaligned", "archive", "write", "wasm"] }
thorin-dwp = "0.8"

# Normal dependencies.
ar = "0.9.0"
either = "1.8.0"
Expand All @@ -56,7 +61,10 @@ itertools = "0.10.5"
[dev-dependencies]
pipe = "0.4"
pretty_assertions = "1.0"
tempfile = "3.4"

# HACK(eddyb) can't re-introduce deps of `rustc_codegen_ssa`, for `pqp_cg_ssa`
# (see `build.rs`).
# tempfile = "3.4"

# Note that in order to use RA and have access to `rustc_*` crates, you also
# need to set `"rust-analyzer.rustcSource": "discover"` in e.g. VSCode.
Expand Down
Loading