Skip to content

Make target pointer width in target json an integer #144443

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 4 commits into
base: master
Choose a base branch
from

Conversation

WaffleLapkin
Copy link
Member

@rustbot
Copy link
Collaborator

rustbot commented Jul 25, 2025

Noratrieb is not on the review rotation at the moment.
They may take a while to respond.

@rustbot rustbot added A-compiletest Area: The compiletest test runner A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 25, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 25, 2025

This PR modifies run-make tests.

cc @jieyouxu

These commits modify compiler targets.
(See the Target Tier Policy.)

Some changes occurred in src/tools/compiletest

cc @jieyouxu

Copy link
Member

@Noratrieb Noratrieb left a comment

Choose a reason for hiding this comment

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

I'm unsure if it's worth breaking everyone over such a minor improvement.. maybe? maybe not?

@rust-log-analyzer

This comment has been minimized.

@Noratrieb
Copy link
Member

Noratrieb commented Jul 25, 2025

I'm inclined to say yes, but it would probably be good to get this merged today so it can be in the same nightly as the other breaking change instead of two consecutive nightlies (it would also be fine to do that, but less cool)

@RalfJung
Copy link
Member

I'm unsure if it's worth breaking everyone over such a minor improvement.. maybe? maybe not?

We already did that with #144443... the current state is just inconsistent.

But, no strong opinion.

@WaffleLapkin WaffleLapkin force-pushed the integer-target-pointer-width branch from bb5b5c5 to 283f21b Compare July 25, 2025 11:55
@WaffleLapkin
Copy link
Member Author

@Noratrieb what's the other breaking change? #142352 has been merged for over a month..

@rust-log-analyzer

This comment has been minimized.

@WaffleLapkin WaffleLapkin force-pushed the integer-target-pointer-width branch from 283f21b to 267f0bd Compare July 25, 2025 12:35
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@RalfJung
Copy link
Member

RalfJung commented Jul 25, 2025

@Noratrieb what's the other breaking change? #142352 has been merged for over a month..

Uh, but then why did Miri CI only start failing today?

Something changed in 9748d87...b56aaec.

@WaffleLapkin WaffleLapkin force-pushed the integer-target-pointer-width branch from b64ab4a to b2871e5 Compare July 25, 2025 13:33
@RalfJung
Copy link
Member

RalfJung commented Jul 25, 2025

The breaking change was probably #144218.

@WaffleLapkin
Copy link
Member Author

The only relevant change I see is #144218, but that doesn't explain anything, it should have been failing with #142352, I don't see how it could have accepted c-int-width being a string...

@RalfJung
Copy link
Member

It might be that the field of wrong type just got ignored, which is exactly why Nora ported this to serde.

@WaffleLapkin
Copy link
Member Author

You are right indeed. The code in #142352:

                if let Some(s) = obj.remove(name).and_then(|b| b.as_u64()) {
                    base.$key_name = s as $int_ty;
                }

and_then(|b| b.as_u64()) makes it so non-integers are ignored.

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Jul 31, 2025

