Commit graph

114 commits

Author SHA1 Message Date
Ed Page e4e10f2393 chore: Fix typos
This is a repeat of #11561
2023-09-19 15:28:48 -05:00
Joakim Holm 839069f03f only skip mtime check on $CARGO_HOME/{git,registry}
Closes #12090

Commit

Fix formatting

Fix tests

Fix formatting

Fix formatting

Fix formatting
2023-07-19 12:38:56 +02:00
Weihang Lo 98a73394f1
fix: verify source before recompile
This fixes a regression introduced by #11407,
which Cargo should always verify a source before it recompiles.
2023-02-03 14:17:34 +00:00
Weihang Lo 419a56f617
test: verify source before recompile 2023-02-03 14:17:18 +00:00
Rémy Rakic 6848006cbe update tests for build deps debuginfo optimization 2023-01-31 20:12:52 +00:00
Dinu Blanovschi 0beb5fe93d Simple explanations for why cargo rebuilds crates 2022-12-28 16:27:50 +01:00
Scott Schafer ab18bd40d5 refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
Scott Schafer c239e407e7 add a reason to masquerade_as_nightly_cargo so it is searchable 2022-07-15 21:32:23 -05:00
Scott Schafer cab6d30c1d fix typos found by the typos-cli crate 2022-05-10 16:47:28 -05:00
Yerkebulan Tulibergenov ed579b66e2 add short path name for executables 2022-01-31 10:37:02 -08:00
Yerkebulan Tulibergenov a6c1459f37 fix tests 2022-01-30 23:59:54 -08:00
Vaibhav bef4d79ff2 Print executable name on cargo test --no-run.
Closes #9957

Signed-off-by: Vaibhav <vrongmeal@gmail.com>
2021-10-05 23:47:38 +05:30
bjorn3 8c24820a3d Update test 2021-07-05 18:28:21 +02:00
Eric Huss 28c3bef71a Include the linker in the fingerprint. 2021-07-01 20:33:48 -07:00
Eric Huss 2551535ea9 Track "CARGO" in environment fingerprint. 2021-04-15 13:54:46 -07:00
Gus Wynn 04c8372217 fix test suite 2021-02-21 14:37:42 -08:00
Eric Huss 6f8c7d5a87 Normalize raw string indentation. 2020-09-26 17:59:58 -07:00
Eric Huss f2f12ba6a2 Bump to 0.49.0 2020-08-28 10:17:49 -07:00
Alex Crichton 64a468261a Fix freshness checks for build scripts on renamed dirs
This commit fixes an issue in Cargo where when an entire project
directory is renamed (preserving the target directory) then path
dependencies with build scripts would have their build scripts rereun
when building again. The problem with this was that when a build script
doesn't print `rerun-if-changed` Cargo's conservative fingerprint listed
an absolute path in it, which was intended to be a relative path.

The fix here is to use a relative path in the fingerprint to ensure that
it's not the reason a rebuild happens when directories are renamed.
2020-07-17 10:07:06 -07:00
Alex Crichton 0750a6f504 Handle env var escaping 2020-06-29 12:57:09 -07:00
Alex Crichton 643f12efcf Address review feedback 2020-06-29 11:32:37 -07:00
Alex Crichton f666b19a8f Parse # env-dep directives in dep-info files
This commit updates Cargo's parsing of rustc's dep-info files to account
for changes made upstream in rust-lang/rust#71858. This means that if
`env!` or `option_env!` is used in crate files Cargo will correctly
rebuild the crate if the env var changes.

Closes #8417
2020-06-29 08:15:15 -07:00
Eric Huss f975c2e588 Don't hash executable filenames on apple platforms. 2020-06-04 16:14:17 -07:00
Eric Huss 90c0bcde3a Fix fingerprinting for lld on Windows with dylib. 2020-05-27 11:04:24 -07:00
Eric Huss 01648b942b Add a wrapper to wait for rustc to exit. 2020-04-27 12:23:09 -07:00
Eric Huss aca8baed07 Fix flaky linking_interrupted test. 2020-04-26 11:20:21 -07:00
Eric Huss 4ae79d2ffd Use fs helpers instead of File functions. 2020-04-17 07:56:16 -07:00
Eric Huss cd396f340a Fix freshness when linking is interrupted. 2020-04-09 08:46:14 -07:00
Eric Huss 6e3f35b20a Use the same filename hash for pre-release channels. 2020-04-05 13:46:37 -07:00
Alex Crichton bac300bda0 Add support for -Cembed-bitcode=no
This commit is the Cargo half of support necessary for
rust-lang/rust#70458. Today the compiler emits embedded bytecode in
rlibs by default, but compresses it. This is both extraneous disk space
and wasted build time for almost all builds, so the PR in question there
is changing rustc to have a `-Cembed-bitcode` flag which, when enabled,
places the bitcode in the object file rather than an auxiliary file (no
extra compression), but also enables `-Cembed-bitcode=no` to disable
bitcode emission entirely.

This Cargo support changes Cargo to pass `-Cembed-bitcode=no` for almost
all compilations. Cargo will keep `lto = true` and such working by not
passing this flag (and thus allowing bitcode to get embedded), but by
default `cargo build` and `cargo build --release` will no longer have
any bitcode in rlibs which should result in speedier builds!

