9729 Commits

Author SHA1 Message Date
Tarun Verghis
b0a3cc6b7a Assume README.md if readme=true 2020-06-09 00:03:15 -07:00
Daniél Kerkmann
1e800abcab
Merge branch 'master' into license-field-as-environment-variable 2020-06-08 21:24:02 +02:00
bors
5eb53f7d3f Auto merge of #8342 - ehuss:fix-tree-completions, r=alexcrichton
Fix tree completions.

During #8062, the flags were changed, but the completions weren't updated.

Fixes #8330
2020-06-08 14:47:36 +00:00
bors
22a112bff1 Auto merge of #8267 - drmikehenry:prefix, r=alexcrichton
Support `{prefix}` and `{lowerprefix}` markers in `config.json` `dl` key

Hello,

The crates.io-index Git repository uses a nice directory structure to keep individual directory sizes under control.

When mirroring crates.io, it's useful to store crate files in a similar directory structure for the same reasons.

Cargo provides "markers" for use in the `dl` key of the `config.json` file in crates.io-index to allow flexibility in mapping a crate's name and version into a URL for the crate.  The marker `{crate}` is replaced by the crate's name, and the marker `{version}` is replaced with the crate's version.  The default URL template is `https://crates.io/api/v1/crates/{crate}/{version}/download`.

Currently, if a mirror of crates.io stores crates in a directory structure similar to that of crates.io-index, it's up to the server to construct the directory name from the crate name.  This eliminates trivial web servers and `file:` URLs from hosting such a tree of crates.

This pull requests adds two new markers for the `dl` key in `config.json`, allowing Cargo to supply the directory name as part of the URL.  The marker `{lowerprefix}` is the same directory name used within crates.io-index; it is calculated from the crate name converted to lowercase.  The marker `{prefix}` is similar, but it uses the crate name as-is (without case conversion), which is useful for supporting older versions of Cargo that lack these markers; for example, nginx rewrite rules can easily construct `{prefix}` but can't perform case-conversion to construct `{lowerprefix}`.  These new markers will provide implementation flexibility and simplicity for crate mirror servers.
2020-06-08 14:19:43 +00:00
bors
6f9d808323 Auto merge of #8270 - reggaemuffin:8251-binary-name-env-var, r=ehuss
Add environment variables to identify the binary and crate name

Closes #8251

This adds `CARGO_BIN_NAME` and `CARGO_CRATE_NAME` to rustc/rustdoc process env.

`CARGO_BIN_NAME` is added for binary compilation units, `CARGO_CRATE_NAME` is added for binary and library units.

The `build::crate_env_vars` test was updated to test for this. The test is currently only checking behavior for the binary compile unit.

Documentation was updated to reflect the added environment variables.
2020-06-08 13:53:33 +00:00
kellda
3fbd5aefd4 Add --index flag to cargo install 2020-06-08 12:48:47 +00:00
Brian Chin
ae66a01690 Reformat 2020-06-07 15:59:35 -07:00
Brian Chin
224cb99b43 Inline load_workspace_metadata() into Workspace::new() 2020-06-07 15:57:28 -07:00
Eric Huss
45523c23da Fix tree completions. 2020-06-07 15:09:47 -07:00
Daniél Kerkmann
8c99e2026b
Change test 'MIT' license to 'MIT OR Apache-2.0' 2020-06-06 10:24:06 +02:00
bors
fb0e392399 Auto merge of #8336 - ehuss:version-bump, r=alexcrichton
Bump to 0.47.0, update changelog
2020-06-05 19:44:27 +00:00
bors
c4274471e3 Auto merge of #8334 - Eh2406:small-nits, r=alexcrichton
Nits: Remove unneeded mut and loop

just some small nits.
2020-06-05 19:02:19 +00:00
Eric Huss
2011649f50 Update changelog for 1.45. 2020-06-05 11:45:47 -07:00
Eh2406
f05ef874bc Remove unneeded mut and loop 2020-06-05 14:05:09 -04:00
Brian Chin
681376502b Change tag to avoid duplicate link 2020-06-05 10:15:40 -07:00
Eric Huss
8183cbaae6 Bump to 0.47.0 2020-06-05 10:15:15 -07:00
bors
41d112ac87 Auto merge of #8331 - ehuss:1.45-beta-backport, r=Eh2406
1.45 beta backports

