]> git.proxmox.com Git - cargo.git/log
cargo.git
4 years agoAllow `package.exclude` patterns to match directories.
Eric Huss [Sat, 11 Apr 2020 17:36:58 +0000 (10:36 -0700)]
Allow `package.exclude` patterns to match directories.

4 years agoAdd some more context to errors walking path sources.
Eric Huss [Sat, 11 Apr 2020 17:30:19 +0000 (10:30 -0700)]
Add some more context to errors walking path sources.

4 years agoAuto merge of #8141 - ehuss:uwp_support, r=ehuss
bors [Tue, 21 Apr 2020 18:04:35 +0000 (18:04 +0000)]
Auto merge of #8141 - ehuss:uwp_support, r=ehuss

Uplift windows gnu DLL import libraries.

This is a repost of #6875, rebased with tests fixed.

4 years agoUpdate tests and comments for testing windows-gnu.
Eric Huss [Tue, 21 Apr 2020 17:52:46 +0000 (10:52 -0700)]
Update tests and comments for testing windows-gnu.

4 years agoAdd implib to the stamp files
Hugo Beauzée-Luyssen [Wed, 17 Apr 2019 13:49:07 +0000 (15:49 +0200)]
Add implib to the stamp files

This was already done when targetting msvc, but it needs to be done for
all targets to allow rustc to link with shared libraries when using llvm
-l<dllname> is only supported by gcc, while llvm needs an import library
to link indirectly with a dll

4 years agoAuto merge of #8139 - mati865:patch-1, r=ehuss
bors [Tue, 21 Apr 2020 17:03:56 +0000 (17:03 +0000)]
Auto merge of #8139 - mati865:patch-1, r=ehuss

Add windows-gnu CI and fix tests

One remaining failure:
```
---- features::feature_off_dylib stdout ----
running `d:\a\1\s\target\debug\cargo.exe build --features f1`
running `d:\a\1\s\target\debug\cargo.exe run -p bar`
thread 'features::feature_off_dylib' panicked at '
Expected: execs
    but: exited with exit code: 101
--- stdout

--- stderr
   Compiling foo v0.0.1 (D:\a\1\s\target\cit\t663\foo)
   Compiling bar v0.0.1 (D:\a\1\s\target\cit\t663\foo\bar)
    Finished dev [unoptimized + debuginfo] target(s) in 0.69s
     Running `target\debug\bar.exe`
thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `"f1"`,
 right: `"no f1"`', bar\src\main.rs:5:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: process didn't exit successfully: `target\debug\bar.exe` (exit code: 101)
', crates\cargo-test-support\src\lib.rs:833:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

failures:
    features::feature_off_dylib
```

I disassembled the dylibs and `cargo run -p bar` correctly rebuilt it inside `target/debug/deps/` but did not copy it to `target/debug`. To further confirm, calling `cp target/debug/deps/foo.dll target/debug/` manually solved the issue.
Any idea?

----

I left `FIXME` in places where import lib should be added with https://github.com/rust-lang/cargo/pull/6875.

`TOOLCHAIN: nightly-x86_64-pc-windows-gnu` can be replaced with beta on Thursday.

4 years agoMake sure to lift dylibs
Mateusz Mikuła [Tue, 21 Apr 2020 15:24:36 +0000 (17:24 +0200)]
Make sure to lift dylibs

4 years agoFix rustc-dev component installation on CI
Mateusz Mikuła [Mon, 20 Apr 2020 18:29:03 +0000 (20:29 +0200)]
Fix rustc-dev component installation on CI

4 years agoUpdate tests for windows-gnu
Mateusz Mikuła [Mon, 20 Apr 2020 16:57:56 +0000 (18:57 +0200)]
Update tests for windows-gnu

4 years agoAdd windows-gnu CI
Mateusz Mikuła [Mon, 20 Apr 2020 10:46:00 +0000 (12:46 +0200)]
Add windows-gnu CI

4 years agoAuto merge of #7973 - ehuss:index-updates, r=alexcrichton
bors [Mon, 20 Apr 2020 19:50:40 +0000 (19:50 +0000)]
Auto merge of #7973 - ehuss:index-updates, r=alexcrichton

Several updates to token/index handling.

This attempts to tighten up the usage of token/index handling, to prevent accidental leakage of the crates.io token.

* Make `registry.index` config a hard error. This was deprecated 4 years ago in #2857, and removing it helps simplify things.
* Don't allow both `--index` and `--registry` to be specified at the same time. Otherwise `--index` was being silently ignored.
* `registry.token` is not allowed to be used with the `--index` flag. The intent here is to avoid possibly leaking a crates.io token to another host.
* Added a warning if source replacement is used and the token is loaded from `registry.token`.

Closes #6545

4 years agoAuto merge of #8129 - ehuss:resolver-behavior, r=alexcrichton
bors [Mon, 20 Apr 2020 16:07:30 +0000 (16:07 +0000)]
Auto merge of #8129 - ehuss:resolver-behavior, r=alexcrichton

Add `resolver` opt-in for new feature resolver.

This adds a new `resolver` field to `Cargo.toml` to provide an opt-in mechanism for backwards-incompatible resolver changes. This enables the new feature resolver and `-Zpackage-features`. See `unstable.md` for documentation.

cc #8088

4 years agoAuto merge of #8137 - twe4ked:install-current-directory-error, r=alexcrichton
bors [Mon, 20 Apr 2020 14:24:42 +0000 (14:24 +0000)]
Auto merge of #8137 - twe4ked:install-current-directory-error, r=alexcrichton

Improve error message when running `cargo install .`

Existing error:

```
$ cargo install .
    Updating crates.io index
error: could not find `.` in registry `https://github.com/rust-lang/crates.io-index`
```

New error:

```
$ cargo install .
error: To install the binaries for the package in current working directory use `cargo install --path .`. Use `cargo build` if you want to simply build the package.
```

Existing related errors:

```
$ cargo install
error: Using `cargo install` to install the binaries for the package in current working directory is no longer supported, use `cargo install --path .` instead. Use `cargo build` if you want to simply build the package.
$ cargo uninstall .
error: invalid package ID specification: `.`

Caused by:
  Invalid character `.` in pkgid: `.`
```

4 years agoAuto merge of #8138 - Dylan-DPC:fix/transmute_unused, r=alexcrichton
bors [Mon, 20 Apr 2020 14:06:51 +0000 (14:06 +0000)]
Auto merge of #8138 - Dylan-DPC:fix/transmute_unused, r=alexcrichton

fix mem replace unused

`mem::replace` will be linted as must_use, so modifying this.

This is currently blocking https://github.com/rust-lang/rust/pull/71256

4 years agoremove mem replace instead
dylan_DPC [Mon, 20 Apr 2020 13:40:41 +0000 (15:40 +0200)]
remove mem replace instead

4 years agofix mem replace unused
dylan_DPC [Mon, 20 Apr 2020 13:08:26 +0000 (15:08 +0200)]
fix mem replace unused

4 years agoImprove error message when running `cargo install .`
Odin Dutton [Mon, 20 Apr 2020 03:04:36 +0000 (13:04 +1000)]
Improve error message when running `cargo install .`

4 years agoAuto merge of #8134 - nnethercote:bitcode-in-rlib, r=alexcrichton
bors [Sun, 19 Apr 2020 19:09:12 +0000 (19:09 +0000)]
Auto merge of #8134 - nnethercote:bitcode-in-rlib, r=alexcrichton

Change `-Cembed-bitcode=no` use to `-Cbitcode-in-rlib=no`.

Because the latter will replace the planned use of the former in rustc.

4 years agoAuto merge of #8068 - ehuss:bcx-units, r=alexcrichton,ehuss
bors [Sun, 19 Apr 2020 17:37:59 +0000 (17:37 +0000)]
Auto merge of #8068 - ehuss:bcx-units, r=alexcrichton,ehuss

Refactor BuildContext

This restructures the "front end" of the compile process so that the `UnitGraph` can be accessed by API users. Essentially, the `BuildContext` contains the result of generating the `UnitGraph`, and other bits of information collected along the way. This logically separates the build process into two phases: (1) generate the `UnitGraph` and `BuildContext` and (2) pass the `BuildContext` to `Context` which performs the actual compilation.

The main challenge here is dealing with the references and lifetimes. The old code kept a bunch of things on the stack with various layers of references. Beside reorganizing things, the big change is to wrap `Package` and `Target` in `Rc`. This still requires the `UnitInterner` to be passed in and kept alive. It is possible to avoid that by placing all `Unit`s in `Rc`, but that had a roughly 5% performance hit (on fresh builds) because Units are very optimized to be used as hashable keys, and `Rc` loses those optimizations.

4 years agoA few final minor fixes for bcx reorg.
Eric Huss [Sun, 19 Apr 2020 16:50:29 +0000 (09:50 -0700)]
A few final minor fixes for bcx reorg.

4 years agoRun rustfmt
Alex Crichton [Thu, 9 Apr 2020 16:20:54 +0000 (09:20 -0700)]
Run rustfmt

4 years agoRe-add code removed for debugging
Alex Crichton [Thu, 9 Apr 2020 16:18:43 +0000 (09:18 -0700)]
Re-add code removed for debugging

4 years agoRemove lifetime from `Unit`
Alex Crichton [Thu, 9 Apr 2020 16:17:31 +0000 (09:17 -0700)]
Remove lifetime from `Unit`

4 years agoMake `Unit` an owned value
Alex Crichton [Mon, 6 Apr 2020 15:16:13 +0000 (08:16 -0700)]
Make `Unit` an owned value

4 years agoHide `Rc<Package>` under `Package`
Alex Crichton [Sun, 5 Apr 2020 20:41:44 +0000 (13:41 -0700)]
Hide `Rc<Package>` under `Package`

4 years agobcx reorg
Eric Huss [Tue, 24 Mar 2020 21:20:06 +0000 (14:20 -0700)]
bcx reorg

4 years agoWrap Package/Target in Rc.
Eric Huss [Fri, 20 Mar 2020 22:46:11 +0000 (15:46 -0700)]
Wrap Package/Target in Rc.

This is intended to make it easier to deal with Unit lifetimes.

4 years agoAuto merge of #8135 - ehuss:allows-dashes, r=Eh2406
bors [Sun, 19 Apr 2020 16:47:38 +0000 (16:47 +0000)]
Auto merge of #8135 - ehuss:allows-dashes, r=Eh2406

Rename allows_underscores to allows_dashes.

I think this better reflects what it means.

4 years agoAdd a warning when using `registry.token` with source replacement.
Eric Huss [Sat, 7 Mar 2020 01:29:12 +0000 (17:29 -0800)]
Add a warning when using `registry.token` with source replacement.

4 years agoDo not implicitly load registry.token with --index.
Eric Huss [Fri, 6 Mar 2020 23:05:12 +0000 (15:05 -0800)]
Do not implicitly load registry.token with --index.

The intent is to avoid leaking the crates.io token to other servers.

4 years agoDon't allow both --index and --registry to be specified at the same time.
Eric Huss [Fri, 6 Mar 2020 18:15:14 +0000 (10:15 -0800)]
Don't allow both --index and --registry to be specified at the same time.

Otherwise --index was being silently ignored.

4 years agoMake setting `registry.index` a hard error.
Eric Huss [Fri, 6 Mar 2020 17:56:58 +0000 (09:56 -0800)]
Make setting `registry.index` a hard error.

This has been deprecated for 4 years. This helps simplify this code.

4 years agoAdd some doc-strings to registry functions.
Eric Huss [Fri, 6 Mar 2020 16:53:11 +0000 (08:53 -0800)]
Add some doc-strings to registry functions.

4 years agoRename allows_underscores to allows_dashes.
Eric Huss [Sun, 19 Apr 2020 16:15:04 +0000 (09:15 -0700)]
Rename allows_underscores to allows_dashes.

4 years agoPut default ResolveBehavior in one place.
Eric Huss [Sun, 19 Apr 2020 16:04:12 +0000 (09:04 -0700)]
Put default ResolveBehavior in one place.

4 years agoAdd `resolver` opt-in for new feature resolver.
Eric Huss [Fri, 17 Apr 2020 18:20:38 +0000 (11:20 -0700)]
Add `resolver` opt-in for new feature resolver.

4 years agoAuto merge of #8130 - hbina:needless_borrow, r=ehuss
bors [Sun, 19 Apr 2020 15:43:59 +0000 (15:43 +0000)]
Auto merge of #8130 - hbina:needless_borrow, r=ehuss

Fixed a needless borrow.

Mentioned by rust-clippy.

4 years agoChange `-Cembed-bitcode=no` use to `-Cbitcode-in-rlib=no`.
Nicholas Nethercote [Sun, 19 Apr 2020 10:34:52 +0000 (20:34 +1000)]
Change `-Cembed-bitcode=no` use to `-Cbitcode-in-rlib=no`.

Because the latter will replace the planned use of the former in rustc.

4 years agoFixed a needless borrow.
Hanif Bin Ariffin [Sat, 18 Apr 2020 00:22:49 +0000 (20:22 -0400)]
Fixed a needless borrow.

4 years agoAuto merge of #8126 - ehuss:link-changelog, r=alexcrichton
bors [Fri, 17 Apr 2020 16:45:26 +0000 (16:45 +0000)]
Auto merge of #8126 - ehuss:link-changelog, r=alexcrichton

Add link to changelog in the Cargo book.

4 years agoAuto merge of #8094 - Freax13:fix-target, r=ehuss
bors [Fri, 17 Apr 2020 16:27:48 +0000 (16:27 +0000)]
Auto merge of #8094 - Freax13:fix-target, r=ehuss

Fix target for doc test cross compilation

- for target paths `Compilation::target` only contains the shortened file name, but we need to pass the full path to rustdoc

4 years agoAuto merge of #8125 - ehuss:doc-config-toml, r=alexcrichton
bors [Fri, 17 Apr 2020 16:00:52 +0000 (16:00 +0000)]
Auto merge of #8125 - ehuss:doc-config-toml, r=alexcrichton

Add note about .cargo/config support.

I think it would be good to have some mention that Cargo also supports `.cargo/config` files.  This is still the predominant way Cargo is used, and there is a ton of documentation, projects, and examples that still use the old form.

4 years agoAdd link to changelog in the Cargo book.
Eric Huss [Fri, 17 Apr 2020 15:49:36 +0000 (08:49 -0700)]
Add link to changelog in the Cargo book.

4 years agoAuto merge of #8123 - ehuss:fix-windows-pdb-dash, r=alexcrichton
bors [Fri, 17 Apr 2020 15:39:25 +0000 (15:39 +0000)]
Auto merge of #8123 - ehuss:fix-windows-pdb-dash, r=alexcrichton

Fix pdb uplift when executable has dashes.

Windows `.pdb` files were not being uplifted for executables with dashes in their name. `rustc` calls the linker with the crate name (with underscores), which creates a pdb with underscores. Cargo renames the executable (`foo_bar.exe` to `foo-bar.exe`), and it was expecting the pdb to have the same form, but it doesn't.

Note: There shouldn't be any effect for using a debugger. Because the pdb path is embedded in the executable, the debugger was already looking in the `deps/` folder.  Uplifting is only useful if you want to copy the exe/pdb pair to some other machine.  In that case, it looks in the same directory as the `exe` for the pdb file.

Fixes #8117

4 years agoAdd note about .cargo/config support.
Eric Huss [Fri, 17 Apr 2020 15:37:03 +0000 (08:37 -0700)]
Add note about .cargo/config support.

4 years agoadd test for doctests with custom target paths
Tom Dohrmann [Fri, 17 Apr 2020 15:35:10 +0000 (17:35 +0200)]
add test for doctests with custom target paths

4 years agoAuto merge of #8122 - kornelski:future-edition, r=Eh2406
bors [Fri, 17 Apr 2020 15:20:04 +0000 (15:20 +0000)]
Auto merge of #8122 - kornelski:future-edition, r=Eh2406

Hint upgrading for future edition keys

A more specific error message for potentially-future edition values.

This error is likely to be seen by people who are not regular Rust users and are just trying to build someone's crate. It may be helpful to stronger hint at upgrading Cargo, rather than display a more general message about an unknown value.

I know Cargo plans to fix it better with explicit MSRV eventually, but that's not ready yet, so it's better to land something sooner.

4 years agoAuto merge of #8124 - ehuss:fs-cleanup, r=Eh2406
bors [Fri, 17 Apr 2020 15:02:35 +0000 (15:02 +0000)]
Auto merge of #8124 - ehuss:fs-cleanup, r=Eh2406

Use some fs shorthand functions.

This is just some cleanup, using some fs convenience functions that I think make the code more readable.

Note: While going through these, I found the `out_dir_is_preserved` test was broken and not doing what it was supposed to.

4 years agoUse fs helpers instead of File functions.
Eric Huss [Fri, 17 Apr 2020 04:10:11 +0000 (21:10 -0700)]
Use fs helpers instead of File functions.

4 years agoHint upgrading for future edition keys
Kornel [Wed, 15 Apr 2020 14:03:09 +0000 (15:03 +0100)]
Hint upgrading for future edition keys

4 years agoUse Path methods instead of fs::metadata.
Eric Huss [Fri, 17 Apr 2020 01:41:03 +0000 (18:41 -0700)]
Use Path methods instead of fs::metadata.

4 years agoFix pdb uplift when executable has dashes.
Eric Huss [Fri, 17 Apr 2020 01:02:47 +0000 (18:02 -0700)]
Fix pdb uplift when executable has dashes.

4 years agoAuto merge of #8121 - huangjiahua:update-documentation, r=alexcrichton
bors [Thu, 16 Apr 2020 19:15:44 +0000 (19:15 +0000)]
Auto merge of #8121 - huangjiahua:update-documentation, r=alexcrichton

Update documentation to mention "config.toml" instead of "config"

I searched for the reference of `config` and `credentials` in `src/doc` and changed to `config.toml` and `credentials.toml` accroding to the context.

#7323

4 years agoUpdate documentation to mention "config.toml" and "credentials.toml" instead of ...
huangjiahua [Thu, 16 Apr 2020 15:18:34 +0000 (23:18 +0800)]
Update documentation to mention "config.toml" and "credentials.toml" instead of "config" and "credentials"

Cargo now support loading 'config.toml' and 'credentials.toml' in place of the same files without extension, which used to be the default. Files with extensions are easier for people to edit due to syntax highlighting, etc.

4 years agoAuto merge of #8119 - ehuss:new-err-formatting, r=alexcrichton
bors [Thu, 16 Apr 2020 14:28:43 +0000 (14:28 +0000)]
Auto merge of #8119 - ehuss:new-err-formatting, r=alexcrichton

Don't use debug display for error object.

When `cargo new` displays a workspace validation warning, it was using the debug display which we probably shouldn't rely on.

This also consolidates a similar usage when `cargo doc --open` fails.

Closes #8118

4 years agofix test
Tom Dohrmann [Thu, 16 Apr 2020 11:08:00 +0000 (13:08 +0200)]
fix test

4 years agomake test use nightly
Tom Dohrmann [Thu, 16 Apr 2020 10:07:15 +0000 (12:07 +0200)]
make test use nightly

4 years agoadd tests for doctests with cross compilation
Tom Dohrmann [Thu, 16 Apr 2020 09:48:12 +0000 (11:48 +0200)]
add tests for doctests with cross compilation

4 years agoadd clarifying comment
Tom Dohrmann [Thu, 16 Apr 2020 09:35:38 +0000 (11:35 +0200)]
add clarifying comment

4 years agoDon't use debug display for error object.
Eric Huss [Thu, 16 Apr 2020 00:29:19 +0000 (17:29 -0700)]
Don't use debug display for error object.

4 years agoAuto merge of #8115 - ehuss:tree-backwards-compat, r=alexcrichton
bors [Wed, 15 Apr 2020 20:52:38 +0000 (20:52 +0000)]
Auto merge of #8115 - ehuss:tree-backwards-compat, r=alexcrichton

Add backwards-compatibility for old cargo-tree flags.

Add backwards compatibility for the flags that were removed.

`--invert` is still not backwards compatible because it was fundamentally changed to take an argument.

Requested via https://github.com/rust-lang/cargo/pull/8062#issuecomment-613829752.

4 years agoAdd backwards-compatibility for old cargo-tree flags.
Eric Huss [Wed, 15 Apr 2020 20:48:58 +0000 (13:48 -0700)]
Add backwards-compatibility for old cargo-tree flags.

4 years agoAuto merge of #8114 - alexcrichton:change-condition, r=Eh2406
bors [Wed, 15 Apr 2020 15:39:33 +0000 (15:39 +0000)]
Auto merge of #8114 - alexcrichton:change-condition, r=Eh2406

Try to avoid panics on buggy (?) clocks

Try to avoid panics with `Instant` by only performing infallible
operations. This tweaks a comparison located in #8042 to use `Instant`
comparisons rather than `Duration` comparisons which should hopefully
eliminate a source of panics in the face of buggy (maybe?) clocks.

I'm not sure whether this actually fixes the original issue, but seeing
that we have a pretty low chance of the issue recurring, it's probably
fine to go ahead and say...

Closes #8042

4 years agoTry to avoid panics on buggy (?) clocks
Alex Crichton [Wed, 15 Apr 2020 14:53:36 +0000 (07:53 -0700)]
Try to avoid panics on buggy (?) clocks

Try to avoid panics with `Instant` by only performing infallible
operations. This tweaks a comparison located in #8042 to use `Instant`
comparisons rather than `Duration` comparisons which should hopefully
eliminate a source of panics in the face of buggy (maybe?) clocks.

I'm not sure whether this actually fixes the original issue, but seeing
that we have a pretty low chance of the issue recurring, it's probably
fine to go ahead and say...

Closes #8042

4 years agoRevert "remove host & target attributes"
Tom Dohrmann [Wed, 15 Apr 2020 10:51:37 +0000 (12:51 +0200)]
Revert "remove host & target attributes"

This reverts commit 5a051ebe08d51c0188a4c3bbb41789c0d4cb0f82.

4 years agoRevert "fix running doctest for host target"
Tom Dohrmann [Wed, 15 Apr 2020 10:51:22 +0000 (12:51 +0200)]
Revert "fix running doctest for host target"

This reverts commit 060c5e13e123683bce605c420bff95b2205fd131.

4 years agofix running doctest for host target
Tom Dohrmann [Tue, 14 Apr 2020 14:41:18 +0000 (16:41 +0200)]
fix running doctest for host target

4 years agoAuto merge of #8093 - pfmooney:illumos-deps, r=alexcrichton
bors [Mon, 13 Apr 2020 20:41:52 +0000 (20:41 +0000)]
Auto merge of #8093 - pfmooney:illumos-deps, r=alexcrichton

Update dependencies to support illumos target

Several dependencies of cargo require updates in order to build with illumos as the `target_os` platform (rust-lang/rust#55553).  Most are patch revisions to include `#[cfg()]` updates.  In the case of `fs2`, the maintainer does not appear to be minding activity on the project, so it was forked into `fs3`, maintaining the same interfaces and logic (but featuring the widened platform support).

4 years agoUpdate dependencies to support illumos target
Patrick Mooney [Fri, 3 Apr 2020 21:20:05 +0000 (21:20 +0000)]
Update dependencies to support illumos target

This inlines the flock() logic from danburkert/fs2, which in its current
state does not compile on illumos (or certain other cfg(unix) targets).

4 years agoAuto merge of #8102 - alexcrichton:more-spurious, r=Eh2406
bors [Mon, 13 Apr 2020 16:45:48 +0000 (16:45 +0000)]
Auto merge of #8102 - alexcrichton:more-spurious, r=Eh2406

Whitelist another known spurious curl error

Seen recently in comments on #6788

4 years agoWhitelist another known spurious curl error
Alex Crichton [Mon, 13 Apr 2020 16:42:26 +0000 (09:42 -0700)]
Whitelist another known spurious curl error

Seen recently in comments on #6788

4 years agoAuto merge of #8098 - ehuss:fix-exported_priv_warning, r=alexcrichton
bors [Mon, 13 Apr 2020 14:12:49 +0000 (14:12 +0000)]
Auto merge of #8098 - ehuss:fix-exported_priv_warning, r=alexcrichton

Fix nightly test matching rustc "warning" output.

https://github.com/rust-lang/rust/pull/69926 changed the warning output from rustc.  https://github.com/rust-lang/cargo/pull/8080 attempted to compensate for it, but missed one of the cases.  I don't think this test needs to be quite so exhaustive about checking the output.

4 years agoFix nightly test matching rustc "warning" output.
Eric Huss [Mon, 13 Apr 2020 04:09:39 +0000 (21:09 -0700)]
Fix nightly test matching rustc "warning" output.

4 years agoremove host & target attributes
Tom Dohrmann [Sun, 12 Apr 2020 15:49:05 +0000 (17:49 +0200)]
remove host & target attributes

4 years agoAuto merge of #8096 - ehuss:codegen-units-default, r=Eh2406
bors [Sat, 11 Apr 2020 22:36:02 +0000 (22:36 +0000)]
Auto merge of #8096 - ehuss:codegen-units-default, r=Eh2406

Update default for codegen-units.

The default for codegen-units was changed in https://github.com/rust-lang/rust/pull/70156.

4 years agoUpdate default for codegen-units.
Eric Huss [Sat, 11 Apr 2020 17:55:51 +0000 (10:55 -0700)]
Update default for codegen-units.

4 years agofix target
Tom Dohrmann [Sat, 11 Apr 2020 09:33:58 +0000 (11:33 +0200)]
fix target

4 years agoAuto merge of #8087 - ehuss:freshness-interrupted2, r=alexcrichton
bors [Fri, 10 Apr 2020 16:33:24 +0000 (16:33 +0000)]
Auto merge of #8087 - ehuss:freshness-interrupted2, r=alexcrichton

Fix freshness when linking is interrupted.

Fixes a scenario where hitting Ctrl-C while linking would leave a corrupted executable, but Cargo would think it is "fresh" and fail to rebuild it.

This also includes a separate commit which adds more documentation on fingerprinting.

Fixes #7767

4 years agoMore fingerprint and metadata comments.
Eric Huss [Thu, 9 Apr 2020 22:30:41 +0000 (15:30 -0700)]
More fingerprint and metadata comments.

4 years agoAuto merge of #8062 - ehuss:tree, r=alexcrichton
bors [Thu, 9 Apr 2020 19:53:41 +0000 (19:53 +0000)]
Auto merge of #8062 - ehuss:tree, r=alexcrichton

Add `cargo tree` command.

This migrates [cargo-tree](https://github.com/sfackler/cargo-tree/) into Cargo as a built-in command. This is based on a recent master (https://github.com/sfackler/cargo-tree/tree/4108d216ec072d2e7c9befb4de32175f97a9dbc4), and should be mostly similar in functionality. There are a variety changes:

* `--all-targets` renamed to `--no-filter-targets` to avoid confusion with the `--all-targets` flag used in other Cargo commands with a different meaning.
* `--all`/`-a` renamed to `--no-dedupe` to avoid confusion with the `-all` flag which means "all workspace crates" in other Cargo commands.
* `--duplicate` renamed to `--duplicates` (with alias), just a personal preference.
* Added support for multiple roots (workspace support).
* Added the `--graph-features` flag for including features in the graph (to "explain" why a feature is enabled).
* Added `{f}` to format string to show features.
* Handles new feature resolver.
* Handles cyclical dev dependencies.
* Added a test suite.
* Dropped the dependency on petgraph, in favor of a simpler custom graph.

Closes #7286.

4 years agoAuto merge of #8069 - ehuss:build-finished, r=alexcrichton
bors [Thu, 9 Apr 2020 19:34:39 +0000 (19:34 +0000)]
Auto merge of #8069 - ehuss:build-finished, r=alexcrichton

Add "build-finished" JSON message.

This adds a JSON message when a build is finished.  This is useful for tools to know when to stop parsing JSON, which is particularly useful for commands like `cargo test` or `cargo run` where additional output may follow.

Closes #7978

4 years agoFix freshness when linking is interrupted.
Eric Huss [Wed, 8 Apr 2020 19:45:15 +0000 (12:45 -0700)]
Fix freshness when linking is interrupted.

4 years agoAuto merge of #8074 - ehuss:package-features2, r=alexcrichton
bors [Thu, 9 Apr 2020 15:43:07 +0000 (15:43 +0000)]
Auto merge of #8074 - ehuss:package-features2, r=alexcrichton

Extend -Zpackage-features with more capabilities.

This is a proposal to extend `-Zpackage-features` with new abilities to change how features are selected on the command-line.  See `unstable.md` for documentation on what it does.

I've contemplated a variety of ways we could transition this to stable. I tried a few experiments trying to make a "transition with warnings" mode, but I'm just too concerned about breaking backwards compatibility.  The current way is just fundamentally different from the new way, and I think it would be a bumpy ride to try to push it.

The stabilization story is that the parts of this that add new functionality (feature flags in virtual worskpaces, and `member/feat` syntax) can be stabilized at any time.  The change for `cargo build -p member --features feat` in a different member's directory can maybe be part of `-Zfeatures` stabilization, which will need to be opt-in.  I've been trying to come up with some transition plan, and I can't think of a way without making it opt-in, and making it part of `-Zfeatures` is an opportunity to simplify things.  One concern is that this might be confusing (`--features` flag could behave differently in different workspaces, and documenting the differences), but that seems hard to avoid.

Closes #6195
Closes #4753
Closes #5015
Closes #4106
Closes #5362

4 years agoAdd some more exposition on fingerprints.
Eric Huss [Wed, 8 Apr 2020 16:57:12 +0000 (09:57 -0700)]
Add some more exposition on fingerprints.

4 years agoAuto merge of #8090 - mbStavola:invalid-dep-naming, r=alexcrichton
bors [Thu, 9 Apr 2020 15:26:04 +0000 (15:26 +0000)]
Auto merge of #8090 - mbStavola:invalid-dep-naming, r=alexcrichton

Disallow invalid dependency names through crate renaming

resolves #6656

As suggested in the issue, I simply checked the dep names by calling `validate_package_name` on the dependencies during the TOML deserialization process.

It might be a bit too strict (and sudden) to error out in this case, so it might be best to convert this into a warning instead. However, this _is_ pretty invalid behavior so I'm not too sure really.

4 years agoAuto merge of #8073 - ehuss:hash-channel, r=alexcrichton
bors [Thu, 9 Apr 2020 14:25:08 +0000 (14:25 +0000)]
Auto merge of #8073 - ehuss:hash-channel, r=alexcrichton

Use the same filename hash for pre-release channels.

This changes it so that filenames do not hash the entire verbose version from rustc if they are a pre-release version. The intent is to avoid leaving stale artifacts in the target directory whenever someone updates a nightly or beta release. This should help reduce disk space usage for someone who updates these toolchains frequently.

I tested with the rustc repo, and it seems to be OK. It keeps everything in separate target directories, so I think it should be generally safe. This should only affect someone switching between different nightlies and wanting to avoid recompiling when switching back. I suspect that is a rare use case, though if there are complaints this can be easily reverted (or made a config option). cargo-bisect-rustc should also be safe since it uses a different target directory for each toolchain.

One concern here for me was incremental support. It looks like ([src](https://github.com/rust-lang/rust/blob/6387b09153939b2a104cd63148598a5f458de2c2/src/librustc_incremental/persist/file_format.rs#L88-L100)) the incremental cache includes the detailed rustc version, so I think that is safe. It also looks like it is [smart enough](https://github.com/rust-lang/rust/blob/6387b09153939b2a104cd63148598a5f458de2c2/src/librustc_incremental/persist/load.rs#L40-L49) to delete stale files.

We will need to be more careful in the future when changing the target directory structure or the format of files. We previously relied on the fact that each new nightly will use different filenames. If we change the structure in a backwards-incompatible way, we will need to be careful to update the version (`1.hash` in `compute_metadata`).

4 years agoAdd test for bad renaming
Matt Stavola [Thu, 9 Apr 2020 06:46:30 +0000 (23:46 -0700)]
Add test for bad renaming

4 years agoError on invalid dependency naming
Matt Stavola [Thu, 9 Apr 2020 06:15:33 +0000 (23:15 -0700)]
Error on invalid dependency naming

4 years agoAdd escape hatch for nightly version hashing.
Eric Huss [Wed, 8 Apr 2020 21:21:10 +0000 (14:21 -0700)]
Add escape hatch for nightly version hashing.

4 years agoMerge -Zpackage-features2 and -Zpackage-features.
Eric Huss [Wed, 8 Apr 2020 21:06:09 +0000 (14:06 -0700)]
Merge -Zpackage-features2 and -Zpackage-features.

4 years agoAuto merge of #8081 - t-nelis:index-commands-section, r=ehuss
bors [Tue, 7 Apr 2020 19:47:54 +0000 (19:47 +0000)]
Auto merge of #8081 - t-nelis:index-commands-section, r=ehuss

Index the commands section

4 years agoAuto merge of #8083 - t-nelis:mdbook-v0.3.7, r=ehuss
bors [Tue, 7 Apr 2020 19:30:55 +0000 (19:30 +0000)]
Auto merge of #8083 - t-nelis:mdbook-v0.3.7, r=ehuss

Upgrade to mdBook v0.3.7

This bumps the requirement from Rust v1.34.0 to v1.35.0 for building docs. AFAICT CI is using nightlies so that should be fine, but I thought I'd mention it in case someone thinks this impacts contributors in any way.

Other than that, there are a few changes that might impact some users in a visible way, like automatic dark theme support for those who picked that perference in their browser, possible color changes to the scrollbar and to the font size, change in the spacing in the sidebar entries, and many more changes and fixes that won't be too immediately impactful but very good all around.

I checked changes from transitive dependency bumps as well, AFAICT there is nothing that *should* impact the final rendering.

**tl;dr:** Nothing will explode. Probably.

For completeness, my raw notes of outtakes as I was reviewing the change logs:

```
[cosmetic]
v0.3.2 https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-032
Added automatic dark-theme detection based on the CSS prefers-color-scheme feature. This may be enabled by setting output.html.preferred-dark-theme to your preferred dark theme. #1037
https://github.com/rust-lang/mdBook/pull/1037

v0.3.3 https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-033
Improvements to the automatic dark theme selection. #1069
https://github.com/rust-lang/mdBook/pull/1069

v0.3.7 https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-037
Fixed theme selector focus. #1170
https://github.com/rust-lang/mdBook/pull/1170

* https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme
* users who picked the dark color scheme in their browser will see the cargo doc in dark.

[cosmetic]
v0.3.2 https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-032
Use standard scrollbar-color CSS along with webkit extension #816
https://github.com/rust-lang/mdBook/pull/816

* https://developer.mozilla.org/en-US/docs/Web/CSS/scrollbar-color
* scroll bar color might change i guess.

[helpful]
v0.3.2 https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-032
Updated highlight.js for syntax highlighting updates (primarily to add async/await to Rust highlighting). #1041
https://github.com/rust-lang/mdBook/pull/1041

* not sure cargo doc has many code examples with async/await, but there we go.

[warning]
v0.3.2 https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-032
Raised minimum supported rust version to 1.35. #1003
https://github.com/rust-lang/mdBook/pull/1003

* from 1.34.0.

[cosmetic]
v0.3.4 https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-034
Switch to relative rem font sizes from px. #894
https://github.com/rust-lang/mdBook/pull/894

* will impact some displays, but px is already an abstract thing so maybe not that big of an impact.

[warning]
v0.3.5 https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-035
Updated pulldown-cmark to 0.6.1, fixing several issues. #1021
https://github.com/rust-lang/mdBook/pull/1021

* from 0.5, breaking changes.
* parsing only -- the team had to do multiple changes but nothing seems like it would impact final rendering

[cosmetic]
v0.3.6 https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-036
Adjusted spacing of sidebar entries. #1137
https://github.com/rust-lang/mdBook/pull/1137

[warning]
v0.3.6 https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-036
Handlebars updated to 3.0. #1130
https://github.com/rust-lang/mdBook/pull/1130

* from 2.0
* https://github.com/sunng87/handlebars-rust/blob/master/CHANGELOG.md
* strictly maintenance and perf AFAICS, no changes to final rendering.

[cosmetic]
v0.3.6 https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-036
Adjusted the menu bar animation to not immediately obscure the top content. #989
https://github.com/rust-lang/mdBook/pull/989

* personal fave.

[cosmetic]
v0.3.7 https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-037
Code spans in headers are no longer highlighted as code. #1162

* users will see some headers change, probably.

[fixes]
+ ~13 fixes impacting rendering in less immediately visible ways.
rest should have no impact on end-user experience.
```

4 years agoFetch mdBook in new location
Thibault Nélis [Tue, 7 Apr 2020 18:07:00 +0000 (20:07 +0200)]
Fetch mdBook in new location

The mdBook project was moved to the rust-lang organization, out of the
nursery organization.

https://github.com/rust-lang/mdBook/issues/1080
https://github.com/rust-lang/mdBook/pull/1083
https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-034

4 years agoIndex the commands section
Thibault Nélis [Tue, 7 Apr 2020 18:18:26 +0000 (20:18 +0200)]
Index the commands section

4 years agoUpgrade to mdBook v0.3.7
Thibault Nélis [Tue, 7 Apr 2020 18:02:37 +0000 (20:02 +0200)]
Upgrade to mdBook v0.3.7

4 years agoAuto merge of #8080 - RoccoDev:master, r=alexcrichton
bors [Tue, 7 Apr 2020 17:46:45 +0000 (17:46 +0000)]
Auto merge of #8080 - RoccoDev:master, r=alexcrichton

Compatibility for rust-lang/rust#69926

This adds compatibility for the rust-lang/rust#69926 PR, which makes it so a warning count is displayed when the build is done.

4 years agoAuto merge of #8079 - Timmmm:patch-1, r=alexcrichton
bors [Tue, 7 Apr 2020 17:27:47 +0000 (17:27 +0000)]
Auto merge of #8079 - Timmmm:patch-1, r=alexcrichton

Add note about converting triple case in environment variables

This wasn't obvious to me, since `CARGO_TARGET_x86_64-unknown-linux-gnu_LINKER` is a perfectly valid environment variable name. It's especially important to document environment variable names well because if you get it wrong it is just silently ignored.

4 years agoCompatibility for rust-lang/rust#69926
Rocco [Tue, 7 Apr 2020 13:23:43 +0000 (15:23 +0200)]
Compatibility for rust-lang/rust#69926

4 years agoAdd note about converting triple case in environment variables
Tim [Tue, 7 Apr 2020 11:17:55 +0000 (12:17 +0100)]
Add note about converting triple case in environment variables

This wasn't obvious to me, since `CARGO_TARGET_x86_64-unknown-linux-gnu_LINKER` is a perfectly valid environment variable name. It's especially important to document environment variable names well because if you get it wrong it is just silently ignored.

4 years agoUse the same filename hash for pre-release channels.
Eric Huss [Sun, 5 Apr 2020 20:46:37 +0000 (13:46 -0700)]
Use the same filename hash for pre-release channels.