You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is considerably less invasive than #667, #517 and #421 - there
is no extra code to bootstrap, and no toolchains have to be plumbed
into the rules.
We had been using a worker to get around sandboxing restrictions, but
as @hlopko pointed out on #667, that turns out not to be necessary -
even normal rules have access to /tmp. Unfortunately it seems that rustc
does not expect the source files to change location, and it will
consistently crash when used in a sandboxed context. So the approach
this PR takes is to disable sandboxing on targets that are being compiled
incrementally. This fixes the compiler crashes, and as a bonus, means
we're not limited to saving the cache in /tmp.
This PR adds a --@rules_rust//:experimental_incremental_base flag to
specify the path where incremental build products are stored - if not
provided, the rules will function as they normally do.
It also requires targets to be tagged "incremental" - any without the
tag will be compiled normally, even if a base folder is provided. Cargo's
behaviour appears to be to only store incremental products for the
product being built (eg, all the dependencies you pull in from crates.io
do not have incremental build products stored), so manual tagging seems
preferable to an "include everything" approach.
0 commit comments