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

update rustc_index_macros feature handling #134526

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

onur-ozkan
Copy link
Member

@onur-ozkan onur-ozkan commented Dec 19, 2024

It seems that cargo can't conditionally propagate features if they were enabled by default on the target crate, but disabled with default-features = false in the current/parent crate.

Fixes #118129

It seems that cargo can't conditionally propagate features
when `default-features` is set to `false`.

Signed-off-by: onur-ozkan <[email protected]>
@rustbot
Copy link
Collaborator

rustbot commented Dec 19, 2024

r? @fmease

rustbot has assigned @fmease.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 19, 2024
@jieyouxu
Copy link
Member

That is... weird. I'll take a look tmrw.
r? jieyouxu

@RalfJung
Copy link
Member

It seems that cargo can't conditionally propagate features when default-features is set to false.

What do you mean by this?

@onur-ozkan
Copy link
Member Author

This does not work.

@RalfJung
Copy link
Member

It does seem to work sometimes though? Only particular ./x.py invocations are broken.

@onur-ozkan
Copy link
Member Author

I couldn't see anything that could be related in bootstrap.

@RalfJung
Copy link
Member

Note that if this truly does not work you'll have to also change it here

rustc_index = { path = "../rustc_index", default-features = false }
rustc_macros = { path = "../rustc_macros", optional = true }
rustc_serialize = { path = "../rustc_serialize", optional = true }
rustc_span = { path = "../rustc_span", optional = true }
tracing = "0.1"
# tidy-alphabetical-end
[features]
# tidy-alphabetical-start
default = ["nightly", "randomize"]
# rust-analyzer depends on this crate and we therefore require it to built on a stable toolchain
# without depending on rustc_data_structures, rustc_macros and rustc_serialize
nightly = [
"dep:rustc_data_structures",
"dep:rustc_feature",
"dep:rustc_macros",
"dep:rustc_serialize",
"dep:rustc_span",
"rustc_index/nightly",
]

and in the dozen other places where we do the same thing.

I think the first step would be to reproduce this in a minimal example and file a cargo issue, if this is really the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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.

Bootstrap sometimes fails to build miri because of "nightly" feature confusion
5 participants