Beta backports for:
* #8290 — Fix fingerprinting for lld on Windows with dylib.
* #8329 — Don't hash executable filenames on apple platforms. (fix macos backtraces)
2020-06-05 16:39:10 +00:00
Brian Chin
341d416238 Extract a fn load_workspace_config()
Reword the documentation for the two `metadata` tables, and
suggest consistent usage.
2020-06-05 09:32:54 -07:00
Brian Chin
866d4316e1 Add support for workspace.metadata table 2020-06-05 09:32:54 -07:00
bors
fcfb13c5fa Auto merge of #8329 - ehuss:apple-no-hash, r=alexcrichton
Don't hash executable filenames on apple platforms.

Due to some recent changes to the backtrace crate, backtraces on apple platforms haven't been working (they are missing line/filename information). The reason is that previously libbacktrace would hunt through the directory for any matching file in the `.dSYM` directory. The new implementation expects a file matching the executable name exactly (which no longer includes the hash because Cargo renames it).

The solution here is to not include a hash in the executable filename. This matches the behavior on Windows which does it for a similar reason (paths are embedded in pdb files).

The downside is that switching between different settings (like different features) causes Cargo to rebuild the binary each time.  I don't think this is a particularly common use case, at least I've not heard any complaints about this behavior on Windows.

Fixes https://github.com/rust-lang/rust/issues/72550
2020-06-05 09:20:45 -07:00
bors
bd57eb5bad Auto merge of #8290 - ehuss:fix-lld-freshness, r=alexcrichton
Fix fingerprinting for lld on Windows with dylib.

This fixes an issue where if `lld` is used on Windows, dynamic libraries will never be treated as "fresh". This is a regression from #8210 where Cargo is expecting export files to be created, but lld does not create these.

The solution is to ignore "Auxiliary" files in fingerprinting, which AFAIK aren't really needed (only the primary output files really matter).

Fixes #8284
2020-06-05 09:20:30 -07:00
bors
de31a3498d Auto merge of #8321 - hbina:issue_7596, r=alexcrichton
Better error message when passing in relative path to Workspace::new

Fixes #7596
2020-06-05 14:56:20 +00:00
bors
e9d7af4696 Auto merge of #8329 - ehuss:apple-no-hash, r=alexcrichton
Don't hash executable filenames on apple platforms.

Due to some recent changes to the backtrace crate, backtraces on apple platforms haven't been working (they are missing line/filename information). The reason is that previously libbacktrace would hunt through the directory for any matching file in the `.dSYM` directory. The new implementation expects a file matching the executable name exactly (which no longer includes the hash because Cargo renames it).

The solution here is to not include a hash in the executable filename. This matches the behavior on Windows which does it for a similar reason (paths are embedded in pdb files).

The downside is that switching between different settings (like different features) causes Cargo to rebuild the binary each time.  I don't think this is a particularly common use case, at least I've not heard any complaints about this behavior on Windows.

Fixes https://github.com/rust-lang/rust/issues/72550
2020-06-05 14:31:21 +00:00
Eric Huss
f975c2e588 Don't hash executable filenames on apple platforms. 2020-06-04 16:14:17 -07:00
bors
02205f5403 Auto merge of #8324 - matthiaskrgr:clippy_v14, r=ehuss
fix clippy warnings
2020-06-04 21:24:53 +00:00
Hanif Bin Ariffin
84f1dc1b59 Passing a relative path to Workspace now bails with proper message.
Previously, this failure will return an unhelpful warning.
This commit adds an error message saying that the argument for
`manifest_path` must be an absolute path.
2020-06-04 14:46:23 -04:00
Daniél Kerkmann
4a4f5a20fa
Adding environment variable CARGO_PKG_LICENSE
Fixes #8024
2020-06-04 02:51:16 +02:00
Matthias Krüger
6eefe3c236 fix clippy warnings 2020-06-04 00:55:45 +02:00
bors
0227f048fc Auto merge of #8320 - alexcrichton:update-libgit2, r=ehuss
Require latest libgit2 to pull in bugfixes

This'll pull in a fix for #8258
2020-06-03 15:49:06 +00:00
Hanif Bin Ariffin
9907039c99 Attemtping to solve Workspace using relative path. 2020-06-03 11:29:22 -04:00
Alex Crichton
2af2abed4f Require latest libgit2 to pull in bugfixes
This'll pull in a fix for #8258
2020-06-03 08:14:57 -07:00
bors
841e9941bb Auto merge of #8319 - alexcrichton:fix-access, r=Eh2406
Fix an accidental raw access of field

The manifest has a few different ways of specifying whether a crate is a
procedural macro, and there's a `TomlTarget::proc_macro()` method to
unify these various lines. Unfortunately though we had a bug where one
location forgot to call the method and read the raw field! This led to
surprising behavior where the different ways to specify a proc macro
would have subtly different changes in behavior. The fix here in this PR
is to ensure that we access the property always via the method.

Closes #8315
2020-06-03 15:03:10 +00:00
Alex Crichton
442f6297bf Fix an accidental raw access of field
The manifest has a few different ways of specifying whether a crate is a
procedural macro, and there's a `TomlTarget::proc_macro()` method to
unify these various lines. Unfortunately though we had a bug where one
location forgot to call the method and read the raw field! This led to
surprising behavior where the different ways to specify a proc macro
would have subtly different changes in behavior. The fix here in this PR
is to ensure that we access the property always via the method.

Closes #8315
2020-06-03 07:44:22 -07:00
bors
5f63be6297 Auto merge of #8314 - cuviper:mem-take, r=Eh2406
Use mem::take to replace with Default values
2020-06-03 02:02:36 +00:00
Josh Stone
6a6fa368a3 Use mem::take to replace with Default values 2020-06-02 18:03:33 -07:00
bors
ebe57ad9d4 Auto merge of #8310 - ehuss:allow-non-dll-suffix, r=Eh2406
Allow Windows dylibs without dll suffix.

Custom target JSON specs can change the suffix, so don't require it.

Fixes #8308
2020-06-02 18:03:33 +00:00
Eric Huss
8d344dc1f7 Allow Windows dylibs without dll suffix. 2020-06-02 10:50:55 -07:00
bors
0e8a8dfa9c Auto merge of #8307 - pickfire:alias-help, r=alexcrichton
Show alias in help message

Improve feature discovery of help message
Inspired by x.py help https://github.com/rust-lang/rust/issues/71357
Improves https://github.com/rust-lang/cargo/issues/6104
2020-06-02 16:35:38 +00:00
Ivan Tham
a3118e1cc3 Show alias in help message
Improve feature discovery of help message
Inspired by x.py help https://github.com/rust-lang/rust/issues/71357
Improves https://github.com/rust-lang/cargo/issues/6104
2020-06-02 20:52:00 +08:00
bors
40ebd52206 Auto merge of #8297 - mjarkk:warn-when-using-hash-in-git-url, r=ehuss
Warn if using hash in git URL, Fixes #8241

This fixes an issue where if the user wants to set the git rev but doesn't know how and as results tries to set the ref in the url hash as also shown when downloading the dependency.
Now cargo returns a warning notifying the user about the correct way to set the ref.

Fixes #8241
2020-06-01 22:35:00 +00:00
mjarkk
91f6617457 Add test 2020-06-01 19:50:33 +02:00
mjarkk
c4e150b25e Fix review 2020-06-01 19:41:52 +02:00
Mark Kopenga
c403187d4a
Update src/cargo/util/toml/mod.rs
Co-authored-by: Eric Huss <eric@huss.org>
2020-06-01 19:34:39 +02:00
bors
5847787fef Auto merge of #8274 - Eh2406:8249-repro, r=alexcrichton
reset lockfile information between resolutions

#8249 pointed out that some kind of lockfile data was leaking between calls to the resolver. @ehuss made a reproducing test case. This PR resets the `LockedMap` data structure when calling `register_previous_locks`.

lets see if CI likes it.
fix #8249
2020-06-01 16:01:10 +00:00
bors
1afe225e9f Auto merge of #8301 - ehuss:disable-strip-macos, r=alexcrichton
Disable strip_works test on macos.

This feature doesn't work on macOS, because it uses ld64 with clang.  See https://github.com/rust-lang/rust/issues/72110#issuecomment-636609419.
2020-06-01 13:39:22 +00:00
Eric Huss
69b1ae6ca2 Disable strip_works test on macos. 2020-05-31 21:56:02 -07:00
bors
15bb455d12 Auto merge of #8299 - kpp:master, r=ehuss
Fix typo in impl Display for Strip
2020-05-31 23:30:19 +00:00
Roman Proskuryakov
9ae32fc00d
Fix typo in impl Display for Strip 2020-06-01 01:43:51 +03:00
Marvin Hofmann
7ad7427ced
Update documentation as per review 2020-05-31 21:01:03 +01:00
Tarun Verghis
77c52c2b4f Move constructor fn for manifest with readme to test file 2020-05-30 14:14:50 -07:00