]> git.proxmox.com Git - cargo.git/log
cargo.git
4 years agoAuto merge of #8040 - ehuss:remove-git-checkout, r=alexcrichton
bors [Wed, 25 Mar 2020 23:49:38 +0000 (23:49 +0000)]
Auto merge of #8040 - ehuss:remove-git-checkout, r=alexcrichton

Remove the `git-checkout` subcommand.

This command has been broken for almost a year (since #6880), and nobody has mentioned it. The command isn't very useful (it checks out into cargo's `db` directory, which can also be accomplished with `cargo fetch`).  Since it doesn't have much utility, I don't see much reason to keep it around.

4 years agoRemove the `git-checkout` subcommand.
Eric Huss [Wed, 25 Mar 2020 22:23:53 +0000 (15:23 -0700)]
Remove the `git-checkout` subcommand.

4 years agoAuto merge of #8028 - ehuss:new-proc-macro-decouple, r=alexcrichton
bors [Tue, 24 Mar 2020 17:57:04 +0000 (17:57 +0000)]
Auto merge of #8028 - ehuss:new-proc-macro-decouple, r=alexcrichton

Re-implement proc-macro feature decoupling.

This is essentially a rewrite of #8003. Instead of adding proc-macro to the index, it uses a strategy of downloading all packages before doing feature resolution. Then the package can be inspected for the proc-macro field.

This is a fairly major change. A brief overview:
- `PackageSet` now has a `download_accessible` method which tries to download a minimal set of every accessible package. This isn't very smart right now, and errs on downloading too much. In most cases it should be the same (or nearly the same) as before. It downloads extra in the following cases:
    - The check for `[target]` dependencies checks both host and target for every dependency. I could tighten that up a little so build dependencies only check for the host, but it would add some complexity and I wanted to get feedback first.
    - Optional dependencies disabled by the new feature resolver will get downloaded.
- Removed the loop in computing unit dependencies where downloading used to reside.
- When downloading starts, it should now show a more accurate count of how many crates are to be downloaded. Previously the count would fluctuate while the graph is being built.

4 years agoAuto merge of #8023 - aleksator:8019_remove_adler32_dependency, r=alexcrichton
bors [Mon, 23 Mar 2020 16:30:16 +0000 (16:30 +0000)]
Auto merge of #8023 - aleksator:8019_remove_adler32_dependency, r=alexcrichton

Remove unused transitive dependencies: miniz_oxide, adler32

Fixes #8019

4 years agoRemove unused transitive dependencies: miniz_oxide, adler32
Alex Tokarev [Fri, 20 Mar 2020 18:28:17 +0000 (21:28 +0300)]
Remove unused transitive dependencies: miniz_oxide, adler32

Fixes #8019

4 years agoAuto merge of #8027 - ehuss:fix-features-dev_dep-check-test, r=alexcrichton
bors [Mon, 23 Mar 2020 13:59:11 +0000 (13:59 +0000)]
Auto merge of #8027 - ehuss:fix-features-dev_dep-check-test, r=alexcrichton

Fix bug with -Zfeatures=dev_dep and `check --profile=test`.

`-Zfeatures=dev_dep` with `cargo check --profile=test` would crash because the check of whether or not dev dependencies are needed erroneously ignored the "test" flag of `CompileMode::Check`.  The feature resolver needs to correctly know whether or not dev-dependencies are needed.

4 years agoRe-implement proc-macro feature decoupling.
Eric Huss [Sun, 22 Mar 2020 22:08:02 +0000 (15:08 -0700)]
Re-implement proc-macro feature decoupling.

4 years agoFix bug with -Zfeatures=dev_dep and `check --profile=test`.
Eric Huss [Sun, 22 Mar 2020 17:58:10 +0000 (10:58 -0700)]
Fix bug with -Zfeatures=dev_dep and `check --profile=test`.

4 years agoAuto merge of #8021 - ehuss:remove-cfg-from-options, r=alexcrichton
bors [Fri, 20 Mar 2020 14:27:26 +0000 (14:27 +0000)]
Auto merge of #8021 - ehuss:remove-cfg-from-options, r=alexcrichton

Remove Config from CompileOptions.

This removes Config from CompileOptions. This removes the lifetime parameters, which I think simplifies things slightly (with the drawback that Config now needs to be passed as a parameter to a few functions).

4 years agoRemove Config from CompileOptions.
Eric Huss [Thu, 19 Mar 2020 22:34:12 +0000 (15:34 -0700)]
Remove Config from CompileOptions.

4 years agoAuto merge of #7922 - XAMPPRocky:patch-1, r=ehuss
bors [Thu, 19 Mar 2020 14:40:18 +0000 (14:40 +0000)]
Auto merge of #7922 - XAMPPRocky:patch-1, r=ehuss

Add `rustless.org` to documented blocklist.

Sibling PR to rust-lang/crates.io#2202, don't merge or close until the sibling PR is resolved first.

4 years agoRemove note
XAMPPRocky [Thu, 19 Mar 2020 09:17:18 +0000 (10:17 +0100)]
Remove note

4 years agoAuto merge of #8017 - aleksator:3672_color_build_script_warnings_on_panic, r=ehuss
bors [Wed, 18 Mar 2020 19:35:24 +0000 (19:35 +0000)]
Auto merge of #8017 - aleksator:3672_color_build_script_warnings_on_panic, r=ehuss

Print colored warnings when build script panics

Fixes #3672

4 years agoAuto merge of #8014 - aleksator:crate_version_in_rustdocflags, r=ehuss
bors [Wed, 18 Mar 2020 19:17:08 +0000 (19:17 +0000)]
Auto merge of #8014 - aleksator:crate_version_in_rustdocflags, r=ehuss

Do not supply --crate-version flag to rustdoc if present in RUSTDOCFLAGS

Checks for the flag in extra compiler arguments as well

4 years agoPrint colored warnings when build script panics
Alex Tokarev [Wed, 18 Mar 2020 17:48:19 +0000 (20:48 +0300)]
Print colored warnings when build script panics

Fixes #3672

4 years agoDo not supply --crate-version flag to rustdoc if present in RUSTDOCFLAGS or extra...
Alex Tokarev [Wed, 18 Mar 2020 18:26:49 +0000 (21:26 +0300)]
Do not supply --crate-version flag to rustdoc if present in RUSTDOCFLAGS or extra compiler arguments

4 years agoAuto merge of #8003 - ehuss:proc-macro-index, r=alexcrichton
bors [Wed, 18 Mar 2020 14:00:07 +0000 (14:00 +0000)]
Auto merge of #8003 - ehuss:proc-macro-index, r=alexcrichton

Add proc-macro to index, and new feature resolver.

This adds the "pm" field to the index so that Cargo can detect which packages contain a proc-macro without downloading the package.

The second commit builds on that to support proc-macros in the new "de-unification" of the new feature resolver. This prevents dependencies shared between proc-macros and other dependency kinds from having features unified.

cc #7915

4 years agoUpdate registry documentation with new proc-macro field.
Eric Huss [Tue, 17 Mar 2020 23:55:39 +0000 (16:55 -0700)]
Update registry documentation with new proc-macro field.

4 years agoAuto merge of #8015 - aleksator:run_through_clippy, r=alexcrichton
bors [Tue, 17 Mar 2020 21:02:00 +0000 (21:02 +0000)]
Auto merge of #8015 - aleksator:run_through_clippy, r=alexcrichton

Run through clippy

4 years agoRun through clippy
Alex Tokarev [Tue, 17 Mar 2020 19:31:09 +0000 (22:31 +0300)]
Run through clippy

4 years agoAuto merge of #8012 - ehuss:fix-config-profile-test, r=alexcrichton
bors [Tue, 17 Mar 2020 17:47:28 +0000 (17:47 +0000)]
Auto merge of #8012 - ehuss:fix-config-profile-test, r=alexcrichton

Fix config profiles using "dev" in `cargo test`.

Fix a bug where the "dev" profile was not loaded from config when running `cargo test` when "dev" is not listed in `Cargo.toml`.

There was a mistake in #7750 where it did not consider implicit profiles. Config profiles need to be loaded explicitly in order to properly handle environment variables. However, it was only looking at the profile requested on the command-line and those listed in `Cargo.toml`. `cargo test` also implicitly uses the "dev" profile for dependencies, so make sure those are loaded from config as well.

4 years agoFix config profiles using "dev" in `cargo test`.
Eric Huss [Tue, 17 Mar 2020 17:29:27 +0000 (10:29 -0700)]
Fix config profiles using "dev" in `cargo test`.

4 years agoAuto merge of #8011 - ehuss:pr-ci, r=alexcrichton
bors [Tue, 17 Mar 2020 16:14:51 +0000 (16:14 +0000)]
Auto merge of #8011 - ehuss:pr-ci, r=alexcrichton

Run CI on all PRs.

I think we want PRs to be tested on all branches (such as beta branches). This is the default for Azure, so there's no need to specify the PR trigger.

4 years agoRun CI on all PRs.
Eric Huss [Tue, 17 Mar 2020 15:37:40 +0000 (08:37 -0700)]
Run CI on all PRs.

4 years agoAuto merge of #7977 - ehuss:unit-graph, r=alexcrichton
bors [Tue, 17 Mar 2020 14:06:50 +0000 (14:06 +0000)]
Auto merge of #7977 - ehuss:unit-graph, r=alexcrichton

Add unit-graph JSON output.

This adds a `--unit-graph` flag that will emit a JSON object of Cargo's internal build graph.  See unstable.md for more details.

The primary motivator is to provide an accurate picture of which features are set. With the new feature resolver it is not possible to properly represent the features in the `cargo metadata` structure, because features are no longer unified.  Also, features selected depend on the command, and exactly which packages are being built.  To handle that in `cargo metadata`, it would need to add a "mode" flag, and a superset of flags for all build commands (test, check, build, etc.). To me that seemed like a difficult path to take.

This may also be helpful for making visualizations of the true dependencies.  `cargo metadata` doesn't show the intra-package dependencies like build scripts or test units, and walking the `cargo metadata` graph correctly isn't always obvious.

This initial concept exposes almost all of the fields. That may be a little too much, but I imagine we could always trim it before stabilizing.  This structure also has a high risk of being unstable, since it has a good chance of changing form in the future.  I figure that can be addressed with documentation emphasizing that it may change and we may not always provide backwards-compatibility (though we will try if it is not too much burden).

This could also potentially be extended in the future to include things like artifact paths, or "freshness", if we'd like to.

4 years agoAuto merge of #8008 - aleksator:refactor_workspace_validate, r=ehuss
bors [Tue, 17 Mar 2020 01:23:17 +0000 (01:23 +0000)]
Auto merge of #8008 - aleksator:refactor_workspace_validate, r=ehuss

Split workspace/validate() into multiple functions

4 years agoSplit workspace/validate() into multiple functions
Alex Tokarev [Sat, 14 Mar 2020 14:37:44 +0000 (17:37 +0300)]
Split workspace/validate() into multiple functions

4 years agoAuto merge of #8005 - ehuss:as_deref, r=Eh2406
bors [Mon, 16 Mar 2020 02:00:05 +0000 (02:00 +0000)]
Auto merge of #8005 - ehuss:as_deref, r=Eh2406

Use Option::as_deref

[`Option::as_deref`](https://doc.rust-lang.org/std/option/enum.Option.html#method.as_deref) was stabilized in 1.40.  I think it is slightly cleaner looking (though it requires the reader to know what the method does).

4 years agoUse Option::as_deref
Eric Huss [Mon, 16 Mar 2020 01:51:38 +0000 (18:51 -0700)]
Use Option::as_deref

4 years agoAuto merge of #7993 - Eh2406:deduplicate-eges, r=ehuss
bors [Mon, 16 Mar 2020 00:46:55 +0000 (00:46 +0000)]
Auto merge of #7993 - Eh2406:deduplicate-eges, r=ehuss

De-duplicate edges

This is a quick fix for #7985. It is possible to have more than one dependency that connects two packages, if one is a dev and one a regular. The code has use a `Vec` to represent that potential multiplicity. This switches it to a `HashSet` to fix #7985. But if there is only a handful of ways we can have more than one then perhaps we can do something with less indirection/allocations.

Note that #7168 (which was already abandoned) will need to be redesigned for whatever we do for this.

4 years agoElaborate on motivation of --unit-graph.
Eric Huss [Sun, 15 Mar 2020 22:23:10 +0000 (15:23 -0700)]
Elaborate on motivation of --unit-graph.

4 years ago-Zfeatures=host_dep: Support decoupling proc-macro features.
Eric Huss [Sun, 15 Mar 2020 22:59:42 +0000 (15:59 -0700)]
-Zfeatures=host_dep: Support decoupling proc-macro features.

4 years agoAdd unit-graph JSON output.
Eric Huss [Sun, 8 Mar 2020 22:12:18 +0000 (15:12 -0700)]
Add unit-graph JSON output.

4 years agoAdd proc-macro to the index.
Eric Huss [Sun, 15 Mar 2020 17:10:25 +0000 (10:10 -0700)]
Add proc-macro to the index.

4 years agoAuto merge of #7935 - cwndrws:revert-removal-of-mtime-preservation, r=ehuss
bors [Sat, 14 Mar 2020 22:11:11 +0000 (22:11 +0000)]
Auto merge of #7935 - cwndrws:revert-removal-of-mtime-preservation, r=ehuss

Revert "Disable preserving mtimes on archives"

This reverts commit 8c92e88765817877f53a9cfb70c3e39853456868.

Fixes #7590

4 years agoAuto merge of #7533 - yaahc:clippy-banishment, r=ehuss
bors [Sat, 14 Mar 2020 20:50:15 +0000 (20:50 +0000)]
Auto merge of #7533 - yaahc:clippy-banishment, r=ehuss

Close the front door for clippy but open the back

4 years agoAuto merge of #7999 - aleksator:fix_changelog_typos, r=ehuss
bors [Sat, 14 Mar 2020 17:41:14 +0000 (17:41 +0000)]
Auto merge of #7999 - aleksator:fix_changelog_typos, r=ehuss

Fix CHANGELOG.md typos

Fixed `pacakges` typo and reworded another sentence since `expressioned` isn't a word.

4 years agoFix CHANGELOG.md typos
Alex Tokarev [Sat, 14 Mar 2020 10:21:56 +0000 (13:21 +0300)]
Fix CHANGELOG.md typos

4 years agoAuto merge of #7998 - rust-lang:ehuss-patch-1, r=Eh2406
bors [Sat, 14 Mar 2020 16:37:52 +0000 (16:37 +0000)]
Auto merge of #7998 - rust-lang:ehuss-patch-1, r=Eh2406

Update changelog note about crate-versions flag.

4 years agoUpdate changelog note about crate-versions flag.
Eric Huss [Sat, 14 Mar 2020 16:35:01 +0000 (09:35 -0700)]
Update changelog note about crate-versions flag.

4 years agoAuto merge of #7997 - ehuss:version-bump, r=alexcrichton
bors [Sat, 14 Mar 2020 05:19:25 +0000 (05:19 +0000)]
Auto merge of #7997 - ehuss:version-bump, r=alexcrichton

Bump to 0.45.0, update changelog

4 years agoBump to 0.45.0.
Eric Huss [Sat, 14 Mar 2020 02:25:40 +0000 (19:25 -0700)]
Bump to 0.45.0.

4 years agoUpdate changelog for 1.43.
Eric Huss [Sat, 14 Mar 2020 02:23:56 +0000 (19:23 -0700)]
Update changelog for 1.43.

4 years agofix unix cfg on include
Jane Lusby [Fri, 13 Mar 2020 22:31:33 +0000 (15:31 -0700)]
fix unix cfg on include

4 years agorustfmt
Jane Lusby [Fri, 13 Mar 2020 22:02:55 +0000 (15:02 -0700)]
rustfmt

4 years agoswitch from bash script to rust program
Jane Lusby [Fri, 13 Mar 2020 21:59:41 +0000 (14:59 -0700)]
switch from bash script to rust program

4 years agoAuto merge of #7996 - alexcrichton:update-git2, r=Eh2406
bors [Fri, 13 Mar 2020 19:47:44 +0000 (19:47 +0000)]
Auto merge of #7996 - alexcrichton:update-git2, r=Eh2406

Bump libgit2 dependencies

Brings in rust-lang/git2-rs#527

Closes #7466
Closes #7988

4 years agoBump libgit2 dependencies
Alex Crichton [Fri, 13 Mar 2020 19:26:46 +0000 (12:26 -0700)]
Bump libgit2 dependencies

Brings in rust-lang/git2-rs#527

Closes #7466
Closes #7988

4 years agoClose the front door for clippy but open the back
Jane Lusby [Tue, 22 Oct 2019 14:53:51 +0000 (07:53 -0700)]
Close the front door for clippy but open the back

4 years agocargo +stable fmt
Eh2406 [Thu, 12 Mar 2020 18:02:38 +0000 (14:02 -0400)]
cargo +stable fmt

4 years agoAuto merge of #7838 - ehuss:fix-memory-rustc-output, r=alexcrichton
bors [Thu, 12 Mar 2020 16:55:12 +0000 (16:55 +0000)]
Auto merge of #7838 - ehuss:fix-memory-rustc-output, r=alexcrichton

Avoid buffering large amounts of rustc output.

If `rustc` prints out a lot of information (such as with `RUSTC_LOG`, or a huge number of diagnostics), cargo would buffer up large amounts of that in memory.  For normal builds, this would happen if the terminal does not print fast enough. For "fresh" replay, *everything* was being buffered.

There are two issues:
1. There is no back-pressure on the mpsc queue.  If messages come in faster than they can be processed, it grows without bounds.
2. The cache-replay code runs in the "fresh" code path which does not spawn a thread. Thus the main thread was blocked and unable to process `Message`s while the replay is happening.

The solution here is to use a bounded queue, and to always spawn a thread for the "fresh" case.

The main concern here is performance.  Previously the "fresh" jobs avoided spawning a thread to improve performance.  I did a fair bit of profiling to understand the impact, using projects with anywhere from 100 to 500 units.  On my macOS machine, I found spawning a thread to be slightly faster (1-5%).  On Linux and Windows, it was generally about 0 to 5% slower.  It might be helpful for others to profile it on their own system.

I'm on the fence for the cost/benefit here.  It seems generally good to reduce memory usage, but the slight performance hit is disappointing.  I tried several other approaches to fix this, all with worse trade offs (I can discuss them if interested).

Fixes #6197

4 years agograph can use HashSet
Eh2406 [Thu, 12 Mar 2020 16:53:03 +0000 (12:53 -0400)]
graph can use HashSet

4 years agoparents can use a HashSet
Eh2406 [Thu, 12 Mar 2020 16:37:10 +0000 (12:37 -0400)]
parents can use a HashSet

4 years agoAuto merge of #7989 - ehuss:git-submodule-updating, r=alexcrichton
bors [Thu, 12 Mar 2020 15:55:24 +0000 (15:55 +0000)]
Auto merge of #7989 - ehuss:git-submodule-updating, r=alexcrichton

Add "Updating" status for git submodules.

This adds a status message when updating a git submodule.  Downloading these can be very slow (often submodules are much larger than their parents).  I think it is helpful to provide some more feedback as to what it is doing.

4 years agoAuto merge of #7990 - ehuss:workspace-resolve-lifetime, r=alexcrichton
bors [Thu, 12 Mar 2020 15:32:48 +0000 (15:32 +0000)]
Auto merge of #7990 - ehuss:workspace-resolve-lifetime, r=alexcrichton

WorkspaceResolve: Use descriptive lifetime label.

I find it helpful to have descriptive lifetime names.

4 years agoWorkspaceResolve: Use descriptive lifetime label.
Eric Huss [Thu, 12 Mar 2020 02:31:38 +0000 (19:31 -0700)]
WorkspaceResolve: Use descriptive lifetime label.

4 years agoAdd "Updating" status for git submodules.
Eric Huss [Thu, 12 Mar 2020 01:37:31 +0000 (18:37 -0700)]
Add "Updating" status for git submodules.

4 years agoAuto merge of #7983 - ehuss:fix-old-manifest-anchors, r=alexcrichton
bors [Tue, 10 Mar 2020 21:20:10 +0000 (21:20 +0000)]
Auto merge of #7983 - ehuss:fix-old-manifest-anchors, r=alexcrichton

Support old html anchors in manifest chapter.

#7733 unintentionally broke some old HTML anchors in the manifest chapter.  This would cause any links out in the wild to not scroll to the correct position.

Unfortunately it is too late for the 1.42 release.  However, I'd like to backport this for 1.43.

4 years agoSupport old html anchors in manifest chapter.
Eric Huss [Tue, 10 Mar 2020 19:50:31 +0000 (12:50 -0700)]
Support old html anchors in manifest chapter.

4 years agoUse wait_while for Condvar in Queue to simplify code.
Eric Huss [Tue, 10 Mar 2020 19:23:12 +0000 (12:23 -0700)]
Use wait_while for Condvar in Queue to simplify code.

4 years agoAdd test for caching large output.
Eric Huss [Tue, 10 Mar 2020 17:55:04 +0000 (10:55 -0700)]
Add test for caching large output.

4 years agoAvoid buffering large amounts of rustc output.
Eric Huss [Sun, 8 Mar 2020 03:58:37 +0000 (19:58 -0800)]
Avoid buffering large amounts of rustc output.

4 years agoReplace `std::sync::mpsc` with a much simpler queue
Alex Crichton [Wed, 29 Jan 2020 08:21:19 +0000 (00:21 -0800)]
Replace `std::sync::mpsc` with a much simpler queue

We don't need the complexity of most channels since this is not a
performance sensitive part of Cargo, nor is it likely to be so any time
soon. Coupled with recent bugs (#7840) we believe in `std::sync::mpsc`,
let's just not use that and use a custom queue type locally which should
be amenable to a blocking push soon too.

4 years agoAuto merge of #7965 - jiegec:master, r=alexcrichton
bors [Thu, 5 Mar 2020 23:02:29 +0000 (23:02 +0000)]
Auto merge of #7965 - jiegec:master, r=alexcrichton

Don't create hardlink for library test and integrations tests, fixing #7960

Related issue: #7960

Problem:

Tests are run under deps, but it is still copied to its parent directory. It leads to separation between the executable and its debug symbols (.dSYM directory).

Solution:

Set hardlink to None.

4 years agoAuto merge of #7970 - ehuss:revert-debug-assert-filter, r=alexcrichton
bors [Thu, 5 Mar 2020 17:09:08 +0000 (17:09 +0000)]
Auto merge of #7970 - ehuss:revert-debug-assert-filter, r=alexcrichton

Partially revert change to filter debug_assertions.

This partially reverts the changes from #7943. It caused a regression with the rocket_contrib crate. I knew that was the only crate that had a `cfg(debug_assertions)` dependency, and I saw that it had been fixed, but I did not realize the fix hadn't been published (and will be in a semver incompatible release).

This retains the old behavior for `cfg(debug_assertions)` of issuing a warning. I kept the filter for `CARGO_CFG_DEBUG_ASSERTIONS` for build scripts because that was the original intent for the change, and I don't see anyone using that.

Closes #7966.

4 years agoPartially revert change to filter debug_assertions.
Eric Huss [Thu, 5 Mar 2020 16:20:52 +0000 (08:20 -0800)]
Partially revert change to filter debug_assertions.

4 years agoRevert "Disable preserving mtimes on archives"
Charlie Andrews [Wed, 26 Feb 2020 00:43:34 +0000 (18:43 -0600)]
Revert "Disable preserving mtimes on archives"

This reverts commit 8c92e88765817877f53a9cfb70c3e39853456868.

4 years agoDon't create hardlink for library test, integrations tests and benches, fixing #7960
Jiajie Chen [Wed, 4 Mar 2020 10:12:21 +0000 (18:12 +0800)]
Don't create hardlink for library test, integrations tests and benches, fixing #7960

4 years agoAuto merge of #7959 - ehuss:restricted-crate-names, r=alexcrichton
bors [Wed, 4 Mar 2020 15:37:33 +0000 (15:37 +0000)]
Auto merge of #7959 - ehuss:restricted-crate-names, r=alexcrichton

Try to better handle restricted crate names.

This attempts to improve handling of restricted crate names, particularly for `cargo new` and `cargo init`. Hopefully the code is straightforward to follow, but in summary the changes are:

**General changes**

* Add more details to the error messages about why a name is not allowed, and what is allowed.
* Change the valid package name check to be restricted to Unicode XID. This brings it in line with non_ascii_idents support in rustc. For the most part, this is pretty much the same as before. Note: this is used for the package name, and registry names. The differences are:
    * Package names cannot start with numbers. Previously this was only rejected in `cargo new`. crates.io also rejects numbers. Numbers are also not valid crate names.
    * Package names cannot start with dash `-`. This is a somewhat arbitrary change, but seems like it would stem problems. crates.io also rejects this.
    * Package names cannot start with these characters that were previously allowed: https://gist.github.com/ehuss/804a797950001b5226e1264b6f65211f#file-not_start_but_alphanumeric-txt
        * Most of these are wacky numbers or other strange things.
    * Package names cannot contain these characters that were previously allowed: https://gist.github.com/ehuss/804a797950001b5226e1264b6f65211f#file-not_continue_but_alphanumeric-txt
        * These are mostly odd things that for whatever reason the Unicode people decided not to include. It seems unlikely to me that someone would want to use one of these.
* Display a warning on Windows if a Cargo target is a special Windows filename. The build error tends to be hard to understand, so the hope is the warning will make it evident.
* `cargo package/publish`: Warn if a special Windows name is in the package.

**cargo new/init specific changes**

* Update keyword list to 2018 edition.
* Add warning if creating a library that has one of the conflicting names (deps/examples/build/incremental).
* Warn about conflicting std names (core/std/alloc/proc-macro).
* Windows reserved names: Rejected on windows, warned on other platforms.
* Warn about non-ASCII package names.
* Only print the `--name` suggestion for `cargo init`. I found the suggestion confusing, and I feel like it doesn't really make sense for `cargo new` (since it would only affect the directory name).

4 years agoAuto merge of #7962 - ehuss:features2-required-feature-inactive, r=alexcrichton
bors [Tue, 3 Mar 2020 20:17:11 +0000 (20:17 +0000)]
Auto merge of #7962 - ehuss:features2-required-feature-inactive, r=alexcrichton

Fix bug with new feature resolver and required-features.

If required-features are used, then the code for checking those features would crash if a dependency was not activated.  The solution here is to not be strict about only requesting activated packages.

For context, the reason this can panic is to check for any bugs in the resolver or places that make bad assumptions.  I missed this particular case, though.

4 years agoFix bug with new feature resolver and required-features.
Eric Huss [Tue, 3 Mar 2020 19:46:37 +0000 (11:46 -0800)]
Fix bug with new feature resolver and required-features.

4 years agoWarn when packaging files with Windows special names.
Eric Huss [Tue, 3 Mar 2020 00:14:36 +0000 (16:14 -0800)]
Warn when packaging files with Windows special names.

4 years agoWarn on Windows about reserved target names.
Eric Huss [Mon, 2 Mar 2020 22:47:38 +0000 (14:47 -0800)]
Warn on Windows about reserved target names.

4 years agoTry to better handle restricted crate names.
Eric Huss [Mon, 2 Mar 2020 22:26:21 +0000 (14:26 -0800)]
Try to better handle restricted crate names.

4 years agoAuto merge of #7956 - ehuss:fix-collision-test, r=alexcrichton
bors [Mon, 2 Mar 2020 18:05:34 +0000 (18:05 +0000)]
Auto merge of #7956 - ehuss:fix-collision-test, r=alexcrichton

Fix rare failure in collision_export test.

Seen once on CI in #7952 (https://dev.azure.com/rust-lang/cargo/_build/results?buildId=22112&view=logs&j=a5e52b91-c83f-5429-4a68-c246fc63a4f7&t=d4864165-4be3-5e34-b483-a6b05303aa68). I was able to reproduce it locally, though it is rare. There seems to be some kind of race issue on macOS with two processes trying to symlink the same directory at the same time. The solution is to serialize the build so they don't run at the same time.

4 years agoFix rare failure in collision_export test.
Eric Huss [Mon, 2 Mar 2020 17:46:39 +0000 (09:46 -0800)]
Fix rare failure in collision_export test.

4 years agoAuto merge of #7947 - quark-zju:ignore-broken-git, r=ehuss
bors [Mon, 2 Mar 2020 17:38:11 +0000 (17:38 +0000)]
Auto merge of #7947 - quark-zju:ignore-broken-git, r=ehuss

Ignore broken Cargo.toml in git sources

Commit 3d6de4177489a5d450f35e92288512be85492678 (#3998) made cargo
ignore Cargo.toml files that are invalid TOML in a git source.
This change further ignores Cargo.toml files that are valid TOML but
cannot really be loaded in a git source.

This is potentially an alternative fix for #6822.

4 years agoAuto merge of #7952 - ehuss:fingerprint-mtime-debug-extra, r=alexcrichton
bors [Mon, 2 Mar 2020 17:21:22 +0000 (17:21 +0000)]
Auto merge of #7952 - ehuss:fingerprint-mtime-debug-extra, r=alexcrichton

Add more fingerprint mtime debug logging.

Adding some more debug logging on top of #7888.

There was a mistake in the original PR, where `dep.pkg_id` should have been `dep.name`.

4 years agoAuto merge of #7955 - ehuss:fix-plugin-syntax-rename, r=alexcrichton
bors [Mon, 2 Mar 2020 16:54:53 +0000 (16:54 +0000)]
Auto merge of #7955 - ehuss:fix-plugin-syntax-rename, r=alexcrichton

Fix plugin tests for latest nightly.

Crate was renamed in https://github.com/rust-lang/rust/pull/69592.

4 years agoFix plugin tests for latest nightly.
Eric Huss [Mon, 2 Mar 2020 16:52:30 +0000 (08:52 -0800)]
Fix plugin tests for latest nightly.

4 years agoAdd more fingerprint mtime debug logging.
Eric Huss [Sat, 29 Feb 2020 18:56:34 +0000 (10:56 -0800)]
Add more fingerprint mtime debug logging.

4 years agoIgnore broken Cargo.toml in git sources
Jun Wu [Fri, 28 Feb 2020 23:52:19 +0000 (15:52 -0800)]
Ignore broken Cargo.toml in git sources

Commit 3d6de4177489a5d450f35e92288512be85492678 (#3998) made cargo
ignore Cargo.toml files that are invalid TOML in a git source.
This change further ignores Cargo.toml files that are valid TOML but
cannot really be loaded.

This is potentially an alternative fix for #6822.

4 years agoAuto merge of #7945 - hbina:small_change_to_siphasher, r=alexcrichton
bors [Fri, 28 Feb 2020 19:16:36 +0000 (19:16 +0000)]
Auto merge of #7945 - hbina:small_change_to_siphasher, r=alexcrichton

Simplified usage code of SipHasher

SipHasher::new_with_keys(0,0) is just a longer version of just _::new()
i.e. the latter is an alias for the former.

Just a bit of a nothing burger I noticed while debugging some other issue.

4 years agoAuto merge of #7944 - aleksator:7469_git_config_discovery, r=ehuss
bors [Fri, 28 Feb 2020 18:52:43 +0000 (18:52 +0000)]
Auto merge of #7944 - aleksator:7469_git_config_discovery, r=ehuss

Add a special case for git config discovery inside tests

Fixes #7469: Some tests will fail if one have a local git config user.name/user.email

4 years agoAuto merge of #7946 - hbina:add_stream_hashu64, r=alexcrichton
bors [Fri, 28 Feb 2020 18:35:27 +0000 (18:35 +0000)]
Auto merge of #7946 - hbina:add_stream_hashu64, r=alexcrichton

Fixes issue #7543

Added a helper function for `util::hex::hash_64` that uses streams
the content instead of reading through the entire content in one
go.

Edit: Should I add test cases for this?

Edit2: Per #7543

4 years agoAdd a special case for git config discovery inside tests
Alex Tokarev [Thu, 27 Feb 2020 16:34:16 +0000 (19:34 +0300)]
Add a special case for git config discovery inside tests

Fixes #7469: Some tests will fail if one have a local git config user.name/user.email

4 years agohash_u64_file now returns an Error instead of panicking.
Hanif Bin Ariffin [Thu, 27 Feb 2020 22:30:19 +0000 (17:30 -0500)]
hash_u64_file now returns an Error instead of panicking.

4 years agoFix erronous error with call to write
Hanif Bin Ariffin [Thu, 27 Feb 2020 22:14:24 +0000 (17:14 -0500)]
Fix erronous error with call to write

4 years agoFixes issue #7543
Hanif Bin Ariffin [Thu, 27 Feb 2020 21:44:50 +0000 (16:44 -0500)]
Fixes issue #7543

Added a helper function for util::hex::hash_64 that uses streams
the content instead of reading through the entire content in one
go.

4 years agoSimplified usage code of SipHasher
Hanif Bin Ariffin [Thu, 27 Feb 2020 19:16:05 +0000 (14:16 -0500)]
Simplified usage code of SipHasher

SipHasher::new_with_keys(0,0) is just a longer version of just _::new()
i.e. the latter is an alias for the former.

4 years agoAuto merge of #7943 - aleksator:7933_cargo_cfgs, r=ehuss
bors [Thu, 27 Feb 2020 17:12:21 +0000 (17:12 +0000)]
Auto merge of #7943 - aleksator:7933_cargo_cfgs, r=ehuss

Filter out cfgs which should not be used during build

Fixes #7933: Filter invalid CARGO_CFG_ in build scripts

4 years agoAuto merge of #7934 - ehuss:query-error-context, r=Eh2406
bors [Thu, 27 Feb 2020 16:37:10 +0000 (16:37 +0000)]
Auto merge of #7934 - ehuss:query-error-context, r=Eh2406

Provide extra context on a query failure.

This adds error context when a query fails, primarily to tell you which parent package included the dependency that failed. For example, imagine deep within your dependency graph you have a `git` dependency, and it fails to download. The current error doesn't tell you where in the graph that `git` dependency was included.

I also slightly tweaked the `failed to load source` error message. I felt like the existing wording could be misinterpreted that it was an error loading the dependency *for* the given package. I felt like there were multiple ways to interpret it, so I tried to simplify it to avoid that possibility.

4 years agoAdd path to the failure to load a dependency.
Eric Huss [Thu, 27 Feb 2020 16:17:18 +0000 (08:17 -0800)]
Add path to the failure to load a dependency.

4 years agoFilter out cfgs which should not be used during build
Alex Tokarev [Tue, 25 Feb 2020 18:28:36 +0000 (21:28 +0300)]
Filter out cfgs which should not be used during build

Fixes #7933: Filter invalid CARGO_CFG_ in build scripts

4 years agoAuto merge of #7927 - ehuss:metadata-docs-clarify, r=alexcrichton
bors [Wed, 26 Feb 2020 21:00:00 +0000 (21:00 +0000)]
Auto merge of #7927 - ehuss:metadata-docs-clarify, r=alexcrichton

Try to clarify `cargo metadata`'s relationship with the workspace.

Closes #7893

4 years agoAuto merge of #7939 - alexcrichton:update-libgit2, r=Eh2406
bors [Wed, 26 Feb 2020 18:02:06 +0000 (18:02 +0000)]
Auto merge of #7939 - alexcrichton:update-libgit2, r=Eh2406

Update libgit2 dependency

Brings in a few CVE fixes and such for libgit2, bringing libgit to
0.99.0

4 years agoUpdate libgit2 dependency
Alex Crichton [Wed, 26 Feb 2020 17:39:05 +0000 (09:39 -0800)]
Update libgit2 dependency

Brings in a few CVE fixes and such for libgit2, bringing libgit to
0.99.0

4 years agoAuto merge of #7936 - giraffate:fix_link, r=alexcrichton
bors [Wed, 26 Feb 2020 05:22:50 +0000 (05:22 +0000)]
Auto merge of #7936 - giraffate:fix_link, r=alexcrichton

Fix link in comment

https://doc.rust-lang.org/grammar.html#keywords seems to move to https://doc.rust-lang.org/reference/keywords.html.

4 years agoFix link in comment
Takayuki Nakata [Wed, 26 Feb 2020 02:16:55 +0000 (11:16 +0900)]
Fix link in comment

This link seems to move to https://doc.rust-lang.org/reference/keywords.html.

4 years agoAuto merge of #7932 - ehuss:enable-doc-open-macos, r=alexcrichton
bors [Tue, 25 Feb 2020 18:43:31 +0000 (18:43 +0000)]
Auto merge of #7932 - ehuss:enable-doc-open-macos, r=alexcrichton

Enable `cargo doc --open` tests on macos.

Now that #7576 is merged, these tests should work fine on macos.