2

Do not unconditionally succeed RUSTC_WRAPPER checks when run by build scripts by...

 2 years ago
source link: https://github.com/rust-lang/rust-analyzer/pull/13010
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Conversation

Member

@Veykril Veykril commented 7 days ago

rust-analyzer's RUSTC_WRAPPER unconditionally succeeds cargo check
invocations tripping up build scripts using cargo check to probe for
successful compilations. To prevent this from happening the RUSTC_WRAPPER
now checks if it's run from a build script by looking for the
CARGO_CFG_TARGET_ARCH env var that cargo sets only when running build
scripts.

miraclx reacted with thumbs up emoji All reactions

Contributor

eminence commented 7 days ago

I tested this on two workspaces that exhibit the problem reported with anyhow, and in both cases the issue is fixed (and no obvious regressions)

Member

Author

Veykril commented 7 days ago

edited

Thank you for testing! There shouldn't be any regressions caused due to this (unless cargo sets this env var in other occasions which it shouldn't)
@bors r+

Collaborator

bors commented 7 days ago

pushpin Commit 72ae308 has been approved by Veykril

It is now in the queue for this repository.

Collaborator

bors commented 7 days ago

hourglass Testing commit 72ae308 with merge 5941dec...

Collaborator

bors commented 6 days ago

sunny Test successful - checks-actions
Approved by: Veykril
Pushing 5941dec to master...

bors

merged commit 5941dec into

rust-lang:master

6 days ago

9 checks passed

Veykril

deleted the build-script-probes branch

6 days ago

sdroege commented 3 days ago

This seems to cause unnecessary rebuilds, it seems. Some crate that depends on anyhow here will always rebuild anyhow and some other crates every time I run cargo build after saving in vim/coc-rust-analyzer. That wasn't the case before.

Member

Author

Veykril commented 3 days ago

this is only invoked on startup for rust-analyzer, so this cannot have changed the behavior for when you save

sdroege commented 3 days ago

Hrm, then something else must've changed between this and last Monday's release. Sorry for the noise here then.

Member

Author

Veykril commented 3 days ago

The only recent relevant change I could think of is #12808, but that is 2 releases ago, not one

This seems to cause unnecessary rebuilds, it seems. Some crate that depends on anyhow here will always rebuild anyhow and some other crates every time I run cargo build after saving in vim/coc-rust-analyzer. That wasn't the case before.

You might be hitting this issue.

sdroege commented 3 days ago

Thanks, that seems to have fixed this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels
None yet
Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

None yet

5 participants

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK