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

fix: proc-macro example from dep no longer affects feature resolution #13892

Merged
merged 3 commits into from
Jun 10, 2024

Conversation

weihanglo
Copy link
Member

@weihanglo weihanglo commented May 9, 2024

What does this PR try to resolve?

Previously when checking if a dependency is a proc-macro,
the v2 feature resolver for proc-macro = true
for every target of the dependency.
However, it's impossible to depend on a non-lib target as a proc-macro.

This fix switches to only check if proc-macro = true for [lib]
target for a dependency.

Fixes #13726.

How should we test and review this PR?

Best reviewed commit-by-commit.

Additional information

I didn't really fix the discrepancy between the behavior of example lib and the documentation, which was mentioned in #13726 (comment).

Thanks @torhovland for the minimal test case.

@rustbot
Copy link
Collaborator

rustbot commented May 9, 2024

r? @epage

rustbot has assigned @epage.
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 A-dependency-resolution Area: dependency resolution and the resolver A-features2 Area: issues specifically related to the v2 feature resolver S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 9, 2024
@weihanglo weihanglo added the A-proc-macro Area: compiling proc-macros label May 9, 2024
Previously when checking if a dependency is a proc-macro,
the v2 feature resolve resolver v2 looks for `proc-macro = true`
for every target of the dependency.
However, it's impossible to depend on a non-lib target as a proc-macro.

This fix switches to only check if `proc-macro = true` for `[lib]`
target for a dependency.
@epage
Copy link
Contributor

epage commented Jun 10, 2024

@bors r+

@bors
Copy link
Collaborator

bors commented Jun 10, 2024

📌 Commit 0ead10e has been approved by epage

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 Jun 10, 2024
@bors
Copy link
Collaborator

bors commented Jun 10, 2024

⌛ Testing commit 0ead10e with merge cc34b84...

@bors
Copy link
Collaborator

bors commented Jun 10, 2024

☀️ Test successful - checks-actions
Approved by: epage
Pushing cc34b84 to master...

@bors bors merged commit cc34b84 into rust-lang:master Jun 10, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-dependency-resolution Area: dependency resolution and the resolver A-features2 Area: issues specifically related to the v2 feature resolver A-proc-macro Area: compiling proc-macros S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic on use of libraries with proc-macro examples
4 participants