10271 Commits

Author SHA1 Message Date
Eric Huss
352f828903 Update mdbook 2021-01-04 07:28:26 -08:00
bors
660ec3f50b Auto merge of #9042 - ehuss:version-bump, r=Eh2406
Bump to 0.52.0, update changelog
2021-01-04 00:16:05 +00:00
Eric Huss
5168b7e36b Update changelog for 1.50 2021-01-03 15:31:17 -08:00
Eric Huss
60143816bf Bump to 0.52.0 2021-01-03 14:56:35 -08:00
bors
0cf6d2497a Auto merge of #9033 - ehuss:redundant_semicolons, r=Eh2406
Fix redundant semicolon.

Lint introduced by https://github.com/rust-lang/rust/pull/79812.
2020-12-31 17:27:17 +00:00
Eric Huss
0ca1767f03 Fix redundant semicolon. 2020-12-31 08:44:34 -08:00
bors
cf8800a150 Auto merge of #9026 - kassens:master, r=Eh2406
Clarify fingerprint log messages

I had to look up the source to figure out which side was the old value for a RUSTFLAGS fingerprint mismatch.

Making the logs a bit more explicit about which value is old and new would've helped me.
2020-12-29 17:55:07 +00:00
Jan Kassens
4538ade2d5 cargo fmt 2020-12-29 12:42:28 -05:00
Jan Kassens
1110837d0e Clarify fingerprint log messages 2020-12-29 17:29:15 +00:00
bors
134f61406e Auto merge of #9013 - ehuss:credential-install-gnome-secret, r=Eh2406
Update credential docs for gnome-secret.

This can now be installed directly from crates.io, which is generally much faster than git.
2020-12-24 01:51:32 +00:00
Eric Huss
350394d567 Update credential docs for gnome-secret.
This can now be installed directly from crates.io, which is generally
much faster than git.
2020-12-23 17:43:28 -08:00
bors
75d5d8cffe Auto merge of #9009 - ehuss:bump-git2, r=alexcrichton
Update git2

Pulls in https://github.com/rust-lang/git2-rs/pull/646 fixing an issue with arm64.
2020-12-22 18:10:56 +00:00
Eric Huss
4e358386cc Update git2 2020-12-22 06:03:54 -08:00
bors
e10b79189d Auto merge of #8976 - ebroto:rustc_workspace_wrapper, r=ehuss
Stabilize RUSTC_WORKSPACE_WRAPPER

Stabilizing this environment variable would allow Clippy to fix a long-standing usability problem, [clippy#4612](https://github.com/rust-lang/rust-clippy/issues/4612).

It's also the last step towards stabilizing the `--fix` command-line argument in Clippy, that allows applying suggestions automatically when the lint supports it.

Closes #8143

r? `@ehuss`
2020-12-21 19:37:30 +00:00
bors
a79aa3a82c Auto merge of #8987 - jonhoo:metadata-target-filtering, r=ehuss
Make cargo metadata and tree respect target

Previously, the `metadata` and `tree` subcommands would download
dependencies for all targets, regardless of whether those targets were
actually enabled. This PR updates them so that they only download the
same dependencies that building would do with the requested target(s).

`cargo metadata` still includes all targets by default; you can only opt
_out_ using `--filter-platform`. Ideally it should use `--target` the
same way `tree` does, but it's too late to change that now.

Fixes #8981.
2020-12-19 15:23:22 +00:00
bors
0877f6109b Auto merge of #8998 - ehuss:update-git2, r=alexcrichton
Update git2

Hopefully this will finally fix #8517 (and hopefully won't cause much breakage).

Major changes:
- Requires libgit2 1.1: https://github.com/rust-lang/git2-rs/pull/632
- Update libgit2: https://github.com/rust-lang/git2-rs/pull/642  (changes: 7f4fa17862...530d37beb2)
2020-12-18 19:22:18 +00:00
bors
8abc050f01 Auto merge of #8996 - alexcrichton:revert, r=ehuss
Revert #8954 - changing rustdoc's cwd

This PR reverts https://github.com/rust-lang/cargo/pull/8954 in reference to https://github.com/rust-lang/cargo/issues/8993 and https://github.com/rust-lang/cargo/issues/8992 where there's still definitely a bug to be fixed but we should probably avoid regressing in the meantime.

Closes https://github.com/rust-lang/cargo/issues/8992
2020-12-18 18:21:58 +00:00
Eric Huss
b425e4ccb1 Update git2 2020-12-18 10:13:50 -08:00
Jon Gjengset
260a355581 Revert now-unnecessary change 2020-12-18 10:06:36 -08:00
Jon Gjengset
a031b03ac7 Remove unnecessary second download phase 2020-12-18 09:49:22 -08:00
Alex Crichton
6f49ce636f Revert "Run rustdoc doctests relative to the workspace"
This reverts commit 2cc2ae8c963298143b71dceab0014dc09d4f65a8.
2020-12-18 08:06:43 -08:00
Alex Crichton
aca5261718 Revert "fix failures on linux"
This reverts commit e729880f566839824d077d1be865ac5687fe0fdd.
2020-12-18 08:06:38 -08:00
Jon Gjengset
c3b9f56fb2 Trigger CI yet again for spurious failure. 2020-12-17 10:22:27 -08:00
Jon Gjengset
1e861e97e2 Re-trigger CI for spurious failure. 2020-12-17 10:21:09 -08:00
Jon Gjengset
027977c84b Make ResolveOpts::new take RequestedFeatures 2020-12-17 10:16:26 -08:00
Jon Gjengset
ee286bce4b Add tests for fixed metadata download behavior 2020-12-17 10:01:25 -08:00
bors
27dba04f40 Auto merge of #8991 - alexcrichton:debug-curl-verison, r=Eh2406
With debug HTTP mode log curl's version

This will hopefully help any future reports where we're trying to
figure out what's going on with possible different versions of the
`curl` library.
2020-12-17 16:18:33 +00:00
Alex Crichton
12ee5a79af With debug HTTP mode log curl's version
This will hopefully help any future reports where we're trying to
figure out what's going on with possible different versions of the
`curl` library.
2020-12-17 08:11:50 -08:00
Jon Gjengset
7367e4390c Make cargo metadata and tree respect target
Previously, the `metadata` and `tree` subcommands would download
dependencies for all targets, regardless of whether those targets were
actually enabled. This PR updates them so that they only download the
same dependencies that building would do with the requested target(s).

`cargo metadata` still includes all targets by default; you can only opt
_out_ using `--filter-platform`. Ideally it should use `--target` the
same way `tree` does, but it's too late to change that now.

Fixes #8981.
2020-12-16 14:22:30 -08:00
bors
fde8ee3ba0 Auto merge of #8984 - ehuss:reject-ambiguous-git, r=Eh2406
Reject ambiguous git dependency declaration.

This rejects a git dependency that specifies more than one of `branch`, `tag`, or `rev`. Cargo does not handle this case very well, and this warning has been in place for 4 years (since #2940).

Fixes #7841
2020-12-16 21:37:20 +00:00
Eric Huss
d65a714493 Reject ambiguous git dependency declaration. 2020-12-16 13:10:11 -08:00
bors
4f0adaeb68 Auto merge of #8982 - ehuss:fix-alt-target-tests, r=alexcrichton
Fix tests not working with a different CARGO_TARGET_DIR.

Fixes #8980
2020-12-16 21:02:59 +00:00
bors
310994c8e9 Auto merge of #8983 - ehuss:credential-versions, r=alexcrichton
Add version to credential dependencies.

I forgot to add the version in the dependency declaration for cargo-credential.
2020-12-16 20:30:29 +00:00
Eric Huss
382b2519b4 Add version to credential dependencies.
I forgot to add the version in the dependency declaration for cargo-credential.
2020-12-16 12:25:59 -08:00
Eric Huss
0ac41f0051 Fix tests not working with a different CARGO_TARGET_DIR. 2020-12-16 11:19:32 -08:00
bors
de4230293d Auto merge of #8978 - joshtriplett:faq-clarification, r=Eh2406
Clarify FAQ entry wording about lockfiles

I received a report that this FAQ entry (and in particular the wording
"across whatever machine") generated some confusion. Reword the FAQ
entry for clarity.
2020-12-16 14:35:53 +00:00
Josh Triplett
2af33ae1b0 Clarify FAQ entry wording about lockfiles
I received a report that this FAQ entry (and in particular the wording
"across whatever machine") generated some confusion. Reword the FAQ
entry for clarity.
2020-12-15 19:38:26 -08:00
bors
a3c2627fbc Auto merge of #8973 - ehuss:rerun-if-directory, r=alexcrichton
Check if rerun-if-changed points to a directory.

This changes it so that if a build script emits `cargo:rerun-if-changed` pointing to a directory, then Cargo will scan the entire directory for changes (instead of just looking at the mtime of the directory itself).  I think this is more useful, as otherwise build scripts have to recreate this logic.

I've tried to make it semi-intelligent in the face of symbolic links.  It checks the mtime of the link and its target, and follows the link if it points to a directory.

There are a few other edge cases. For example, if it doesn't have permission for a directory, it will skip it.  I think this is relatively reasonable, though it's hard to say for sure.
2020-12-14 17:21:26 +00:00
Eric Huss
4c68a4ad79 mtime_recursive: Add some comments and debugging diagnostics. 2020-12-14 08:55:10 -08:00
bors
8917837fb6 Auto merge of #8934 - ehuss:token-process, r=alexcrichton
Implement external credential process. (RFC 2730)

This adds a config setting for an external process to run to fetch the token for a registry. See `unstable.md` for more details.

As part of this, it adds a new `logout` command. This is currently gated on nightly with the appropriate `-Z` flag.

I have included four sample wrappers that integrate with the macOS Keychain, Windows Credential Manager, GNOME libsecret, and 1password. I'm not sure if we'll ultimately ship these, but I would like to. Primarily this provided a proof-of-concept to see if the design works.

**Patch Walkthrough**

This is a brief overview of the changes:

- Adds the `logout` command. With `cargo logout -Z unstable-options`, this allows removing the `token` from `.cargo/credentials`.  With `cargo logout -Z credential-process`, this launches the process with the `erase` argument to remove the token from storage.
- Credential-process handling is in the `ops/registry/auth.rs` module. I think it is pretty straightforward, it just launches the process with the appropriate store/get/erase argument.
- `ops::registry::registry()` now returns the `RegistryConfig` to make it easier to pass the config information around.
- `crates/credential/cargo-credential` is a helper crate for writing credential processes.
- A special shorthand of the `cargo:` prefix for a credential process will launch the named process from the `libexec` directory in the sysroot (or, more specifically, the `libexec` directory next to the `cargo` process). For example `credential-process = "cargo:macos-keychain"`. My intent is to bundle these in the pre-built rust-lang distributions, and this should "just work" when used with rustup. I'm not sure how that will work with other Rust distributions, but I'm guessing they can figure it out. This should make it much easier for users to get started, but does add some integration complexity.

**Questions**

- I'm on the fence about the name `credential-process` vs `credentials-process`, which sounds more natural? (Or something else?)
- I'm uneasy about the behavior when both `token` and `credential-process` is specified (see `warn_both_token_and_process` test). Currently it issues a warning and uses `token`. Does that make sense? What about the case where you have `registries.foo.token` for a specific registry, but then have a general `registry.credential-process` for the default (it currently warns and uses the token, maybe it should not warn?)?
- I am still pretty uneasy with writing FFI wrappers, so maybe those could get a little extra scrutiny? They seem to work, but I have not extensively tested them (I tried login, publish, and logout). I have not previously used these APIs, so I am not familiar with them.
- Testing the wrappers I think will be quite difficult, because some require TTY interaction (and 1password requires an online account). Or, for example in the macOS case, it has GUI dialog box where I can use my fingerprint scanner. Right now, I just build them in CI to make sure they compile.
- 1password is a little weird in that it passes the token on the command-line, which is not very secure on some systems (other processes can see these sometimes). The only alternative I can think of is to not support `cargo login` and require the user to manually enter the token in the 1password GUI. I don't think the concern is too large (1password themselves seem to think it is acceptable). Should this be OK?
- I'm a little uneasy with the design of `cargo login`, where it passes the token in stdin. If the wrapper requires stdin for user interaction (such as entering a password to unlock), this is quite awkward. There is a hack in the 1password example that demonstrates using `/dev/tty` and `CONIN$`, which *seems* to work, but I'm worried is fragile. I'm not very comfortable passing the token in environment variables, because those can be visible to other processes (like CLI args), but in some situations that shouldn't be too risky. Another option is to use a separate file descriptor/handle to pass the token in. Implementing that in Rust in a cross-platform way is not terribly easy, so I wanted to open this up for discussion first.
2020-12-14 16:22:53 +00:00
Eduardo Broto
f838a003f1 Stabilize RUSTC_WORKSPACE_WRAPPER 2020-12-13 23:50:15 +01:00
Eric Huss
cee088b0db Check if rerun-if-changed points to a directory. 2020-12-12 14:14:54 -08:00
bors
c68c6220b6 Auto merge of #8968 - alexcrichton:revert-8834, r=ehuss
Revert recent build-std vendoring changes

This reverts #8834 to address https://github.com/rust-lang/cargo/issues/8962 and https://github.com/rust-lang/cargo/issues/8963

cc `@Gankra`
2020-12-12 18:07:59 +00:00
bors
dd4110636d Auto merge of #8969 - alexcrichton:fix-cycle, r=ehuss
Fix the unit dependency graph with dev-dependency `links`

This commit fixes #8966 by updating the unit generation logic to avoid
generating an erroneous circular dependency between the execution of two
build scripts. This has been present for Cargo in a long time since #5651
(an accidental regression), but the situation appears rare enough that
we didn't get to it until now!

Closes #8966
2020-12-12 17:38:07 +00:00
Alex Crichton
4761ada30f Fix the unit dependency graph with dev-dependency links
This commit fixes #8966 by updating the unit generation logic to avoid
generating an erroneous circular dependency between the execution of two
build scripts. This has been present for Cargo in a long time since #5651
(an accidental regression), but the situation appears rare enough that
we didn't get to it until now!

Closes #8966
2020-12-11 09:59:33 -08:00
Alex Crichton
049b2727b1 Fix a test 2020-12-11 08:43:27 -08:00
Alex Crichton
602f6b64de Revert "Check if rust-src contains a vendor dir, and patch it in"
This reverts commit eadb4fc86c6660760ff857df41b7e88f6da0f714.
2020-12-11 07:45:27 -08:00
Alex Crichton
0fd4d96474 Revert "Add error context for reading vendor dir."
This reverts commit 85b5b180f49d0892d79fbd21c4cd37b634eee4ff.
2020-12-11 07:45:22 -08:00
Eric Huss
eabef5698b Note that cargo-credential-gnome-secret won't be available precompiled.
The rust-lang/rust build infrastructure uses a version of Linux that is
too old to support building this.
2020-12-09 09:17:41 -08:00
Eric Huss
395edf2f8f Change behavior when both token and credential-process is specified.
Change it so that if both are specified, it is an error just to be safer
for now.

If token is specified for a registry, ignore the global
credential-process.

I'm still uncertain if this is the best behavior, but I think we can
tweak it later if needed.
2020-12-08 08:36:49 -08:00