Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Switching between terminal and Atom with linter-rust causes a clean rebuild #77

Closed
White-Oak opened this issue Sep 14, 2016 · 9 comments
Assignees
Labels

Comments

@White-Oak
Copy link
Member

This causes long rebuilds of a full project.
However, if I remain in one environment (say linter-rust) clean rebuilds do not happen.

This was introduced recently, probably, with my change of how environment is passed to cargo.

I will debug this and try to fix, but I'm curious if I'm the only one who encountered this.
Please upvote this or leave a response if you have experienced such an issue.

@White-Oak White-Oak changed the title Switching between terminal and Atom with linter-rust cause a clean rebuild Switching between terminal and Atom with linter-rust causes a clean rebuild Sep 14, 2016
@White-Oak White-Oak added the bug label Sep 14, 2016
@White-Oak White-Oak self-assigned this Sep 14, 2016
@White-Oak
Copy link
Member Author

White-Oak commented Sep 14, 2016

Okay, so the issue is because RUSTFLAGS differ when calling from linter-rust and terminal.
linter-rust (to get JSON errors) adds --error-format=json to the env variable RUSTFLAGS, but the terminal environment doesn't have it, so cargo forces clean recompile, which is kind of sad.

The current workaround is to add --error-format=json to RUSTFLAGS (before anything if it's not empty). The downside of this is getting no "new errors", but JSON errors in terminal.

I'll think what can be done about this.

@colin-kiegel
Copy link
Contributor

is this reported upstream?

@White-Oak
Copy link
Member Author

@colin-kiegel I'm pretty sure it's not. If you don't mind I'll report it a bit later.

@White-Oak
Copy link
Member Author

Blocked by this: rust-lang/cargo#2982

@White-Oak
Copy link
Member Author

The blocking PR was merged, so it soon wiil hit nightly, and I'll add a check to fix this bug at least on nightly

@White-Oak
Copy link
Member Author

This has been landed in 0.7.0 version of linter-rust just fyi.

@Razican
Copy link

Razican commented Nov 10, 2016

Is this working on stable? Cargo added --message-format in stable in 1.13, but I don't seem to be using it correctly: linting in Atom and running cargo build on terminal makes it to compile again.

Is it because linter-rust uses RUSTFLAGS instead of cargo --message-format?

@White-Oak
Copy link
Member Author

@Razican well, something went a bit unexpected, and --message-format was released ahead of time. See rust-lang/cargo#3282

@White-Oak
Copy link
Member Author

Well, looks like it was supposed to! I'll add a couple of checks to ensure it works on stable

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants