Commit graph

1139 commits

Author SHA1 Message Date
Eric Huss 51a8206c38 Be more consistent about detecting CI. 2019-07-25 12:10:55 -07:00
Eric Huss 4f6553ab55 Use canonical paths when parsing dep-info.
Instead of treating Windows differently, this just always uses canonical paths
on all platforms.  This fixes a problem where symlinks were not treated
correctly on all platforms.

Switching rm_rf to the remove_dir_all crate because deleting symbolic links on
Windows is difficult.
2019-07-25 12:10:55 -07:00
Eric Huss b1b9b79c02 Track dep-info for all dependencies.
This adds dep-info tracking for non-path dependencies. This avoids tracking
package-relative paths (like source files) in non-path dependencies, since we
assume they are static. It also adds an mtime cache to improve performance since
when rustc starts tracking sysroot files (in the future), it can cause a large
number of stat calls.
2019-07-25 12:10:24 -07:00
Eric Huss aa99e9f251 Fix some issues with absolute paths in dep-info files. 2019-07-25 12:10:24 -07:00
Alex Crichton bd7fe8914b Fix a deadlocking test with master libgit2
This commit fixes a test in Cargo to work around a seeming regression in
behavior in libgit2 around HTTP authentication. The expected flow for
HTTP authentication with git is that git sends an HTTP request and
receives an "unauthorized" response. It then sends another request with
authorization information and that's what we're testing is received in
the our test.

Previously libgit2 would issue a new HTTP connection if the previous one
was closed, but it looks like changes in libgit2 now require that the
same HTTP connection is used for the initial request and the subsequent
request with authorization information. This broke our test since it's
not using an HTTP compliant server at all and is just some handwritten
TCP reads/writes. The fix here is to basically stay with handwritten TCP
reads/writes but tweak how it happens so it's all on the same HTTP/TCP
connection to match what libgit2 is expecting.

Some extra assertions have also been added to try to prevent deadlocks
from happening in the future and instead make the test fail fast if this
situation comes up again.
2019-07-25 09:15:24 -07:00
bors caba711ce9 Auto merge of #7174 - alexcrichton:fix-cycle-check, r=Eh2406
Fix detection of cyclic dependencies through `[patch]`

This commit fixes detection of cyclic dependencies through the use of
`[patch]` by ensuring that `matches_id` isn't used because it returns a
false negative for registry dependencies when the dependency
specifications don't match but the resolve edges are still correct.

Closes #7163
2019-07-24 14:47:26 +00:00
Alex Crichton 0bd1d34cae Fix detection of cyclic dependencies through [patch]
This commit fixes detection of cyclic dependencies through the use of
`[patch]` by ensuring that `matches_id` isn't used because it returns a
false negative for registry dependencies when the dependency
specifications don't match but the resolve edges are still correct.

Closes #7163
2019-07-24 07:32:37 -07:00
bors d0f828419d Auto merge of #7170 - ehuss:no-more-glob, r=alexcrichton
Remove include/exclude glob warning.

This removes the warning when a package include/exclude pattern produces different results from glob vs gitignore.

The pre-warnings were added in 1.21 (released 2017-10-12) #4270.
The migration was done in 1.36 (released 2019-07-04) #6924.
This will remove the warnings in 1.38 (to be released 2019-09-26).

Closes #4268
2019-07-23 21:58:59 +00:00
Eric Huss 24d2850247 Remove include/exclude glob warning. 2019-07-23 13:49:17 -07:00
bors 767ecea0b4 Auto merge of #7070 - alexcrichton:smaller-cargo-lock, r=ehuss
Optimize lock file format for git merge conflicts

This commit is an attempt to refine Cargo's lock file format to generate
less git merge conflicts for lock file updates as well as make it easier
to manage lock file updates. The new lock file format has a few major changes:

* The `[metadata]` table is no longer used to track checksums. The
  packages themselves now list `checksum` fields directly.

* The entries in the `dependencies` key no longer unconditionally
  mention the version/source of the dependency. When unambiguous only
  the name or only the name/version are mentioned.

As mentioned before the goal here is to reduce git merge conflict
likelihood between two cargo updates to a lock file. By not using
`[metadata]` the updates to package checksums should only happen on the
package itself, not in a shared metadata table where it's easy to
conflict with other updates. Additionally by making `dependencies`
entries shorter it's hoped that updating a crate will only either add
entries to a lock file or update lines related to just that package.
It's theorized that the amount of updates necessary to a lock file are
far less than today where the version has to be updated in many
locations.

As with all lock file format changes this new format is not turned on by
default. Support is added so Cargo will preserve it if it sees it (and
tests are added too), and then some time down the road we can flip the
switch and turn this on by default.
2019-07-23 20:13:23 +00:00
bors a2f543181e Auto merge of #7139 - rust-lang:azure-pipelines, r=alexcrichton
Set up CI with Azure Pipelines
2019-07-23 16:47:57 +00:00
Alex Crichton c2354b9a11 Setup CI with Azure Pipelines 2019-07-23 09:09:41 -07:00
bors c8fad5bb07 Auto merge of #7157 - ehuss:force-clippy, r=alexcrichton
Force clippy to run.

This causes `cargo clippy-preview` to always run, instead of possibly emitting no output if it is run a second time.

This is just a personal preference of mine, but I think would be better behavior which we have talked about before.  I don't think the arguments that it should be "fast" like `cargo check` apply here.  Once [cache-messages](https://github.com/rust-lang/cargo/issues/6986) is stabilized, this can be removed.
2019-07-23 15:57:17 +00:00
Alex Crichton 34bca035ae Optimize lock file format for git merge conflicts
This commit is an attempt to refine Cargo's lock file format to generate
less git merge conflicts for lock file updates as well as make it easier
to manage lock file updates. The new lock file format has a few major changes:

* The `[metadata]` table is no longer used to track checksums. The
  packages themselves now list `checksum` fields directly.

* The entries in the `dependencies` key no longer unconditionally
  mention the version/source of the dependency. When unambiguous only
  the name or only the name/version are mentioned.

As mentioned before the goal here is to reduce git merge conflict
likelihood between two cargo updates to a lock file. By not using
`[metadata]` the updates to package checksums should only happen on the
package itself, not in a shared metadata table where it's easy to
conflict with other updates. Additionally by making `dependencies`
entries shorter it's hoped that updating a crate will only either add
entries to a lock file or update lines related to just that package.
It's theorized that the amount of updates necessary to a lock file are
far less than today where the version has to be updated in many
locations.

As with all lock file format changes this new format is not turned on by
default. Support is added so Cargo will preserve it if it sees it (and
tests are added too), and then some time down the road we can flip the
switch and turn this on by default.
2019-07-23 07:55:38 -07:00
Ximin Luo b64db390c4 Work around rust-lang/rust#61440 2019-07-20 15:58:37 -07:00
Eric Huss 1c6d8bb415 Force clippy to run. 2019-07-20 13:20:11 -07:00
bors 9f7bd62103 Auto merge of #7069 - yaahallo:master, r=ehuss
initial working version of cargo fix --clippy

closes https://github.com/rust-lang/cargo/issues/7006
2019-07-19 20:08:18 +00:00
bors 10776bdde3 Auto merge of #7084 - scruffystuffs:invoke-feature-multi, r=alexcrichton
Add support for multiple --features options

Closes #7076

Pretty straightforward, but I added an extra test to make sure that space-separated features work in conjunction with multiple --features options.
2019-07-19 13:56:28 +00:00
Jane Lusby f3d3318f9f minor fixes 2019-07-18 13:52:28 -07:00
Alex Crichton 6f8cd0c5c1 Fix a typo in an env var name
Not actually used yet in rust-lang/rust, but may as well try to get it
right on the first try.
2019-07-18 07:20:54 -07:00
Alex Crichton d78990b213 Add a way to disable all nightly tests
One thing I'm realizing now is that we test a number of nightly features
of Cargo/rustc, but if they change in rustc then because
rust-lang/rust's CI run's Cargo's tests it could prevent those changes
from landing! The purpose of running Cargo's tests in CI in
rust-lang/rust is to ensure that Cargo generally works, but there's no
need to test the nightly features as that's Cargo's job.

As a result this adds an environment variable that will be set from
rust-lang/rust's CI which will disable these tests.
2019-07-17 13:58:36 -07:00
bors 7b84c53f39 Auto merge of #7135 - ehuss:clippy-fixes, r=Eh2406
Fix some clippy warnings.
2019-07-15 00:50:13 +00:00
Eric Huss 9fa65608e4 Fix some clippy warnings. 2019-07-14 15:19:33 -07:00
Eric Huss d99b7fede7 Also ignore remap-path-prefix in metadata for cargo rustc. 2019-07-14 14:38:47 -07:00
Eric Huss a4e9611453 Fix some formatting for some strings. 2019-07-13 16:00:47 -07:00
bors 0dd7c508d0 Auto merge of #7118 - alexcrichton:patch-bug, r=Eh2406
Handle activation conflicts for `[patch]` sources

This commit updates the resolver to ensure that it recognizes conflicts
when `[patch]` is used to augment an older version of what's already in
a source, for example. Previously the deduplication based on
semver-compatible versions didn't actually work when `[patch]` was used.
This meant that when you used `[patch]` it might not transitively affect
the entire crate graph, instead just giving you a version of a
dependency and everyone else. This violates the intention of `[patch]`!

