You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tons of unexpected_cfgs failures in portable-simd and backtrace doctests #124740
These files are from portable-simd, which means they are sometimes their own crate and sometimes a module imported into core. There is indeed no as_crate feature in core, so no idea how these tests are passing in our CI.
Do we inject a -A unexpected_cfgs somewhere for doctests, or something like that?
changed the title [-]Tons of `unexpected_cfgs` failures in std doctests[/-][+]Tons of `unexpected_cfgs` failures in portable-simd doctests[/+]on May 5, 2024
changed the title [-]Tons of `unexpected_cfgs` failures in portable-simd doctests[/-][+]Tons of `unexpected_cfgs` failures in portable-simd and backtrace doctests[/+]on May 5, 2024
Another thing we could do now that check-cfg is stable, is adding this exception directly in the build.rs of core, alloc and std with the Cargo instruction cargo::rustc-check-cfg.
In fact I can see them in the latest CI run under the "Setup environment". If you want to completely silence them, allowing the lint (-Aunexpected_cfgs in RUSTFLAGS) is probably (in the short term) the best course of action.
Actually, those warnings come from the sysroot build, not the local test build. So this will need a patch in https://github.com/RalfJung/rustc-build-sysroot/ . Also, -Aunexpected_cfgs does not help for the doctests, for some reason.
(FWIW, debugging rustc invocations became a lot harder when they all grew to more than twice their size due to all these --check-cfg flags. If there's any way to hide these flags e.g. in argument files or so, that would be great...)
@RalfJung We did add the corresponding --check-cfg args to std, alloc and core in #125296
(FWIW, debugging rustc invocations became a lot harder when they all grew to more than twice their size due to all these --check-cfg flags. If there's any way to hide these flags e.g. in argument files or so, that would be great...)
Activity
RalfJung commentedon May 5, 2024
These files are from portable-simd, which means they are sometimes their own crate and sometimes a module imported into
core. There is indeed noas_cratefeature incore, so no idea how these tests are passing in our CI.Do we inject a
-A unexpected_cfgssomewhere for doctests, or something like that?[-]Tons of `unexpected_cfgs` failures in std doctests[/-][+]Tons of `unexpected_cfgs` failures in portable-simd doctests[/+][-]Tons of `unexpected_cfgs` failures in portable-simd doctests[/-][+]Tons of `unexpected_cfgs` failures in portable-simd and backtrace doctests[/+]RalfJung commentedon May 5, 2024
There's also one in std, from the backtrace module, which similarly is also sometimes a crate and sometimes a module:
workingjubilee commentedon May 5, 2024
Huh.
Kobzol commentedon May 5, 2024
It's quite possible that this is caused by the CI mess. One of the insta-merged PRs was a miri sync.
RalfJung commentedon May 5, 2024
It's possible but seems unlikely to me. I guess we'll have to see.
Urgau commentedon May 5, 2024
Yes, there is,
rust/src/bootstrap/src/core/builder.rs
Lines 1545 to 1555 in 69ffc0d
I would suggest doing the same and adding as part of the build
--check-cfg=cfg(feature,values(any())), possibly inRUSTFLAGSor somewhere else.RalfJung commentedon May 5, 2024
That seems to help, thanks. :)
Urgau commentedon May 5, 2024
Another thing we could do now that
check-cfgis stable, is adding this exception directly in thebuild.rsofcore,allocandstdwith the Cargo instructioncargo::rustc-check-cfg.RalfJung commentedon May 5, 2024
If you end up doing that, please ping me so I can revert rust-lang/miri-test-libstd#66.
Urgau commentedon May 5, 2024
@RalfJung I don't think allowing all values for the
featurecfg is going to be enough. There are many other custom cfgs used incore/alloc/std,rust/src/bootstrap/src/lib.rs
Lines 87 to 97 in 69ffc0d
In fact I can see them in the latest CI run under the "Setup environment". If you want to completely silence them, allowing the lint (
-Aunexpected_cfgsinRUSTFLAGS) is probably (in the short term) the best course of action.RalfJung commentedon May 5, 2024
This was enough though to make the tests pass again... 🤷
RalfJung commentedon May 5, 2024
Oh, they are shown as warning, not hard errors.
Sure, I can also allow the lint entirely.
RalfJung commentedon May 5, 2024
Actually, those warnings come from the sysroot build, not the local test build. So this will need a patch in https://github.com/RalfJung/rustc-build-sysroot/ . Also,
-Aunexpected_cfgsdoes not help for the doctests, for some reason.(FWIW, debugging rustc invocations became a lot harder when they all grew to more than twice their size due to all these
--check-cfgflags. If there's any way to hide these flags e.g. in argument files or so, that would be great...)Urgau commentedon May 22, 2024
@RalfJung We did add the corresponding
--check-cfgargs tostd,allocandcorein #125296We are tracking this in rust-lang/cargo#13941
RalfJung commentedon May 23, 2024
Awesome, that seems to be enough for miri-test-libstd as well. :)