☔ The latest upstream changes (presumably #144740) made this pull request unmergeable. Please resolve the merge conflicts.

@WaffleLapkin WaffleLapkin force-pushed the integer-target-pointer-width branch from 2ba8695 to ffe4f0c Compare July 31, 2025 21:19
@WaffleLapkin
Copy link
Member Author

@Noratrieb I think this is ready for review :3

@Noratrieb
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 1, 2025

📌 Commit ffe4f0c has been approved by Noratrieb

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 1, 2025
Zalathar added a commit to Zalathar/rust that referenced this pull request Aug 3, 2025
…r-width, r=Noratrieb

Make target pointer width in target json an integer

r? Noratrieb
cc `@RalfJung` (https://github.com/rust-lang/rust/pull/142352/files#r2230380120)
bors added a commit that referenced this pull request Aug 3, 2025
Rollup of 14 pull requests

Successful merges:

 - #143857 (Port #[macro_export] to the new attribute parsing infrastructure)
 - #143900 ([rustdoc] Correctly handle `should_panic` doctest attribute and fix `--no-run` test flag on the 2024 edition)
 - #144070 (Implement `hash_map` macro )
 - #144322 (Add lint against dangling pointers from local variables)
 - #144443 (Make target pointer width in target json an integer)
 - #144667 (`AlignmentEnum` should just be `repr(usize)` now)
 - #144779 (Implement debugging output of the bootstrap Step graph into a DOT file)
 - #144790 (Multiple bounds checking elision failures)
 - #144794 (Port `#[coroutine]` to the new attribute system)
 - #144808 (`Interner` arg to `EarlyBinder` does not affect auto traits)
 - #144816 (Update E0562 to account for the new impl trait positions)
 - #144822 (Return a struct with named fields from `hash_owner_nodes`)
 - #144824 (Updated test links in compiler)
 - #144829 (Use full flag name in strip command for Darwin)

r? `@ghost`
`@rustbot` modify labels: rollup
Zalathar added a commit to Zalathar/rust that referenced this pull request Aug 3, 2025
…r-width, r=Noratrieb

Make target pointer width in target json an integer

r? Noratrieb
cc ``@RalfJung`` (https://github.com/rust-lang/rust/pull/142352/files#r2230380120)
bors added a commit that referenced this pull request Aug 3, 2025
Rollup of 13 pull requests

Successful merges:

 - #143857 (Port #[macro_export] to the new attribute parsing infrastructure)
 - #143900 ([rustdoc] Correctly handle `should_panic` doctest attribute and fix `--no-run` test flag on the 2024 edition)
 - #144070 (Implement `hash_map` macro )
 - #144322 (Add lint against dangling pointers from local variables)
 - #144443 (Make target pointer width in target json an integer)
 - #144667 (`AlignmentEnum` should just be `repr(usize)` now)
 - #144790 (Multiple bounds checking elision failures)
 - #144794 (Port `#[coroutine]` to the new attribute system)
 - #144808 (`Interner` arg to `EarlyBinder` does not affect auto traits)
 - #144816 (Update E0562 to account for the new impl trait positions)
 - #144822 (Return a struct with named fields from `hash_owner_nodes`)
 - #144824 (Updated test links in compiler)
 - #144829 (Use full flag name in strip command for Darwin)

r? `@ghost`
`@rustbot` modify labels: rollup
@Zalathar
Copy link
Contributor

Zalathar commented Aug 3, 2025

Failed in rollup: #144845 (comment)

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 3, 2025
@Zalathar
Copy link
Contributor

Zalathar commented Aug 3, 2025

@bors try jobs=x86_64-gnu-llvm-19-3

rust-bors bot added a commit that referenced this pull request Aug 3, 2025
…<try>

Make target pointer width in target json an integer

try-job: x86_64-gnu-llvm-19-3
@rust-bors
Copy link

rust-bors bot commented Aug 3, 2025

⌛ Trying commit ffe4f0c with merge c576725

To cancel the try build, run the command @bors try cancel.

@Zalathar
Copy link
Contributor

Zalathar commented Aug 3, 2025

I'm unsure if it's worth breaking everyone over such a minor improvement.. maybe? maybe not?

Well if nothing else we found a bunch of bootstrap/compiletest staging bugs. 😿

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-19-3 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[TIMING] core::build_steps::test::RemoteCopyLibs { compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: x86_64-unknown-linux-gnu } -- 0.000
##[group]Testing stage0 compiletest suite=ui-fulldeps mode=ui (x86_64-unknown-linux-gnu)

thread 'main' panicked at src/tools/compiletest/src/common.rs:924:10:
called `Result::unwrap()` on an `Err` value: Error("invalid type: string \"64\", expected u32", line: 60, column: 32)
stack backtrace:
   0: __rustc::rust_begin_unwind
             at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/std/src/panicking.rs:697:5
   1: core::panicking::panic_fmt
             at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/core/src/panicking.rs:75:14
   2: core::result::unwrap_failed
             at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/core/src/result.rs:1761:5
   3: <compiletest::common::TargetCfgs>::new
   4: <std::sync::poison::once::Once>::call_once_force::<<std::sync::once_lock::OnceLock<compiletest::common::TargetCfgs>>::initialize<<std::sync::once_lock::OnceLock<compiletest::common::TargetCfgs>>::get_or_init<<compiletest::common::Config>::target_cfgs::{closure#0}>::{closure#0}, !>::{closure#0}>::{closure#0}
   5: std::sys::sync::once::futex::Once::call
             at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/std/src/sys/sync/once/futex.rs:176:21
   6: <std::sync::once_lock::OnceLock<compiletest::common::TargetCfgs>>::initialize::<<std::sync::once_lock::OnceLock<compiletest::common::TargetCfgs>>::get_or_init<<compiletest::common::Config>::target_cfgs::{closure#0}>::{closure#0}, !>
   7: <compiletest::directives::needs::CachedNeedsConditions>::load
   8: compiletest::run_tests
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Build completed unsuccessfully in 0:29:48
  local time: Sun Aug  3 05:22:22 UTC 2025
  network time: Sun, 03 Aug 2025 05:22:22 GMT

@rust-bors
Copy link

rust-bors bot commented Aug 3, 2025

💔 Test failed (CI). Failed jobs:

Zalathar added a commit to Zalathar/rust that referenced this pull request Aug 4, 2025
For "stage 1" ui-fulldeps, use the stage 1 compiler to query target info

Testing ui-fulldeps in "stage 1" actually uses the stage 0 compiler, so that test programs can link against stage 1 rustc crates.

Unfortunately, using the stage 0 compiler causes problems when compiletest tries to obtain target information from the compiler, but the output format has changed since the last bootstrap beta bump.

We can work around this by also providing compiletest with a stage 1 compiler, and having it use that compiler to query for target information.

---

This fixes the stage 1 ui-fulldeps failure seen at rust-lang#144443 (comment).
rust-timer added a commit that referenced this pull request Aug 4, 2025
Rollup merge of #144848 - Zalathar:ui-fulldeps, r=clubby789

For "stage 1" ui-fulldeps, use the stage 1 compiler to query target info

Testing ui-fulldeps in "stage 1" actually uses the stage 0 compiler, so that test programs can link against stage 1 rustc crates.

Unfortunately, using the stage 0 compiler causes problems when compiletest tries to obtain target information from the compiler, but the output format has changed since the last bootstrap beta bump.

We can work around this by also providing compiletest with a stage 1 compiler, and having it use that compiler to query for target information.

---

This fixes the stage 1 ui-fulldeps failure seen at #144443 (comment).
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Aug 4, 2025
For "stage 1" ui-fulldeps, use the stage 1 compiler to query target info

Testing ui-fulldeps in "stage 1" actually uses the stage 0 compiler, so that test programs can link against stage 1 rustc crates.

Unfortunately, using the stage 0 compiler causes problems when compiletest tries to obtain target information from the compiler, but the output format has changed since the last bootstrap beta bump.

We can work around this by also providing compiletest with a stage 1 compiler, and having it use that compiler to query for target information.

---

This fixes the stage 1 ui-fulldeps failure seen at rust-lang/rust#144443 (comment).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: The compiletest test runner A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants