9180 Commits

Author SHA1 Message Date
bors
7302186d7b Auto merge of #7533 - yaahc:clippy-banishment, r=ehuss
Close the front door for clippy but open the back
2020-03-14 20:50:15 +00:00
bors
b734683b7c 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.
2020-03-14 17:41:14 +00:00
Alex Tokarev
9c892e6c5d Fix CHANGELOG.md typos 2020-03-14 20:27:07 +03:00
bors
66767cec81 Auto merge of #7998 - rust-lang:ehuss-patch-1, r=Eh2406
Update changelog note about crate-versions flag.
2020-03-14 16:37:52 +00:00
Eric Huss
b3a1aa9c7a
Update changelog note about crate-versions flag. 2020-03-14 09:35:01 -07:00
bors
7b0d4ba781 Auto merge of #7997 - ehuss:version-bump, r=alexcrichton
Bump to 0.45.0, update changelog
2020-03-14 05:19:25 +00:00
Eric Huss
ac79b537e1 Bump to 0.45.0. 2020-03-13 19:31:06 -07:00
Eric Huss
05fe44b22d Update changelog for 1.43. 2020-03-13 19:31:02 -07:00
Jane Lusby
d9a77ce0d0 fix unix cfg on include 2020-03-13 15:31:33 -07:00
Jane Lusby
d02f476804 rustfmt 2020-03-13 15:02:55 -07:00
Jane Lusby
76797b5c2a switch from bash script to rust program 2020-03-13 14:59:41 -07:00
bors
24bc925262 Auto merge of #7996 - alexcrichton:update-git2, r=Eh2406
Bump libgit2 dependencies

Brings in rust-lang/git2-rs#527

Closes #7466
Closes #7988
2020-03-13 19:47:44 +00:00
Alex Crichton
82239d7a10 Bump libgit2 dependencies
Brings in rust-lang/git2-rs#527

Closes #7466
Closes #7988
2020-03-13 12:26:46 -07:00
Jane Lusby
b0351e4d87 Close the front door for clippy but open the back 2020-03-12 19:27:48 -07:00
bors
2bdc87972c 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
2020-03-12 16:55:12 +00:00
bors
b9b30c8b8e 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.
2020-03-12 15:55:24 +00:00
bors
fb3dad950d Auto merge of #7990 - ehuss:workspace-resolve-lifetime, r=alexcrichton
WorkspaceResolve: Use descriptive lifetime label.

I find it helpful to have descriptive lifetime names.
2020-03-12 15:32:48 +00:00
Eric Huss
442e2fdc63 WorkspaceResolve: Use descriptive lifetime label. 2020-03-11 19:31:38 -07:00
Eric Huss
2fa95e3ec4 Add "Updating" status for git submodules. 2020-03-11 18:37:31 -07:00
bors
94c7bc7bdb 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.
2020-03-10 21:20:10 +00:00
Eric Huss
6e08c9731c Support old html anchors in manifest chapter. 2020-03-10 12:50:31 -07:00
Eric Huss
05a1f43a7f Use wait_while for Condvar in Queue to simplify code. 2020-03-10 12:23:12 -07:00
Eric Huss
c67cd7a1a2 Add test for caching large output. 2020-03-10 11:23:18 -07:00
Eric Huss
e2b28f7a47 Avoid buffering large amounts of rustc output. 2020-03-07 19:58:37 -08:00
Alex Crichton
458138bf02 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.
2020-03-07 14:01:36 -08:00
bors
43aafb416f 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.
2020-03-05 23:02:29 +00:00
bors
94438758a3 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.
2020-03-05 17:09:08 +00:00
Eric Huss
b8ab32ea31 Partially revert change to filter debug_assertions. 2020-03-05 08:20:52 -08:00
Jiajie Chen
9f07c83417 Don't create hardlink for library test, integrations tests and benches, fixing #7960 2020-03-05 13:03:49 +08:00
bors
5fe8ab57e2 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).
2020-03-04 15:37:33 +00:00
bors
208e4997f3 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.
2020-03-03 20:17:11 +00:00
Eric Huss
887ee6cc70 Fix bug with new feature resolver and required-features. 2020-03-03 11:46:37 -08:00
Eric Huss
2a874aa522 Warn when packaging files with Windows special names. 2020-03-02 16:14:36 -08:00
Eric Huss
15ac82b677 Warn on Windows about reserved target names. 2020-03-02 16:04:25 -08:00
Eric Huss
95008f91e5 Try to better handle restricted crate names. 2020-03-02 16:04:24 -08:00
bors
bda50510d1 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.
2020-03-02 18:05:34 +00:00
Eric Huss
f2c8070df5 Fix rare failure in collision_export test. 2020-03-02 09:46:39 -08:00
bors
ac2eb69346 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.
2020-03-02 17:38:11 +00:00
bors
860d299732 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`.
2020-03-02 17:21:22 +00:00
bors
cc5a5e5b77 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.
2020-03-02 16:54:53 +00:00
Eric Huss
b786f85fa4 Fix plugin tests for latest nightly. 2020-03-02 08:52:30 -08:00
Eric Huss
298b7703ee Add more fingerprint mtime debug logging. 2020-02-29 10:56:34 -08:00
Jun Wu
a2cddeeb9f 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.
2020-02-29 09:31:52 -08:00
bors
62180bf27d 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.
2020-02-28 19:16:36 +00:00
bors
6256eca9de 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
2020-02-28 18:52:43 +00:00
bors
443e276787 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
2020-02-28 18:35:27 +00:00
Alex Tokarev
0f51c48fc9 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
2020-02-28 21:11:36 +03:00
Hanif Bin Ariffin
0ac7aeea98 hash_u64_file now returns an Error instead of panicking. 2020-02-27 17:30:19 -05:00
Hanif Bin Ariffin
c3997d62d4 Fix erronous error with call to write 2020-02-27 17:14:24 -05:00
Hanif Bin Ariffin
bdec8c2392 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.
2020-02-27 16:44:50 -05:00