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 unit_for computation on proc-macros in shared workspace. #9059

Merged
merged 1 commit into from
Jan 11, 2021

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Jan 9, 2021

There was a bug where the UnitFor was not being computed properly for proc-macros in a workspace with shared dependencies, integration tests, and a mixture of various flags (--workspace --all-targets --all-features). The issue is that this line, which is used when attaching the implicit dependency from an integration test to its library, was using the wrong unit_for value (it was not checking if the implicit lib is a proc-macro). The consequence is that the graph could be built inconsistently, causing features to be randomly selected incorrectly if the integration test happened to be the first unit processed.

The solution here is to use a common function for transitioning the unit_for value. The with_for_host/with_host_features split was mostly a consequence of how things evolved over time, and keeping them separate wasn't really necessary.

@rust-highfive
Copy link

r? @Eh2406

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 9, 2021
@Eh2406
Copy link
Contributor

Eh2406 commented Jan 10, 2021

The explanation makes sense, the code passes tests, and the code looks good. But I will let Alex look it over as I do not have a good understanding of the context.
@bors r? @alexcrichton

@rust-highfive rust-highfive assigned alexcrichton and unassigned Eh2406 Jan 10, 2021
@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Collaborator

bors commented Jan 11, 2021

📌 Commit a846898 has been approved by alexcrichton

@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 Jan 11, 2021
@bors
Copy link
Collaborator

bors commented Jan 11, 2021

⌛ Testing commit a846898 with merge 89dcb2a...

@bors
Copy link
Collaborator

bors commented Jan 11, 2021

☀️ Test successful - checks-actions
Approved by: alexcrichton
Pushing 89dcb2a to master...

@bors bors merged commit 89dcb2a into rust-lang:master Jan 11, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 15, 2021
Update cargo

10 commits in 329895f5b52a358e5d9ecb26215708b5cb31d906..a73e5b7d567c3036b296fc6b33ed52c5edcd882e
2021-01-06 00:01:52 +0000 to 2021-01-12 23:45:39 +0000
- Sort available binaries when multiple (rust-lang/cargo#9066)
- Fix misspelling of environment variable (rust-lang/cargo#9067)
- Remove statement that opt-level 0 turns on debug (rust-lang/cargo#9070)
- Fix `links` vars showing up for testing packages (rust-lang/cargo#9065)
- Fix unit_for computation on proc-macros in shared workspace. (rust-lang/cargo#9059)
- Document `could not find the github team` error on `cargo owner --add` (rust-lang/cargo#9000)
- Unstable section of cargo/config.toml takes bools (rust-lang/cargo#9057)
- [doc] add note about empty environment variables for missing manifest keys (rust-lang/cargo#9053)
- another round of clippy lint fixes (rust-lang/cargo#9051)
- Updated display message of cargo metadata --help (rust-lang/cargo#9050)
@ehuss ehuss added this to the 1.51.0 milestone Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

5 participants