]> git.proxmox.com Git - cargo.git/log
cargo.git
3 years agoMake `cargo metadata` output deterministic
Arlo Siemsen [Wed, 15 Jul 2020 17:43:34 +0000 (10:43 -0700)]
Make `cargo metadata` output deterministic

Uses BTreeMap instead of HashMap for the `cargo metadata` command.
The change did not cause a measurable performance impact for
running `cargo metadata` on `cargo` itself.

Fixes #8477

4 years agoAuto merge of #8416 - est31:remove_derive, r=alexcrichton
bors [Fri, 26 Jun 2020 16:33:12 +0000 (16:33 +0000)]
Auto merge of #8416 - est31:remove_derive, r=alexcrichton

Remove unused serde_derive dependency from the crates.io crate

4 years agoRemove unused serde_derive dependency
est31 [Fri, 26 Jun 2020 15:28:40 +0000 (17:28 +0200)]
Remove unused serde_derive dependency

4 years agoAuto merge of #8412 - est31:remove_remove, r=alexcrichton
bors [Fri, 26 Jun 2020 14:13:00 +0000 (14:13 +0000)]
Auto merge of #8412 - est31:remove_remove, r=alexcrichton

Remove unused remove_dir_all dependency

Originally part of #8384 but sadly the PR got rejected.

4 years agoRemove unused remove_dir_all dependency
est31 [Fri, 26 Jun 2020 04:37:04 +0000 (06:37 +0200)]
Remove unused remove_dir_all dependency

Need to research why it isn't detected by cargo-udeps.

4 years agoAuto merge of #8409 - alexcrichton:git-instead-of, r=Eh2406
bors [Thu, 25 Jun 2020 18:47:08 +0000 (18:47 +0000)]
Auto merge of #8409 - alexcrichton:git-instead-of, r=Eh2406

Improve git error messages a bit

This commit is targeted at further improving the error messages
generated from git errors. For authentication errors the actual URL
fetched is now printed out as well if it's different from the original
URL. This should help handle `insteadOf` logic where SSH urls are used
instead of HTTPS urls and users can know to track that down.

Otherwise the logic about recommending `net.git-fetch-with-cli` was
tweaked a bit and moved to the same location as the rest of our error
reporting.

Note that a change piggy-backed here as well is that `Caused by:` errors
are now automatically all tabbed over a bit instead of only having the
first line tabbed over. This required a good number of tests to be
updated, but it's just an updated in renderings.

4 years agoImprove git error messages a bit
Alex Crichton [Thu, 25 Jun 2020 15:25:52 +0000 (08:25 -0700)]
Improve git error messages a bit

This commit is targeted at further improving the error messages
generated from git errors. For authentication errors the actual URL
fetched is now printed out as well if it's different from the original
URL. This should help handle `insteadOf` logic where SSH urls are used
instead of HTTPS urls and users can know to track that down.

Otherwise the logic about recommending `net.git-fetch-with-cli` was
tweaked a bit and moved to the same location as the rest of our error
reporting.

Note that a change piggy-backed here as well is that `Caused by:` errors
are now automatically all tabbed over a bit instead of only having the
first line tabbed over. This required a good number of tests to be
updated, but it's just an updated in renderings.

4 years agoAuto merge of #8408 - jstasiak:improve-home-path-documentation, r=alexcrichton
bors [Thu, 25 Jun 2020 14:12:00 +0000 (14:12 +0000)]
Auto merge of #8408 - jstasiak:improve-home-path-documentation, r=alexcrichton

Improve the description of Config.home_path

I poked around and it seems it's not the user's home directory but Cargo
home (which may or may not be in user's home).

4 years agoImprove the description of Config.home_path
Jakub Stasiak [Thu, 25 Jun 2020 13:17:26 +0000 (15:17 +0200)]
Improve the description of Config.home_path

I poked around and it seems it's not the user's home directory but Cargo
home (which may or may not be in user's home).

4 years agoAuto merge of #8364 - alexcrichton:default-no-master, r=ehuss
bors [Wed, 24 Jun 2020 20:09:07 +0000 (20:09 +0000)]
Auto merge of #8364 - alexcrichton:default-no-master, r=ehuss

Improve support for non-`master` main branches

This commit improves Cargo's support for git repositories whose "main
branch" is not called `master`. Cargo currently pretty liberally assumes
that if nothing else about a git repository is specified then `master`
is the branch name to use. Instead now Cargo has a fourth option as the
desired reference of a repository named `DefaultBranch`. Cargo doesn't
know anything about the actual name of the default branch, it just
updates how git references are fetched internally.

This commit is motivated by news that GitHub is likely to switch away
from the default branch being named `master` in the near future. It
would be a bit of a bummer if from now on everyone had to type
`branch = '...'`, so this tries to improve that!

Closes #3517

4 years agoAuto merge of #8403 - matklad:abs-out-dir, r=Eh2406
bors [Wed, 24 Jun 2020 18:12:36 +0000 (18:12 +0000)]
Auto merge of #8403 - matklad:abs-out-dir, r=Eh2406

Document that OUT_DIR in JSON messages is an absolute path

4 years agoDocument that OUT_DIR in JSON messages is an absolute path
Aleksey Kladov [Wed, 24 Jun 2020 10:56:29 +0000 (12:56 +0200)]
Document that OUT_DIR in JSON messages is an absolute path

4 years agoAuto merge of #8387 - robinmoussu:master, r=alexcrichton
bors [Tue, 23 Jun 2020 16:21:21 +0000 (16:21 +0000)]
Auto merge of #8387 - robinmoussu:master, r=alexcrichton

Adding environment variable CARGO_PKG_LICENSE_FILE

When #8325 was added, only CARGO_PKG_LICENSE was added. However, the field license [may be empty](https://doc.rust-lang.org/cargo/reference/manifest.html#the-license-and-license-file-fields) if the license_field is filled in.

4 years agoAuto merge of #8391 - bl2e:install-target-dir, r=alexcrichton
bors [Tue, 23 Jun 2020 15:48:36 +0000 (15:48 +0000)]
Auto merge of #8391 - bl2e:install-target-dir, r=alexcrichton

Enable "--target-dir" in "cargo install"

Issue #8263

4 years agoAuto merge of #8323 - naerbnic:add_workspace_metadata_table, r=alexcrichton
bors [Tue, 23 Jun 2020 15:18:10 +0000 (15:18 +0000)]
Auto merge of #8323 - naerbnic:add_workspace_metadata_table, r=alexcrichton

Add support for `workspace.metadata` table

Implements feature request #8309

Additionally includes the information in the output of "cargo metadata" through a new top-level field `metadata`, similar to the per-package `metadata` field

4 years agoAuto merge of #8398 - ehuss:clean-reserved-name, r=Eh2406
bors [Mon, 22 Jun 2020 21:07:37 +0000 (21:07 +0000)]
Auto merge of #8398 - ehuss:clean-reserved-name, r=Eh2406

Fix overzealous `clean -p` for reserved names.

#8210 changed the way `clean -p` worked, but in some ways it is a little too sloppy.  If a package has a test named `build`, then it would delete the `build` directory thinking an executable named "build" exists.  This changes it so that it does not attempt to delete tests/benches from the uplift directory.

4 years agoFix overzealous `clean -p` for reserved names.
Eric Huss [Mon, 22 Jun 2020 19:56:10 +0000 (12:56 -0700)]
Fix overzealous `clean -p` for reserved names.

4 years agoAuto merge of #8395 - ehuss:fix-opt-dep-order, r=Eh2406
bors [Mon, 22 Jun 2020 00:35:00 +0000 (00:35 +0000)]
Auto merge of #8395 - ehuss:fix-opt-dep-order, r=Eh2406

Fix order-dependent feature resolution.

There is a situation where if you have `pkg/feature` syntax, and `pkg` is an optional dependency, but also a dev-dependency, and the dev-dependency appears before the (optional) normal dependency in the summary, then the optional dependency would not get activated. This is because the feature code used `find` to get the first entry.

Fixes #8394

4 years agoFix order-dependent feature resolution.
Eric Huss [Mon, 22 Jun 2020 00:28:36 +0000 (17:28 -0700)]
Fix order-dependent feature resolution.

4 years agoFix post-execution path checks to be compatible with Windows
bl2e [Sun, 21 Jun 2020 06:37:56 +0000 (23:37 -0700)]
Fix post-execution  path checks to be compatible with Windows

4 years agoFix test compatibility for Windows
bl2e [Sun, 21 Jun 2020 06:00:55 +0000 (23:00 -0700)]
Fix test compatibility for Windows

4 years agoReference options-target-dir in `cargo install` documentation
bl2e [Sun, 21 Jun 2020 04:29:02 +0000 (21:29 -0700)]
Reference options-target-dir in `cargo install` documentation

4 years agoAdd test for `cargo install` option `--target-dir`
bl2e [Sun, 21 Jun 2020 00:13:10 +0000 (17:13 -0700)]
Add test for `cargo install` option `--target-dir`

4 years agoEnable `--target-dir` support in `install` subcommand
bl2e [Thu, 18 Jun 2020 23:21:04 +0000 (16:21 -0700)]
Enable `--target-dir` support in `install` subcommand

4 years agoAuto merge of #8389 - hbina:spelling, r=ehuss
bors [Sat, 20 Jun 2020 19:29:18 +0000 (19:29 +0000)]
Auto merge of #8389 - hbina:spelling, r=ehuss

Correct mispelling of `cargo`.

4 years agoCorrect mispelling of `cargo`.
Hanif Bin Ariffin [Sat, 20 Jun 2020 18:33:20 +0000 (14:33 -0400)]
Correct mispelling of `cargo`.

4 years agoAuto merge of #8386 - crlf0710:master, r=ehuss
bors [Sat, 20 Jun 2020 16:06:52 +0000 (16:06 +0000)]
Auto merge of #8386 - crlf0710:master, r=ehuss

Add missing license field.

Hi, i was playing with `cargo-deny`, and found that it says this crate doesn't have a license field. So i'm going ahead and add it for consistency.

4 years agoAdding environment variable CARGO_PKG_LICENSE_FILE
Robin Moussu [Sat, 20 Jun 2020 10:01:35 +0000 (12:01 +0200)]
Adding environment variable CARGO_PKG_LICENSE_FILE

4 years agoAuto merge of #8325 - kerkmann:license-field-as-environment-variable, r=joshtriplett
bors [Sat, 20 Jun 2020 03:35:31 +0000 (03:35 +0000)]
Auto merge of #8325 - kerkmann:license-field-as-environment-variable, r=joshtriplett

Adding environment variable CARGO_PKG_LICENSE

Fixes #8024

4 years agoAdd missing license field.
CrLF0710 [Sat, 20 Jun 2020 02:03:25 +0000 (10:03 +0800)]
Add missing license field.

4 years agoImprove support for non-`master` main branches
Alex Crichton [Mon, 15 Jun 2020 21:06:03 +0000 (14:06 -0700)]
Improve support for non-`master` main branches

This commit improves Cargo's support for git repositories whose "main
branch" is not called `master`. Cargo currently pretty liberally assumes
that if nothing else about a git repository is specified then `master`
is the branch name to use. Instead now Cargo has a fourth option as the
desired reference of a repository named `DefaultBranch`. Cargo doesn't
know anything about the actual name of the default branch, it just
updates how git references are fetched internally.

This commit is motivated by news that GitHub is likely to switch away
from the default branch being named `master` in the near future. It
would be a bit of a bummer if from now on everyone had to type
`branch = '...'`, so this tries to improve that!

4 years agoAuto merge of #8363 - alexcrichton:less-git-data, r=ehuss
bors [Thu, 18 Jun 2020 17:14:16 +0000 (17:14 +0000)]
Auto merge of #8363 - alexcrichton:less-git-data, r=ehuss

Cut down on data fetch from git dependencies

Currently Cargo pretty heavily over-approximates data fetch for git
dependencies. For the index it fetches precisely one branch, but for all
other git dependencies Cargo will fetch all branches and all tags all
the time. In each of these situations, however, Cargo knows if one
branch is desired or if only one tag is desired.

This commit updates Cargo's fetching logic to plumb the desired
`GitReference` all the way down to `fetch`. In that one location we then
determine what to fetch. Namely if a branch or tag is explicitly
selected then we only fetch that one reference from the remote, cutting
down on the amount of traffic to the git remote.

Additionally a bugfix included here is that the GitHub fast path for
checking if a repository is up-to-date now works for non-`master`-based
branch dependencies.

4 years agoUpdate how locked git commits are fetched
Alex Crichton [Tue, 16 Jun 2020 16:02:01 +0000 (09:02 -0700)]
Update how locked git commits are fetched

This commit refactors various logic of the git source internals to
ensure that if we have a locked revision that we plumb the desired
branch/tag all the way through to the `fetch`. Previously we'd switch to
`Rev` very early on, but the fetching logic for `Rev` is very eager and
fetches too much, so instead we only resolve the locked revision later
on.

Internally this does some various refactoring to try to make various
bits and pieces of logic a bit easyer to grok, although it's still
perhaps not the cleanest implementation.

4 years agoStrip `.git` from urls on GitHub fast-path
Alex Crichton [Tue, 16 Jun 2020 15:31:19 +0000 (08:31 -0700)]
Strip `.git` from urls on GitHub fast-path

4 years agoCut down on data fetch from git dependencies
Alex Crichton [Mon, 15 Jun 2020 20:36:23 +0000 (13:36 -0700)]
Cut down on data fetch from git dependencies

Currently Cargo pretty heavily over-approximates data fetch for git
dependencies. For the index it fetches precisely one branch, but for all
other git dependencies Cargo will fetch all branches and all tags all
the time. In each of these situations, however, Cargo knows if one
branch is desired or if only one tag is desired.

This commit updates Cargo's fetching logic to plumb the desired
`GitReference` all the way down to `fetch`. In that one location we then
determine what to fetch. Namely if a branch or tag is explicitly
selected then we only fetch that one reference from the remote, cutting
down on the amount of traffic to the git remote.

Additionally a bugfix included here is that the GitHub fast path for
checking if a repository is up-to-date now works for non-`master`-based
branch dependencies.

4 years agoAuto merge of #8359 - ehuss:doctest-xcompile-linker, r=alexcrichton
bors [Mon, 15 Jun 2020 14:38:34 +0000 (14:38 +0000)]
Auto merge of #8359 - ehuss:doctest-xcompile-linker, r=alexcrichton

Support linker with -Zdoctest-xcompile.

This adds support for `-Clinker` with `-Zdoctest-xcompile`.

I'm not entirely sure how `-Zdoctest-xcompile` was supposed to work without setting the linker. I tested this with std on arm-unknown-linux-gnueabihf with qemu. It seems to work (although it was quite slow).

Closes #7529.

4 years agoAuto merge of #8358 - ehuss:fix-target-host-doctest, r=alexcrichton
bors [Mon, 15 Jun 2020 14:05:10 +0000 (14:05 +0000)]
Auto merge of #8358 - ehuss:fix-target-host-doctest, r=alexcrichton

Fix doctests not running with --target=HOST.

There was a regression in #8167 where `cargo test --target=$HOST` stopped running doctests. This caused doctests to silently stop running in rust-lang/rust (https://github.com/rust-lang/rust/issues/73286).  This PR restores the original behavior where `--target=$HOST` behaves as-if it is a normal host test.

There was a discussion about this at https://github.com/rust-lang/cargo/pull/8167#pullrequestreview-402196323, but I think I let it slip through the cracks.

4 years agoAuto merge of #8344 - kellda:install-index-flag, r=ehuss
bors [Sun, 14 Jun 2020 18:32:58 +0000 (18:32 +0000)]
Auto merge of #8344 - kellda:install-index-flag, r=ehuss

Allow passing a registry index url directly to `cargo install`

Fixes #8318

4 years agoAdd --index to `install` man page.
Eric Huss [Sun, 14 Jun 2020 18:30:48 +0000 (11:30 -0700)]
Add --index to `install` man page.

4 years agoSupport linker with -Zdoctest-xcompile.
Eric Huss [Sun, 14 Jun 2020 04:19:22 +0000 (21:19 -0700)]
Support linker with -Zdoctest-xcompile.

4 years agoFix doctests not running with --target=HOST.
Eric Huss [Sun, 14 Jun 2020 03:56:29 +0000 (20:56 -0700)]
Fix doctests not running with --target=HOST.

4 years agoUpdate src/doc/src/reference/manifest.md
naerbnic [Fri, 12 Jun 2020 00:01:19 +0000 (17:01 -0700)]
Update src/doc/src/reference/manifest.md

Add a link to the mdbook generated link

Co-authored-by: Eric Huss <eric@huss.org>
4 years agoUpdate src/doc/src/reference/workspaces.md
naerbnic [Fri, 12 Jun 2020 00:01:03 +0000 (17:01 -0700)]
Update src/doc/src/reference/workspaces.md

Remove anchor to use the mdbook generated link instead.

Co-authored-by: Eric Huss <eric@huss.org>
4 years agoAuto merge of #8353 - ehuss:fix-missing-readme, r=alexcrichton
bors [Thu, 11 Jun 2020 22:13:37 +0000 (22:13 +0000)]
Auto merge of #8353 - ehuss:fix-missing-readme, r=alexcrichton

Fix failure with missing readme.

#8277 added implicit README support, but it also rejected parsing any manifest where the README was missing.  This causes a problem because the README is often missing in many registry packages (for various reasons).

This removes the validation at parsing time.  Cargo has historically not had hard enforcement at the parsing stage.  Whether or not the readme exists has always been enforced during publishing. I have added some extra context to the error message, and added a test to that effect.

Fixes #8351

4 years agoFix failure with missing readme.
Eric Huss [Thu, 11 Jun 2020 21:55:33 +0000 (14:55 -0700)]
Fix failure with missing readme.

4 years agoAuto merge of #8349 - ehuss:fix-lto, r=alexcrichton
bors [Thu, 11 Jun 2020 15:34:15 +0000 (15:34 +0000)]
Auto merge of #8349 - ehuss:fix-lto, r=alexcrichton

Some LTO fixes.

This reworks the LTO computation a little to address a few issues:

- `cargo build` in a project with both a lib and bin would not engage the optimization introduced in #8192 where the lib *should* be compiled with `-C linker-plugin-lto` (bitcode only). This happened because the old code was starting root units as `Lto::None`. The solution here is to conditionally choose the starting Lto for roots.
- A project with a dylib dependency would fail to build. It was building the dylib with `-C linker-plugin-lto` which is not valid.
- A project with a bin/lib would build the lib differently based on whether or not it was selected. This changes it so that the lib is built the same. See `lto::between_builds`, where the second build the lib is now fresh.
- Tests/benchmarks of a `lib` target will now support LTO.
- Treats example libs a little more consistently as regular libs.

I scattered some comments throughout, hopefully it's not too difficult to follow.

Closes #8337

4 years agoSome LTO fixes.
Eric Huss [Wed, 10 Jun 2020 22:31:36 +0000 (15:31 -0700)]
Some LTO fixes.

4 years agoAdd test for `cargo install --index`
kellda [Wed, 10 Jun 2020 15:21:37 +0000 (15:21 +0000)]
Add test for `cargo install --index`

4 years agoAuto merge of #8277 - tverghis:default-readme, r=alexcrichton
bors [Tue, 9 Jun 2020 20:03:14 +0000 (20:03 +0000)]
Auto merge of #8277 - tverghis:default-readme, r=alexcrichton

Default values for `readme` if not specified

If the a value for `readme` is not specified in Cargo.toml, we will now check for the existence of files named `README.md`, `README.txt` or `README`. If one does exist, the name of that file will be defaulted in to the manifest for the project.

This behavior can be suppressed if `readme` is set to `false`.

Closes #8133

4 years agoCreate README file so tests pass
Tarun Verghis [Tue, 9 Jun 2020 07:15:28 +0000 (00:15 -0700)]
Create README file so tests pass

4 years agoAssume README.md if readme=true
Tarun Verghis [Tue, 9 Jun 2020 07:03:15 +0000 (00:03 -0700)]
Assume README.md if readme=true

4 years agoMerge branch 'master' into license-field-as-environment-variable
Daniél Kerkmann [Mon, 8 Jun 2020 19:24:02 +0000 (21:24 +0200)]
Merge branch 'master' into license-field-as-environment-variable

4 years agoAuto merge of #8342 - ehuss:fix-tree-completions, r=alexcrichton
bors [Mon, 8 Jun 2020 14:47:36 +0000 (14:47 +0000)]
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

4 years agoAuto merge of #8267 - drmikehenry:prefix, r=alexcrichton
bors [Mon, 8 Jun 2020 14:19:43 +0000 (14:19 +0000)]
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.

4 years agoAuto merge of #8270 - reggaemuffin:8251-binary-name-env-var, r=ehuss
bors [Mon, 8 Jun 2020 13:53:33 +0000 (13:53 +0000)]
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.

4 years agoAdd `--index` flag to `cargo install`
kellda [Mon, 8 Jun 2020 12:48:47 +0000 (12:48 +0000)]
Add `--index` flag to `cargo install`

4 years agoReformat
Brian Chin [Sun, 7 Jun 2020 22:59:35 +0000 (15:59 -0700)]
Reformat

4 years agoInline load_workspace_metadata() into Workspace::new()
Brian Chin [Sun, 7 Jun 2020 22:57:28 +0000 (15:57 -0700)]
Inline load_workspace_metadata() into Workspace::new()

4 years agoFix tree completions.
Eric Huss [Sun, 7 Jun 2020 22:09:47 +0000 (15:09 -0700)]
Fix tree completions.

4 years agoChange test 'MIT' license to 'MIT OR Apache-2.0'
Daniél Kerkmann [Sat, 6 Jun 2020 08:24:06 +0000 (10:24 +0200)]
Change test 'MIT' license to 'MIT OR Apache-2.0'

4 years agoAuto merge of #8336 - ehuss:version-bump, r=alexcrichton
bors [Fri, 5 Jun 2020 19:44:27 +0000 (19:44 +0000)]
Auto merge of #8336 - ehuss:version-bump, r=alexcrichton

Bump to 0.47.0, update changelog

4 years agoAuto merge of #8334 - Eh2406:small-nits, r=alexcrichton
bors [Fri, 5 Jun 2020 19:02:19 +0000 (19:02 +0000)]
Auto merge of #8334 - Eh2406:small-nits, r=alexcrichton

 Nits: Remove unneeded mut and loop

just some small nits.

4 years agoUpdate changelog for 1.45.
Eric Huss [Fri, 5 Jun 2020 18:45:47 +0000 (11:45 -0700)]
Update changelog for 1.45.

4 years agoRemove unneeded mut and loop
Eh2406 [Fri, 5 Jun 2020 18:04:24 +0000 (14:04 -0400)]
Remove unneeded mut and loop

4 years agoChange tag to avoid duplicate link
Brian Chin [Fri, 5 Jun 2020 17:15:40 +0000 (10:15 -0700)]
Change tag to avoid duplicate link

4 years agoBump to 0.47.0
Eric Huss [Fri, 5 Jun 2020 17:15:15 +0000 (10:15 -0700)]
Bump to 0.47.0

4 years agoAuto merge of #8331 - ehuss:1.45-beta-backport, r=Eh2406
bors [Fri, 5 Jun 2020 16:39:10 +0000 (16:39 +0000)]
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)

4 years agoExtract a `fn load_workspace_config()`
Brian Chin [Fri, 5 Jun 2020 05:05:23 +0000 (22:05 -0700)]
Extract a `fn load_workspace_config()`

Reword the documentation for the two `metadata` tables, and
suggest consistent usage.

4 years agoAdd support for `workspace.metadata` table
Brian Chin [Tue, 2 Jun 2020 19:33:13 +0000 (12:33 -0700)]
Add support for `workspace.metadata` table

4 years agoAuto merge of #8329 - ehuss:apple-no-hash, r=alexcrichton
bors [Fri, 5 Jun 2020 14:31:21 +0000 (14:31 +0000)]
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

4 years agoAuto merge of #8290 - ehuss:fix-lld-freshness, r=alexcrichton
bors [Wed, 27 May 2020 19:33:35 +0000 (19:33 +0000)]
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

4 years agoAuto merge of #8321 - hbina:issue_7596, r=alexcrichton
bors [Fri, 5 Jun 2020 14:56:20 +0000 (14:56 +0000)]
Auto merge of #8321 - hbina:issue_7596, r=alexcrichton

Better error message when passing in relative path to Workspace::new

Fixes #7596

4 years agoAuto merge of #8329 - ehuss:apple-no-hash, r=alexcrichton
bors [Fri, 5 Jun 2020 14:31:21 +0000 (14:31 +0000)]
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

4 years agoDon't hash executable filenames on apple platforms.
Eric Huss [Thu, 4 Jun 2020 23:14:17 +0000 (16:14 -0700)]
Don't hash executable filenames on apple platforms.

4 years agoAuto merge of #8324 - matthiaskrgr:clippy_v14, r=ehuss
bors [Thu, 4 Jun 2020 21:24:53 +0000 (21:24 +0000)]
Auto merge of #8324 - matthiaskrgr:clippy_v14, r=ehuss

fix clippy warnings

4 years agoPassing a relative path to Workspace now bails with proper message.
Hanif Bin Ariffin [Wed, 3 Jun 2020 15:38:34 +0000 (11:38 -0400)]
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.

4 years agoAdding environment variable CARGO_PKG_LICENSE
Daniél Kerkmann [Thu, 4 Jun 2020 00:51:16 +0000 (02:51 +0200)]
Adding environment variable CARGO_PKG_LICENSE

Fixes #8024

4 years agofix clippy warnings
Matthias Krüger [Wed, 3 Jun 2020 22:44:59 +0000 (00:44 +0200)]
fix clippy warnings

4 years agoAuto merge of #8320 - alexcrichton:update-libgit2, r=ehuss
bors [Wed, 3 Jun 2020 15:49:06 +0000 (15:49 +0000)]
Auto merge of #8320 - alexcrichton:update-libgit2, r=ehuss

Require latest libgit2 to pull in bugfixes

This'll pull in a fix for #8258

4 years agoAttemtping to solve Workspace using relative path.
Hanif Bin Ariffin [Wed, 3 Jun 2020 15:13:22 +0000 (11:13 -0400)]
Attemtping to solve Workspace using relative path.

4 years agoRequire latest libgit2 to pull in bugfixes
Alex Crichton [Wed, 3 Jun 2020 15:14:57 +0000 (08:14 -0700)]
Require latest libgit2 to pull in bugfixes

This'll pull in a fix for #8258

4 years agoAuto merge of #8319 - alexcrichton:fix-access, r=Eh2406
bors [Wed, 3 Jun 2020 15:03:10 +0000 (15:03 +0000)]
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

4 years agoFix an accidental raw access of field
Alex Crichton [Wed, 3 Jun 2020 14:38:21 +0000 (07:38 -0700)]
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

4 years agoAuto merge of #8314 - cuviper:mem-take, r=Eh2406
bors [Wed, 3 Jun 2020 02:02:36 +0000 (02:02 +0000)]
Auto merge of #8314 - cuviper:mem-take, r=Eh2406

Use mem::take to replace with Default values

4 years agoUse mem::take to replace with Default values
Josh Stone [Wed, 3 Jun 2020 01:03:33 +0000 (18:03 -0700)]
Use mem::take to replace with Default values

4 years agoAuto merge of #8310 - ehuss:allow-non-dll-suffix, r=Eh2406
bors [Tue, 2 Jun 2020 18:03:33 +0000 (18:03 +0000)]
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

4 years agoAllow Windows dylibs without dll suffix.
Eric Huss [Tue, 2 Jun 2020 17:50:55 +0000 (10:50 -0700)]
Allow Windows dylibs without dll suffix.

4 years agoAuto merge of #8307 - pickfire:alias-help, r=alexcrichton
bors [Tue, 2 Jun 2020 16:35:38 +0000 (16:35 +0000)]
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

4 years agoShow alias in help message
Ivan Tham [Tue, 2 Jun 2020 12:52:00 +0000 (20:52 +0800)]
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

4 years agoAuto merge of #8297 - mjarkk:warn-when-using-hash-in-git-url, r=ehuss
bors [Mon, 1 Jun 2020 22:35:00 +0000 (22:35 +0000)]
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

4 years agoAdd test
mjarkk [Mon, 1 Jun 2020 17:50:33 +0000 (19:50 +0200)]
Add test

4 years agoFix review
mjarkk [Mon, 1 Jun 2020 17:41:52 +0000 (19:41 +0200)]
Fix review

4 years agoUpdate src/cargo/util/toml/mod.rs
Mark Kopenga [Mon, 1 Jun 2020 17:34:39 +0000 (19:34 +0200)]
Update src/cargo/util/toml/mod.rs

Co-authored-by: Eric Huss <eric@huss.org>
4 years agoAuto merge of #8274 - Eh2406:8249-repro, r=alexcrichton
bors [Mon, 1 Jun 2020 16:01:10 +0000 (16:01 +0000)]
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

4 years agoAuto merge of #8301 - ehuss:disable-strip-macos, r=alexcrichton
bors [Mon, 1 Jun 2020 13:39:22 +0000 (13:39 +0000)]
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.

4 years agoDisable strip_works test on macos.
Eric Huss [Mon, 1 Jun 2020 04:55:36 +0000 (21:55 -0700)]
Disable strip_works test on macos.

4 years agoAuto merge of #8299 - kpp:master, r=ehuss
bors [Sun, 31 May 2020 23:30:19 +0000 (23:30 +0000)]
Auto merge of #8299 - kpp:master, r=ehuss

Fix typo in impl Display for Strip

4 years agoFix typo in impl Display for Strip
Roman Proskuryakov [Sun, 31 May 2020 22:43:51 +0000 (01:43 +0300)]
Fix typo in impl Display for Strip

4 years agoUpdate documentation as per review
Marvin Hofmann [Sun, 31 May 2020 20:01:03 +0000 (21:01 +0100)]
Update documentation as per review

4 years agoMove constructor fn for manifest with readme to test file
Tarun Verghis [Sat, 30 May 2020 21:14:50 +0000 (14:14 -0700)]
Move constructor fn for manifest with readme to test file