sccache/docs
Jonathan Schwender edf0ac5176
Parse env-deps from dep-info (#1107)
* Refactor sccache cargo test

- Improve cleanup by using Result instead of panicking, to ensure that
the temporary folder gets cleaned up.
Previously, when a test failed, no clean up would happen. Now the cleanup
happens, unless there is an unexpected panic somewhere in  the intergration test code.

- this commit aims to make it easier to add new tests

Split sccache cargo tests

To make it clearer what is failing, split the cargo test into multiple
tests. Since Sccache can't be invoked in parallel, we use the
`serial_test`  to serialize testing,otherwise cargo by default would
start them in parallel.

The logger is now also lazily initialized, so the first test to run will
initialize it. It now writes a linebreak, because otherwise the output
is hard to read with
`RUST_LOG=debug cargo test --test sccache_cargo -- --nocapture`.

We catch panics (which are not intended by the tests ) to ensure that the
temporary directory for the test gets cleaned up.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>

Remove panic=abort from CI coverage test

I suspect the commandline was just taken like that from the example
here: https://doc.rust-lang.org/stable/unstable-book/compiler-flags/profile.html

However, there seems to be no reason to actually abort, since we don't have
a custom test harness or anything.
Since we want to catch panics, so we can correctly clean up, we need
panic=unwind.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>

* Parse env_deps from dep-info

This will trigger rebuilds if environment variables changed that the rust code
depended on with env!.
On the Rust side this requires at least Rust 1.46, otherwise there will be
no env-dep info in the dep-info file. In that case we cannot detect
the dependency on the env-value, and behaviour is unchanged compared to
the current sccache behaviour.
With recent Rust versions however, we can trigger a rebuild if a variable
that is referenced via env! or option_env! is changed.

Other env variables like `CARGO_*` or `RUSTFLAGS` which may affect
the compilation are not listed in the dep-info file, so they have to
be blanket added (as is currently already the case).

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>

* Add test for cargo env_deps

The previous commit added support for parsing "env_dep"
information from dep_info files. This commit adds a test
for changing an environment variable, that is referenced
in rust code via env!, and asserts that sccache rebuilds
and the rust code uses the new value of the changed
environment variable.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2022-03-01 16:21:36 -05:00
..
Configuration.md Fix Config tests and docs 2022-02-13 12:41:11 +01:00
Distributed.md typos: OSX -> macOS 2019-10-16 14:38:01 -07:00
DistributedQuickstart.md Update documentation for the new config file path on macOS. 2021-01-06 09:18:53 +09:00
Jenkins.md Fix typo in Jenkins.md 2018-04-23 18:47:29 -04:00
Releasing.md Update docs/Releasing.md 2021-01-13 06:49:21 +09:00
Rust.md Parse env-deps from dep-info (#1107) 2022-03-01 16:21:36 -05:00