-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Subtle change in how ty fragments get stringified #128992
Comments
Minimal example (playground): macro_rules! test { ($t:ty) => { dbg!(stringify!($t)); } }
macro_rules! via_callback { () => { test!(foo::Bar); } }
fn main() { via_callback!(); } on stable:
on beta and nightly:
|
Thank you very much for that repro, @Nemo157! |
This regressed in #125174 |
Cc @nnethercote from the above |
Things like that aren't surprising. #125174 did change whitespace production in pretty printing output, the diff in the PR identifies quit a few other cases where output changed. These changes are valid.
My initial guess is that somebody has recently written a new proc macro that uses |
The relevant lines in bevy_serde_macros are these two: |
@nnethercote Those lines date to November 25th, 2023, and your PR landed June 11, 2024. While it is technically possible to falsify git histories, I think that the real reason that your PR didn't reveal this in crater is that the "craterbot check" and "craterbot build-and-test" commands are non-identical, and beta crater runs use the build-and-test mode. |
Thanks for the info! I think the proper fix here needs to be on the bevy_serde_macros side, given that it was relying on behaviour that is subject to change. |
Hope it's fine to this as WONTFIX (as per prev. comment) |
- **Add test to collectives pallet** - **Manually edit scheduler weight** ## Investigation The Rust compiler changed how the `stringify!` macro formats paths on [Aug 12th '24](rust-lang/rust#128992 (comment)). I assume that this broke the V1 benchmarking [here](https://github.com/paritytech/polkadot-sdk/blob/7ecf3f757a5d6f622309cea7f788e8a547a5dce8/substrate/frame/benchmarking/src/v1.rs#L1011). We had updated the scheduler pallet to V2 syntax (which is [not affected](https://github.com/paritytech/polkadot-sdk/blob/df99fb9431a579589c1c87832222c9551b5c4f7c/substrate/frame/support/procedural/src/benchmark.rs#L565)) on [Nov 20th '24](paritytech/polkadot-sdk#6292). We did not back-port this since there was no apparent reason for it. The is why it seemingly fixed it self on SDK master but not in the runtimes repo (since that is using V1 scheduler benchmarking). Another indication for this is the fact that it did work on the [whitelist pallet](https://github.com/polkadot-fellows/runtimes/blob/6b85bf6adb427942976648e6d235e0169dfced16/relay/polkadot/src/weights/pallet_whitelist.rs#L85), which is on V2 much longer but used the same [custom pov mode](https://github.com/paritytech/polkadot-sdk/blob/b76e91acc953e682b3ddcfc45ecacaaf26c694a1/substrate/frame/whitelist/src/benchmarking.rs#L68). Adding some sanity checks to prevent this in the future here paritytech/polkadot-sdk#7785 - [ ] Does not require a CHANGELOG entry --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: GitHub Action <action@github.com>
Something in lexing, parsing, or even stringification or pretty-printing is now causing code that previously yielded strings like
"Component1"
to serde, based on the type name, to now emit strings like" Component1"
. This has been extracted from #128899 because many of the regressions there proved to be unrelated to each other, and it was hard to triage out what the "real" problem was. We have and most of them depended on unstable library details, but thebbarker/bevy_serde_macros
case was distinct.See @Nemo157's comment:
Originally posted by @Nemo157 in #128899 (comment)
The text was updated successfully, but these errors were encountered: