-
Notifications
You must be signed in to change notification settings - Fork 2.6k
check for CARGO_INCREMENTAL
and pass -Zincremental
if present
#3527
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
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
@@ -843,6 +850,14 @@ impl<'a, 'cfg> Context<'a, 'cfg> { | |||
self.lib_profile() | |||
} | |||
|
|||
pub fn incremental_args(&self, _unit: &Unit) -> CargoResult<Vec<String>> { | |||
if self.incremental_enabled { | |||
Ok(vec![format!("-Zincremental={}", self.host.incremental().display())]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think here we may not want to always use self.host
, but rather perhaps:
self.layout(unit.kind).incremental()
assert_that( | ||
p.cargo_process("build").arg("-v").env("CARGO_INCREMENTAL", "1"), | ||
execs().with_stderr_contains( | ||
" Running `rustc [..] -Zincremental=[..]/target/debug/incremental`\n")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll want to change /
here I think to [/]
to handle Windows where it's \
instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also change Running
to just [RUNNING]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(without the leading spaces)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh and lastly, can you add with_status(0)
to ensure a successful execution?
@alexcrichton changes made |
LGTM! |
@bors: r+ |
📌 Commit 30e91b5 has been approved by |
⌛ Testing commit 30e91b5 with merge b38ac29... |
💔 Test failed - status-appveyor |
… On Wed, Jan 11, 2017 at 4:36 PM, bors ***@***.***> wrote:
💔 Test failed - status-appveyor
<https://ci.appveyor.com/project/rust-lang-libs/cargo/build/1.0.859>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3527 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAD95H1FotFW2lTgUVFT1eWSI46uZRwJks5rRXWMgaJpZM4Lgx6d>
.
|
check for `CARGO_INCREMENTAL` and pass `-Zincremental` if present Per the discussion on IRC, this adds a very simple way for cargo users to opt into incremental compilation by setting the `CARGO_INCREMENTAL` environment variable (i.e., `CARGO_INCREMENTAL=1 cargo build`). This will result in incremental data being stored into the `target/incremental` directory. Since it supplies `-Z`, this option is only intended for use on nightly compilers, though cargo makes no effort to check. The plan is to keep incremental compilation optional until we are feeling more confident it's not going to cause problems for people. At that point, it should become part of the compilation profile. It will be the default when building in debug builds, and opt-in for release builds.
☀️ Test successful - status-appveyor, status-travis |
Per the discussion on IRC, this adds a very simple way for cargo users to opt into incremental compilation by setting the
CARGO_INCREMENTAL
environment variable (i.e.,CARGO_INCREMENTAL=1 cargo build
). This will result in incremental data being stored into thetarget/incremental
directory. Since it supplies-Z
, this option is only intended for use on nightly compilers, though cargo makes no effort to check.The plan is to keep incremental compilation optional until we are feeling more confident it's not going to cause problems for people. At that point, it should become part of the compilation profile. It will be the default when building in debug builds, and opt-in for release builds.