The fix here is to catch this use case happening, when a `Dependency`
source specification mismatches an activated package we need to list a
second activation in the resolver to prevent major versions from being
selected from both the original source as well as the source of the id.

Closes #7117
2019-07-12 20:10:19 +00:00
Alex Crichton 83bb30cedf Handle activation conflicts for [patch] sources
This commit updates the resolver to ensure that it recognizes conflicts
when `[patch]` is used to augment an older version of what's already in
a source, for example. Previously the deduplication based on
semver-compatible versions didn't actually work when `[patch]` was used.
This meant that when you used `[patch]` it might not transitively affect
the entire crate graph, instead just giving you a version of a
dependency and everyone else. This violates the intention of `[patch]`!

The fix here is to catch this use case happening, when a `Dependency`
source specification mismatches an activated package we need to list a
second activation in the resolver to prevent major versions from being
selected from both the original source as well as the source of the id.

Closes #7117
2019-07-10 11:21:24 -07:00
Alex Crichton bdb0ce84e2 Don't suppress error messages with -q
If we're printing an error, make sure we always print it regardless of
verbosity settings!
2019-07-10 10:01:09 -07:00
Lukas Lueg 91186e8c58 Remove byteorder-dependency 2019-07-08 12:35:34 +02:00
bors 644c8089f3 Auto merge of #7057 - hugwijst:apple-depinfo, r=ehuss
Fix overwriting .d file for binary with dSYM on apple targets.

When building a binary on targets containing `-apple-`, the resulting `.d` file gets overwritten with the dependencies of the `.dSYM` file. Eg. in the changed unit test, `foo.d` would start with `p.bin(foo).with_extension("dSYM")` instead of `p.bin(foo)`.

This PR fixes that problem by not generating `.d` dependency information files for outputs of the `DebugInfo` flavor.
2019-07-06 17:49:25 +00:00
Nicolas Mattia 8d1ef5a936 Fix misleading comment in testsuite 2019-07-03 16:11:23 +02:00
Wesley Van Melle 51c26b6776 Add support for multiple --features options 2019-07-01 15:29:38 -07:00
Sekhat Temporus 69226ed887 improve uncommitted changes cargo-package message
fixes #7003

Explicitly state what the suggested flag `--allow-dirty`
actually does when packaging/publishing the crate. Primarily,
that the uncommited changes are included within the resulting
package.
2019-07-01 18:48:59 +01:00
Eric Huss 00fd31dd9b Clean environment when git-fetch-with-cli is used. 2019-06-29 13:32:21 -07:00
Jane Lusby 8b1f599dfd back in tip top shape 2019-06-26 11:34:00 -07:00
Jane Lusby 6fb65f1e4f some changes, ill clean this up in a hot sec 2019-06-26 10:45:24 -07:00
Jane Lusby 3a9ac3ee00 initial clippy tests 2019-06-24 21:53:11 -07:00
Geoffry Song 15e08029f1 Add a test for build pipelining with a complex build graph. 2019-06-24 14:29:01 -07:00
Hugo van der Wijst 2c488c91d4 Fix overwriting binary .d file for dSYM target on apple targets. 2019-06-21 15:52:01 -07:00
Eric Huss 7d7fe6797a Stabilize default-run 2019-06-21 11:36:53 -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
Jeremy Stucki 930134c75b
Rename to_url -> into_url 2019-06-20 16:53:24 +02:00
Eric Huss 00822903bb Revert test directory cleaning change. 2019-06-18 14:14:24 -07:00
Alex Crichton 290a727ad0 Extract resolver tests to their own crate
These tests take a good amount of time to run locally and they're also
causing a lot of dependencies to get pulled into rust-lang/rust, so
let's have a separate crate that we just test on our own CI
2019-06-18 10:50:48 -07:00
bors b1add4b953 Auto merge of #7030 - Mark-Simulacrum:support-new-dep-info, r=alexcrichton
Support absolute paths in dep-info files

These changes are a little more invasive then I would've liked, but I couldn't come up with a significantly better way to structure this. Comments (or backwards-compat) concerns are appreciated, of course!

cc https://github.com/rust-lang/rust/pull/61727

r? @alexcrichton
2019-06-14 23:36:31 +00: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
Lzu Tao b01f5950b1 ci: Run cargo fmt on all workspaces 2019-06-14 00:10:21 +07:00
Lzu Tao ca0a0afd22 Use Once::new instead of ONCE_INIT 2019-06-13 12:54:23 +07:00
Eric Huss 34307c6122 Stabilize publish-lockfile. 2019-06-10 13:19:18 -07:00