Most of the changes here were around the test suite and various
assertions about the `rustc` command lines we spit out. One test was
hard-disabled until we can get `-Cembed-bitcode=no` into nightly, and
then we can make it a nightly-only test. The test will then be stable
again once `-Cembed-bitcode=no` hits stable.

Note that this is intended to land before the upstream `-Cembed-bitcode`
change. The thinking is that we'll land everything in rust-lang/rust all
at once so there's no build time regressions for anyone. If we were to
land the `-Cembed-bitcode` PR first then there would be a build time
regression until we land Cargo changes because rustc would be emitting
uncompressed bitcode by default and Cargo wouldn't be turning it off.
2020-04-01 14:31:06 -07:00
Eric Huss da8d17429f Fix rebuild_sub_package_then_while_package on HFS. 2020-02-04 17:42:09 -08:00
Eric Huss 83571aee56 Minor testsuite organization. 2019-11-24 18:42:45 -08:00
Eric Huss 5ccabc829e Re-enable some MSVC tests. 2019-10-08 10:13:24 -07:00
snf e7c5579d3e removing hash from output files when using MSVC 2019-10-02 02:07:09 -03:00
bors 8b0561d68f Auto merge of #6989 - da-x:custom-profile-pr-rfc, r=ehuss
Support for named profiles (RFC 2678)

Tracking issue: https://github.com/rust-lang/cargo/issues/6988

Implementation according to the [RFC](https://github.com/rust-lang/rfcs/blob/master/text/2678-named-custom-cargo-profiles.md).
2019-09-30 19:51:19 +00:00
Alex Crichton f3c92ed52e Go back to not hashing RUSTFLAGS in -Cmetadata
This is a moral revert of #6503 but not a literal code revert. This
switches Cargo's behavior to avoid hashing compiler flags into
`-Cmetadata` since we've now had multiple requests of excluding flags
from the `-Cmetadata` hash: usage of `--remap-path-prefix` and PGO
options. These options should only affect how the compiler is
invoked/compiled and not radical changes such as symbol names, but
symbol names are changed based on `-Cmetadata`. Instead Cargo will still
track these flags internally, but only for reinvoking rustc, and not for
caching separately based on rustc flags.

Closes #7416
2019-09-26 10:50:43 -07:00
Dan Aloni 375a46f18b Merge remote-tracking branch 'origin/master' into custom-profile-pr-rfc 2019-09-18 08:56:13 +03:00
Alex Crichton c3868bb69d Clear out memoized hashes before building crates
Build script updates during execution can change the memoized hash of a
`Fingerprint`, and while previously we cleared out a single build
script's memoized hash we forgot to clear out everything that depended
on it as well. This commit pessimistically clears out all `Fingerprint`
memoized hashes just before building to ensure that during the build
everything has the most up-to-date view of the world, and when build
scripts change fingerprints everything that depends on them won't have
run yet.

Closes #7362
2019-09-17 07:04:28 -07:00
Alex Crichton 9115b2c326 Extract support directory to its own crate
Extract out all our test support code to its own standalone crate so it
can be shared between multiple test suites if necessary.
2019-09-16 11:47:09 -07:00
Dan Aloni f0896975be Merge remote-tracking branch 'origin/master' into custom-profile-pr-rfc 2019-09-08 21:43:41 +03:00
k-nasa 7176df01d6 Change --all to --workspace 2019-09-03 17:14:34 -07:00
Dan Aloni 27da33c67d Merge remote-tracking branch 'origin/master' into custom-profile-pr-rfc 2019-07-28 09:24:31 +03:00
Ximin Luo b64db390c4 Work around rust-lang/rust#61440 2019-07-20 15:58:37 -07:00
Lucas Molas 8343fb7396 test(freshness): remove simple_deps_cleaner_does_not_rebuild
Now that the `mtime` of intermediate artifacts is not updated there's no need
for this test anymore (it now fails because without the `mtime`s it cannot
perform the intended  GC operation).
2019-06-21 00:15:59 -03:00
Lucas Molas 9aa7a4dce5 test(freshness): check that updating dependency mtime does not rebuild 2019-06-20 23:34:45 -03:00
Dan Aloni 87183146d9 Merge remote-tracking branch 'origin/master' into custom-profile-pr-rfc 2019-06-20 16:18:42 +03:00
Mark Rousskov 34fd5cc8aa Support rustc emitting dep-info for binary dependencies
rustc wants to provide sysroot dependencies and perhaps eventually
statically/dynamically linked C libraries discovered in library serach
paths to Cargo. Mostly this is only useful today for rustbuild as
otherwise Cargo's assumption that the sysroot is only changed if `rustc`
itself changes is pretty much always correct.
2019-06-14 13:37:05 -06:00
Jethro Beekman 0e0d968825 Update #[test] attribute on all tests in the testsuite
sed -i 's/^#\[test\]/#[cargo_test]/' $(rg -l '^#\[test\]')

Manual fixes:
* proc_macro::proc_macro_doctest
2019-06-07 12:41:26 -07:00
Dan Aloni e25f6a4255 tests: fix finished line for 'cargo test' 2019-06-07 21:47:45 +03:00
Eric Huss ec21e12d8a Some clippy fixes. 2019-05-20 12:40:14 -07:00