]> git.proxmox.com Git - cargo.git/log
cargo.git
5 years agoDon't shrink if not tty
Eh2406 [Thu, 24 Jan 2019 17:34:43 +0000 (12:34 -0500)]
Don't shrink if not tty

5 years agoSome CI setups are much slower then the equipment used by Cargo itself
Eh2406 [Thu, 24 Jan 2019 17:28:21 +0000 (12:28 -0500)]
Some CI setups are much slower then the equipment used by Cargo itself

5 years agoAuto merge of #6593 - k-nasa:refactor_clippy, r=dwijnand
bors [Wed, 23 Jan 2019 14:47:20 +0000 (14:47 +0000)]
Auto merge of #6593 - k-nasa:refactor_clippy, r=dwijnand

into_iter() call is equivalent to .iter() and will not move the slice

5 years agorefactor: .into_iter() call is equivalent to .iter() and will not move the slice
nasa [Wed, 23 Jan 2019 13:48:23 +0000 (22:48 +0900)]
refactor: .into_iter() call is equivalent to .iter() and will not move the slice

5 years agoAuto merge of #6587 - alexcrichton:bump, r=ehuss
bors [Tue, 22 Jan 2019 21:43:53 +0000 (21:43 +0000)]
Auto merge of #6587 - alexcrichton:bump, r=ehuss

Bump to 0.35.0

A routine update!

5 years agoBump to 0.35.0
Alex Crichton [Tue, 22 Jan 2019 21:18:16 +0000 (13:18 -0800)]
Bump to 0.35.0

A routine update!

5 years agoAuto merge of #6581 - dwijnand:private-publish-docs, r=ehuss
bors [Tue, 22 Jan 2019 18:39:06 +0000 (18:39 +0000)]
Auto merge of #6581 - dwijnand:private-publish-docs, r=ehuss

Mention "private" in publish field docs

Fixes #6576

5 years agoAuto merge of #6548 - dwijnand:mark-lockfile-as-generated, r=alexcrichton
bors [Tue, 22 Jan 2019 18:10:02 +0000 (18:10 +0000)]
Auto merge of #6548 - dwijnand:mark-lockfile-as-generated, r=alexcrichton

Marking Cargo.lock as generated

12 weeks have passed, let's mark lock files as generated!

Fixes #6180

5 years agoAuto merge of #6565 - SamWhited:add_srht_ci_config, r=alexcrichton
bors [Tue, 22 Jan 2019 17:02:49 +0000 (17:02 +0000)]
Auto merge of #6565 - SamWhited:add_srht_ci_config, r=alexcrichton

Add builds.sr.ht CI config to book

This adds a CI configuration for [builds.sr.ht](https://builds.sr.ht) to the book alongside the existing configurations for Travis and GitLab CI.
The config in question is broadly similar to those two, except that I also opted to build the docs as I commonly find markdown oddities this way from the warnings it spits out.
I picked Arch Linux as the base image because it's easy to install rustup there (since there's a package for it in the Arch repos), but it could have been Debian or FreeBSD or something else just as easily if you have strong opinions about manually installing rustup.

**EDIT:** None of the other build configs had it, so I didn't add publishing tagged commits to crates.io using its secrets mechanism to log cargo in. However, if that's something you think would be beneficial, I can add it.

5 years agoMention "private" in publish field docs
Dale Wijnand [Tue, 22 Jan 2019 09:16:43 +0000 (10:16 +0100)]
Mention "private" in publish field docs

5 years agoAuto merge of #6578 - nanpuyue:patch-1, r=ehuss
bors [Tue, 22 Jan 2019 04:05:36 +0000 (04:05 +0000)]
Auto merge of #6578 - nanpuyue:patch-1, r=ehuss

fix an error completion of `cargo run --example`

5 years agofix an error completion of `cargo run --example`
南浦月 [Tue, 22 Jan 2019 03:36:39 +0000 (11:36 +0800)]
fix an error completion of `cargo run --example`

5 years agoAuto merge of #6573 - ehuss:mtime-on-use-feature, r=dwijnand
bors [Sun, 20 Jan 2019 22:31:07 +0000 (22:31 +0000)]
Auto merge of #6573 - ehuss:mtime-on-use-feature, r=dwijnand

Put mtime-on-use behind a feature flag.

This places #6477 behind the `-Z mtime-on-use` feature flag.

The change to update the mtime each time a crate is used has caused a performance regression on the rust playground (rust-lang/rust#57774). It is using about 241 pre-built crates in a Docker container. Due to the copy-on-write nature of Docker, it can take a significant amount of time to update the timestamps (over 10 seconds on slower systems).

cc @Mark-Simulacrum

5 years agoPut mtime-on-use behind a feature flag.
Eric Huss [Sun, 20 Jan 2019 22:23:16 +0000 (14:23 -0800)]
Put mtime-on-use behind a feature flag.

5 years agoAuto merge of #6569 - dwijnand:fix-unstable-doc-typo, r=ehuss
bors [Sun, 20 Jan 2019 20:21:34 +0000 (20:21 +0000)]
Auto merge of #6569 - dwijnand:fix-unstable-doc-typo, r=ehuss

Fix a typo in the unstable docs

None

5 years agoFix a typo in the unstable docs
Dale Wijnand [Sun, 20 Jan 2019 16:05:57 +0000 (16:05 +0000)]
Fix a typo in the unstable docs

5 years agoAuto merge of #6550 - In-line:did-you-mean-with-question-mark, r=dwijnand
bors [Sun, 20 Jan 2019 07:34:22 +0000 (07:34 +0000)]
Auto merge of #6550 - In-line:did-you-mean-with-question-mark, r=dwijnand

Perhaps you meant: foo, bar or foobar

Hi! Rust project is very cool, but I noticed some minor issues. In every place `did you mean: bla bla` end with the question mark, so I decided to include it here too.

5 years agoPerhaps you meant: bar, foo or foobar
Alik Aslanyan [Mon, 14 Jan 2019 19:34:46 +0000 (23:34 +0400)]
Perhaps you meant: bar, foo or foobar

5 years agoMarking Cargo.lock as generated
Dale Wijnand [Mon, 14 Jan 2019 10:20:10 +0000 (10:20 +0000)]
Marking Cargo.lock as generated

5 years agoAuto merge of #6557 - k-nasa:move_uninstall, r=dwijnand
bors [Sat, 19 Jan 2019 08:36:35 +0000 (08:36 +0000)]
Auto merge of #6557 - k-nasa:move_uninstall, r=dwijnand

Refactor: Create uninstall submodule

Since 'uninstall' was found in the 'install' module, it split.
And I moved duplicate functions to utils.

5 years agorefactor: Rename ops :: utils module
nasa [Sat, 19 Jan 2019 00:43:10 +0000 (09:43 +0900)]
refactor: Rename ops :: utils module

Changed to common_for_install_and_uninstall

5 years agofix: Replace the reference to v1 with a method
nasa [Sat, 19 Jan 2019 00:22:09 +0000 (09:22 +0900)]
fix: Replace the reference to v1 with a method

5 years agofeat: Add a method to get mutable access of v1 field
nasa [Sat, 19 Jan 2019 00:20:09 +0000 (09:20 +0900)]
feat: Add a method to get mutable access of v1 field

5 years agofeat: Add v1 field getter
nasa [Sat, 19 Jan 2019 00:17:23 +0000 (09:17 +0900)]
feat: Add v1 field getter

5 years agofix: Make v1 field private
nasa [Sat, 19 Jan 2019 00:15:33 +0000 (09:15 +0900)]
fix: Make v1 field private

5 years agoAuto merge of #6561 - ehuss:fix-switch-features, r=alexcrichton
bors [Fri, 18 Jan 2019 23:28:48 +0000 (23:28 +0000)]
Auto merge of #6561 - ehuss:fix-switch-features, r=alexcrichton

Fix spurious Windows errors with switch_features_rerun.

Fix a flaky test on Windows which fails with "Access is denied.".

Previous errors:
https://ci.appveyor.com/project/rust-lang-libs/cargo/builds/17766698
https://ci.appveyor.com/project/rust-lang-libs/cargo/builds/18040797
https://ci.appveyor.com/project/rust-lang-libs/cargo/builds/20472056
https://ci.appveyor.com/project/rust-lang-libs/cargo/builds/18746372
https://ci.appveyor.com/project/rust-lang-libs/cargo/builds/18559776
https://ci.appveyor.com/project/rust-lang-libs/cargo/builds/19659571
https://ci.appveyor.com/project/rust-lang-libs/cargo/builds/18956349
https://ci.appveyor.com/project/rust-lang-libs/cargo/builds/18183191
https://ci.appveyor.com/project/rust-lang-libs/cargo/builds/20334485
https://ci.appveyor.com/project/rust-lang-libs/cargo/builds/18554058

5 years agoAdd builds.sr.ht CI config to book
Sam Whited [Fri, 18 Jan 2019 16:42:52 +0000 (10:42 -0600)]
Add builds.sr.ht CI config to book

5 years agoRename method.
Eric Huss [Fri, 18 Jan 2019 16:39:25 +0000 (08:39 -0800)]
Rename method.

5 years agoAuto merge of #6562 - ehuss:travis-no-master, r=dwijnand
bors [Fri, 18 Jan 2019 07:12:43 +0000 (07:12 +0000)]
Auto merge of #6562 - ehuss:travis-no-master, r=dwijnand

Stop building on master on Travis.

I think #6540 probably should have included this, now that there is a green icon.

5 years agoStop building on master on Travis.
Eric Huss [Fri, 18 Jan 2019 01:03:53 +0000 (17:03 -0800)]
Stop building on master on Travis.

5 years agoFix spurious Windows errors with switch_features_rerun.
Eric Huss [Fri, 18 Jan 2019 00:39:04 +0000 (16:39 -0800)]
Fix spurious Windows errors with switch_features_rerun.

5 years agoAuto merge of #6560 - ehuss:better-install-error, r=Eh2406
bors [Thu, 17 Jan 2019 23:57:50 +0000 (23:57 +0000)]
Auto merge of #6560 - ehuss:better-install-error, r=Eh2406

Better error message for bad manifest with `cargo install`.

The old code assumed that any error loading a manifest meant that the
manifest didn't exist, but there are many other reasons it may fail.
Add a few helpful messages for some common cases.

First noticed at https://github.com/rust-lang/cargo/issues/5654#issuecomment-455293220

5 years agoAuto merge of #6559 - euclio:relax-rustdoc-output, r=ehuss
bors [Thu, 17 Jan 2019 21:00:49 +0000 (21:00 +0000)]
Auto merge of #6559 - euclio:relax-rustdoc-output, r=ehuss

relax rustdoc output assertion

The output of this rustdoc error is changing in rust-lang/rust#56884. This PR relaxes an assertion on the output so that the test will still pass once the rustdoc PR is merged.

5 years agoBetter error message for bad manifest with `cargo install`.
Eric Huss [Thu, 17 Jan 2019 20:59:43 +0000 (12:59 -0800)]
Better error message for bad manifest with `cargo install`.

The old code assumed that any error loading a manifest meant that the
manifest didn't exist, but there are many other reasons it may fail.
Add a few helpful messages for some common cases.

5 years agorelax rustdoc output assertion
Andy Russell [Thu, 17 Jan 2019 18:15:14 +0000 (13:15 -0500)]
relax rustdoc output assertion

5 years agoAdd utils mod
nasa [Thu, 17 Jan 2019 08:12:59 +0000 (17:12 +0900)]
Add utils mod

5 years agorefacotor: Move uninstall
nasa [Thu, 17 Jan 2019 08:12:36 +0000 (17:12 +0900)]
refacotor: Move uninstall

5 years agoDelete code transferred to utils
nasa [Thu, 17 Jan 2019 08:10:20 +0000 (17:10 +0900)]
Delete code transferred to utils

5 years agoadd: Move common functions in 'install' and 'uninstall' to ops::utils
nasa [Thu, 17 Jan 2019 08:07:56 +0000 (17:07 +0900)]
add: Move common functions in 'install' and 'uninstall' to ops::utils

5 years agoAuto merge of #6477 - Eh2406:add-a-timestamp-file, r=ehuss
bors [Wed, 16 Jan 2019 23:28:02 +0000 (23:28 +0000)]
Auto merge of #6477 - Eh2406:add-a-timestamp-file, r=ehuss

touch some files when we use them

This is a small change to improve the ability for a third party subcommand to clean up a target folder. I consider this part of the push to experiment with out of tree GC, as discussed in #6229.

how it works?
--------

This updates the modification time of a file in each fingerprint folder and the modification time of the intermediate outputs every time cargo checks that they are up to date. This allows a third party subcommand to look at the modification time of the timestamp file to determine the last time a cargo invocation required that file. This is far more reliable then the current practices of looking at the `accessed` time. `accessed` time is not available or disabled on many operating systems, and is routinely set by arbitrary other programs.

is this enough to be useful?
--------

The current implementation of cargo sweep on master will automatically use this data with no change to the code. With this PR, it will work even on systems that do not update `accessed` time.

This also allows a crude script to clean some of the largest subfolders based on each files modification time.

is this worth adding, or should we just build `clean --outdated` into cargo?
------
I would love to see a `clean --outdated` in cargo! However, I think there is a lot of design work before we can make something good enough to deserve the cargo teams stamp of approval. Especially as an in tree version will have to work with many use cases some of witch are yet to be designed (like distributed builds). Even just including `cargo-sweep`s existing functionality opens a full bike shop about what arguments to take, and in what form (`cargo-sweep` takes a days argument, but maybe we should have a minutes or a ISO standard time or ...). This PR, or equivalent, allows out of tree experimentation with all different interfaces, and is basically required for any `LRU` based system. (For example [Crater](https://github.com/rust-lang-nursery/crater/issues/346) wants a GC that cleans files in an `LRU` manner to maintain a target folder below a target size. This is not a use case that is widely enough needed to be worth adding to cargo but one supported by this PR.)

what are the downsides?
----

1. There are legitimate performance concerns about writing so many small files during a NOP build.
2. There are legitimate concerns about unnecessary wrights on read-only filesystems.
3. If we add this, and it starts seeing widespread use, we may be de facto stabilizing the folder structure we use. (This is probably true of any system that allows out of tree experimentation.)
4. This may not be an efficient way to store the data. (It does have the advantage of not needing different cargos to manipulate the same file. But if you have a better idea please make a suggestion.)

5 years agoAuto merge of #6553 - ehuss:doc-publish-features, r=alexcrichton
bors [Tue, 15 Jan 2019 02:38:14 +0000 (02:38 +0000)]
Auto merge of #6553 - ehuss:doc-publish-features, r=alexcrichton

Add documentation for new package/publish feature flags.

Added in #6453.

5 years agoAuto merge of #6554 - ehuss:chat-link, r=alexcrichton
bors [Tue, 15 Jan 2019 01:36:42 +0000 (01:36 +0000)]
Auto merge of #6554 - ehuss:chat-link, r=alexcrichton

Update chat link to Discord.

I'm not sure if anyone is hanging out in the IRC channel much these days.

5 years agoUpdate chat link to Discord.
Eric Huss [Tue, 15 Jan 2019 01:29:36 +0000 (17:29 -0800)]
Update chat link to Discord.

I'm not sure if anyone is hanging out in the IRC channel much these days.

5 years agoAdd documentation for new package/publish feature flags.
Eric Huss [Tue, 15 Jan 2019 01:23:06 +0000 (17:23 -0800)]
Add documentation for new package/publish feature flags.

5 years agoAuto merge of #6552 - In-line:fix-typo, r=alexcrichton
bors [Mon, 14 Jan 2019 23:46:03 +0000 (23:46 +0000)]
Auto merge of #6552 - In-line:fix-typo, r=alexcrichton

Fix typo

5 years agoFix typo
Alik Aslanyan [Mon, 14 Jan 2019 22:03:20 +0000 (02:03 +0400)]
Fix typo

5 years agofix tests on HFS
Eh2406 [Sun, 13 Jan 2019 14:31:22 +0000 (09:31 -0500)]
fix tests on HFS

5 years agoadd a test for touching fingerprint
Eh2406 [Sun, 13 Jan 2019 04:06:47 +0000 (23:06 -0500)]
add a test for touching fingerprint

5 years agoadd a test for touching deps
Eh2406 [Sun, 13 Jan 2019 03:49:46 +0000 (22:49 -0500)]
add a test for touching deps

5 years agoAuto merge of #6544 - ehuss:test-publish-patch, r=alexcrichton
bors [Sat, 12 Jan 2019 04:13:12 +0000 (04:13 +0000)]
Auto merge of #6544 - ehuss:test-publish-patch, r=alexcrichton

Add test for publish with [patch] + cleanup.

This adds a test for publishing with a `[patch]` dependency. There is also a bunch of refactoring/cleanup to make that work better. Previously there were no tests for publishing with a dependency! A rough summary of the changes:
- Remove all the duplicate code from `support::publish`, consolidate everything in `support::registry`.
- Move API tokens into `.cargo/credentials` so it's easier to remove them in tests.
- Rename `registry`/`alt_registry` to `registry_url`/`alt_registry_url` to be consistent with all the other function names and to avoid ambiguity.
- Separate the default 'dl' and 'api' directories. Not really important, but is more consistent with the alt registry layout.

5 years agoAdd test for publish with [patch] + cleanup.
Eric Huss [Fri, 11 Jan 2019 23:56:46 +0000 (15:56 -0800)]
Add test for publish with [patch] + cleanup.

5 years agoAuto merge of #6546 - k-nasa:fix_clippy_warning, r=ehuss
bors [Sat, 12 Jan 2019 03:04:01 +0000 (03:04 +0000)]
Auto merge of #6546 - k-nasa:fix_clippy_warning, r=ehuss

Fix clippy warning

## Fixed according to warning of clippy

- Remove unnecessary return keywords
- Remove unnecessary name assignment

5 years agoAuto merge of #6540 - dwijnand:fresh-nightly, r=ehuss
bors [Fri, 11 Jan 2019 12:23:33 +0000 (12:23 +0000)]
Auto merge of #6540 - dwijnand:fresh-nightly, r=ehuss

Revert "Workaround by using yesterday's nightly"

This reverts commit 5576372d3833f72ff4db865ece7b8acdbade2911.

5 years agoRevert "Workaround by using yesterday's nightly"
Dale Wijnand [Fri, 11 Jan 2019 10:36:40 +0000 (10:36 +0000)]
Revert "Workaround by using yesterday's nightly"

This reverts commit 5576372d3833f72ff4db865ece7b8acdbade2911.

5 years agorefactor: Delete unnecessary name assignment
k-nasa [Fri, 11 Jan 2019 04:35:28 +0000 (13:35 +0900)]
refactor: Delete unnecessary name assignment

5 years agorefactor: remove unnecessary `return` keyword
k-nasa [Fri, 11 Jan 2019 04:26:26 +0000 (13:26 +0900)]
refactor: remove unnecessary `return` keyword

5 years agojust touch some of the files we use.
Eh2406 [Thu, 10 Jan 2019 19:24:29 +0000 (14:24 -0500)]
just touch some of the files we use.

5 years agoadds a timestamp file in the fingerprint folder
Eh2406 [Sat, 22 Dec 2018 18:03:47 +0000 (13:03 -0500)]
adds a timestamp file in the fingerprint folder

5 years agoAuto merge of #6453 - spacekookie:publish-featured, r=alexcrichton
bors [Thu, 10 Jan 2019 18:37:22 +0000 (18:37 +0000)]
Auto merge of #6453 - spacekookie:publish-featured, r=alexcrichton

Adding feature-flags to `cargo publish` and `cargo package`

This change adds the `--features` and `--all-features` flags to the
above mentioned commands. This is to allow publishing of crates that
have certain feature requirements for compilation, without having to
rely on `--no-verify` which isn't good practise.

This PR adds two new fields `features` and `all_features` to both the
`PackageOpts` and `PublishOpts` and also adds the argument options
to the CLI commands.

Merging this feature will allow people to publish crates on crates.io
that require some feature flag to compile (or all?) without needing
to rely on not checking the package before uploading, potentially
resulting in less packaging errors and broken packages.

5 years agoAuto merge of #6530 - dwijnand:fix-badge, r=alexcrichton
bors [Thu, 10 Jan 2019 17:09:52 +0000 (17:09 +0000)]
Auto merge of #6530 - dwijnand:fix-badge, r=alexcrichton

Fix the Travis CI badge

And with this PR trigger the first travis-ci.com build! :D

5 years agoWorkaround by using yesterday's nightly
Dale Wijnand [Thu, 10 Jan 2019 10:10:11 +0000 (10:10 +0000)]
Workaround by using yesterday's nightly

5 years agoUse travis_terminate to fast fail
Dale Wijnand [Thu, 10 Jan 2019 09:25:54 +0000 (09:25 +0000)]
Use travis_terminate to fast fail

Workaround for https://github.com/travis-ci/travis-ci/issues/1066

5 years agoRun master branch tests on Travis CI for the badge
Dale Wijnand [Thu, 10 Jan 2019 07:01:05 +0000 (07:01 +0000)]
Run master branch tests on Travis CI for the badge

Only run for Rust stable and the Linux target.

5 years agoFix the Travis CI badge
Dale Wijnand [Wed, 9 Jan 2019 15:38:58 +0000 (15:38 +0000)]
Fix the Travis CI badge

5 years agoAuto merge of #6532 - alexcrichton:statuses, r=dwijnand
bors [Wed, 9 Jan 2019 20:13:51 +0000 (20:13 +0000)]
Auto merge of #6532 - alexcrichton:statuses, r=dwijnand

Add helpful text for Windows exceptions like Unix

On Unix if a process exits with a signal we'll print out which signal as
well as a small description of what happened, and this applies the same
logic to Windows. A few exit statuses are elaborated to their human
readable names (like `STATUS_ACCESS_VIOLATION`) to help for quick
debugging.

5 years agoAuto merge of #6531 - alexcrichton:report-elsewhere, r=ehuss
bors [Wed, 9 Jan 2019 19:41:26 +0000 (19:41 +0000)]
Auto merge of #6531 - alexcrichton:report-elsewhere, r=ehuss

Report fix bugs to Rust instead of Cargo

I originally opted to report bugs to Cargo instead of Rust because I was
afraid of the implementation of `cargo fix` itself. These seem to all be
weeded out now (largely at least), and the overwhelming majority of bugs
are now rust-lang/rust suggestion bugs. Let's suggest reporting bugs
directly there!

5 years agoAdd helpful text for Windows exceptions like Unix
Alex Crichton [Wed, 9 Jan 2019 17:47:43 +0000 (09:47 -0800)]
Add helpful text for Windows exceptions like Unix

On Unix if a process exits with a signal we'll print out which signal as
well as a small description of what happened, and this applies the same
logic to Windows. A few exit statuses are elaborated to their human
readable names (like `STATUS_ACCESS_VIOLATION`) to help for quick
debugging.

5 years agoReport fix bugs to Rust instead of Cargo
Alex Crichton [Mon, 7 Jan 2019 17:26:22 +0000 (09:26 -0800)]
Report fix bugs to Rust instead of Cargo

I originally opted to report bugs to Cargo instead of Rust because I was
afraid of the implementation of `cargo fix` itself. These seem to all be
weeded out now (largely at least), and the overwhelming majority of bugs
are now rust-lang/rust suggestion bugs. Let's suggest reporting bugs
directly there!

5 years agoAdding support for `no-default-features` to package and publish
Katharina Fey [Wed, 9 Jan 2019 17:25:36 +0000 (18:25 +0100)]
Adding support for `no-default-features` to package and publish

5 years agoFixing the publish tests
Katharina Fey [Wed, 9 Jan 2019 16:41:03 +0000 (17:41 +0100)]
Fixing the publish tests

5 years agoAuto merge of #6505 - DamianX:print_examples, r=ehuss
bors [Mon, 7 Jan 2019 16:23:06 +0000 (16:23 +0000)]
Auto merge of #6505 - DamianX:print_examples, r=ehuss

--{example,bin,bench,test} with no argument now lists all available targets

```
cargo run --bin
error: "--bin" takes one argument.
Available binaries:
    cargo

error: process didn't exit successfully: `target\debug\cargo.exe run --bin` (exit code: 101)
```

Previous PR: #5062
Closes #2548

Notes:
- `optional_opt` is a weird name, can someone come up with a better one?
- Should I call clap's `usage()` as well when printing the error message?

5 years agoAuto merge of #6484 - Eh2406:modified-during-build, r=alexcrichton
bors [Mon, 7 Jan 2019 15:46:04 +0000 (15:46 +0000)]
Auto merge of #6484 - Eh2406:modified-during-build, r=alexcrichton

Rebuild on mid build file modification

This is an attempt to Fixes #2426, it is based on the test @dwijnand made for #5417.

5 years agoAuto merge of #6527 - dwijnand:derive-Clone-for-TomlDependency, r=ehuss
bors [Mon, 7 Jan 2019 15:03:16 +0000 (15:03 +0000)]
Auto merge of #6527 - dwijnand:derive-Clone-for-TomlDependency, r=ehuss

Derive Clone for TomlDependency

Fixes #6526

5 years agoDerive Clone for TomlDependency
Dale Wijnand [Mon, 7 Jan 2019 07:03:36 +0000 (07:03 +0000)]
Derive Clone for TomlDependency

5 years agoAuto merge of #6525 - ehuss:publish-crates-io-alt, r=nrc
bors [Sun, 6 Jan 2019 21:40:12 +0000 (21:40 +0000)]
Auto merge of #6525 - ehuss:publish-crates-io-alt, r=nrc

publish: rework the crates.io detection logic.

The old code used an unreliable method to detect if `cargo publish` was publishing to crates.io. This should work even if the `--index` flag is used.

Also includes a very minor rewording of an error message mentioning crates.io, even for alternative registries.

5 years agoAuto merge of #6521 - starsheriff:feature/6377-duplicates-in-ignore-files, r=dwijnand
bors [Sun, 6 Jan 2019 09:21:57 +0000 (09:21 +0000)]
Auto merge of #6521 - starsheriff:feature/6377-duplicates-in-ignore-files, r=dwijnand

avoid duplicates in ignore files

Hi,
here is my first PR for cargo. It's my take on #6377 with some minor refactoring included, mainly to avoid keeping the two different types of ignore file entries (gitignore and hg) in sync.) Basically, the contents of a ignore file are now read if the file exists and filtered out. To filter out I would propose to just comment the entries that cargo would add out, in that way it is nice to see which duplicates were found and more important _what cargo usually adds_. In that way, a user can modify his ignore file and be sure that he can keep everything that cargo would add.

A new ignore file will look like this:
```
/target
**/*.rs.bk
Cargo.lock",
```

An existing ignore file will be modified like this:
```
/target
/some/other/path

#Added by cargo
#
#already existing elements are commented out

#/target
**/*.rs.bk
Cargo.lock
```

Fixes #6377

5 years agoback out 5919
Eh2406 [Fri, 4 Jan 2019 20:47:22 +0000 (15:47 -0500)]
back out 5919

5 years agopublish: rework the crates.io detection logic.
Eric Huss [Sat, 5 Jan 2019 18:56:49 +0000 (10:56 -0800)]
publish: rework the crates.io detection logic.

The old code used an unreliable method to detect if `cargo publish` was publishing to crates.io. This should work even if the `--index` flag is used.

Also includes a very minor rewording of an error message mentioning crates.io, even for alternative registries.

5 years agoavoid duplicates in ignore files
Johannes Weissmann [Fri, 4 Jan 2019 22:47:16 +0000 (23:47 +0100)]
avoid duplicates in ignore files

existing ignore files are now checked for duplicates. If the file
already contains an entry it is commented out in the section added by
cargo.

fixes #6377

5 years agoAuto merge of #6503 - Eh2406:RUSTFLAGS-in-Metadata, r=ehuss
bors [Fri, 4 Jan 2019 22:22:33 +0000 (22:22 +0000)]
Auto merge of #6503 - Eh2406:RUSTFLAGS-in-Metadata, r=ehuss

Rustflags in metadata

This is a small change that adds Rustflags to the `Metadata`. This means, for example, that if you do a plane build then build with "-C target-cpu=native", you will get 2 copies of the dependencies. Con, more space if you are changing Rustflags. Pro, not rebuilding all the dependencies when you switch back.

Suggested by <https://internals.rust-lang.org/t/idea-cargo-global-binary-cache/9002/31>

5 years agoMoved checks into compile_options(), changed tests
Damian [Thu, 3 Jan 2019 22:00:45 +0000 (23:00 +0100)]
Moved checks into compile_options(), changed tests

5 years agomake a helper function
Eh2406 [Thu, 3 Jan 2019 16:31:45 +0000 (11:31 -0500)]
make a helper function

5 years agoAuto merge of #6492 - mikerite:print-env-vars-4, r=alexcrichton
bors [Thu, 3 Jan 2019 19:12:38 +0000 (19:12 +0000)]
Auto merge of #6492 - mikerite:print-env-vars-4, r=alexcrichton

Display environment variables for rustc commands

This picks up on the work done in PR #5683.

The extra output is only displayed with `-vv`.

The Windows output has the form `set FOO=foo && BAR=bar rustc ...` instead of
the form that suggested in #5683 to make escaping easier and since it's
simpler.

5 years agoAuto merge of #6515 - ehuss:fix-fix-diag-race, r=alexcrichton
bors [Thu, 3 Jan 2019 18:18:28 +0000 (18:18 +0000)]
Auto merge of #6515 - ehuss:fix-fix-diag-race, r=alexcrichton

Fix a very minor race condition in `cargo fix`.

There is a very rare race where a "fix" message was getting posted *after* `Message::Finish`, and thus being dropped without being printed. This is caused by the diagnostic server disconnecting the client before posting `Message::FixDiagnostic`. The solution is to keep the client on the line until after the message is posted.

Fixes some errors in `fixes_missing_ampersand` seen in CI:
https://travis-ci.org/rust-lang/cargo/jobs/474384359
https://travis-ci.org/rust-lang/cargo/jobs/429809800

I also moved the `done` check to the beginning of the loop because every time the server was shut down it was needlessly trying to parse an empty string (and failing).

5 years agoAuto merge of #6516 - ehuss:doc-fix-overview, r=alexcrichton
bors [Thu, 3 Jan 2019 15:57:57 +0000 (15:57 +0000)]
Auto merge of #6516 - ehuss:doc-fix-overview, r=alexcrichton

Add a high-level overview of how `fix` works.

The fix code is pretty well commented, but I think it would be helpful to have an overview of how the pieces fit together.

5 years agoUpdate src/cargo/ops/fix.rs
Dale Wijnand [Thu, 3 Jan 2019 14:53:14 +0000 (06:53 -0800)]
Update src/cargo/ops/fix.rs

Fix typo.

Co-Authored-By: ehuss <eric@huss.org>
5 years agoSorting
Damian [Thu, 3 Jan 2019 09:14:25 +0000 (10:14 +0100)]
Sorting

5 years agoAdd a high-level overview of how `fix` works.
Eric Huss [Thu, 3 Jan 2019 05:52:03 +0000 (21:52 -0800)]
Add a high-level overview of how `fix` works.

The fix code is pretty well commented, but I think it would be helpful to have an overview of how the pieces fit together.

5 years agoFix a very minor race condition in `cargo fix`.
Eric Huss [Thu, 3 Jan 2019 05:46:14 +0000 (21:46 -0800)]
Fix a very minor race condition in `cargo fix`.

5 years agoBack touch the output instead of having a new important file.
Eh2406 [Wed, 2 Jan 2019 20:42:51 +0000 (15:42 -0500)]
Back touch the output instead of having a new important file.

This still round trips through the file system just in case it is on a different clock.

5 years agoAuto merge of #6500 - ehuss:metadata-reg, r=alexcrichton
bors [Wed, 2 Jan 2019 19:24:34 +0000 (19:24 +0000)]
Auto merge of #6500 - ehuss:metadata-reg, r=alexcrichton

Add dependency `registry` to `cargo metadata`.

This adds the `registry` field for dependencies for alternate registries in
`cargo metadata`.

5 years agomove the test
Eh2406 [Fri, 28 Dec 2018 15:15:25 +0000 (10:15 -0500)]
move the test

5 years agominimal changes to get the test to pass
Eh2406 [Tue, 25 Dec 2018 20:19:46 +0000 (15:19 -0500)]
minimal changes to get the test to pass

5 years agoupdate test for new idioms
Eh2406 [Tue, 25 Dec 2018 19:54:26 +0000 (14:54 -0500)]
update test for new idioms

5 years agoadd failing test
Dale Wijnand [Mon, 30 Apr 2018 17:29:16 +0000 (13:29 -0400)]
add failing test

5 years agoAuto merge of #6493 - ehuss:fix-fingerprint-patch, r=alexcrichton
bors [Wed, 2 Jan 2019 17:59:46 +0000 (17:59 +0000)]
Auto merge of #6493 - ehuss:fix-fingerprint-patch, r=alexcrichton

Fix fingerprint calculation for patched deps.

If you have A→B→C where B and C are in a registry, and you `[patch]` C, the fingerprint calculation wasn't working correctly when C changes. The following sequence illustrates the problem:

1. Do a build from scratch.
2. Touch a file in C.
3. Build again. Everything rebuilds as expected.
4. Build again. You would expect this to be all fresh, but it rebuilds A.

The problem is the hash-busting doesn't propagate up to parents from dependencies. Normal targets normally aren't a problem because they have a `LocalFingerprint::MtimeBased` style local value which always recomputes the hash. However, registry dependencies have a `Precalculated` style local value which never recomputes the hash.

The solution here is to always recompute the hash. This shouldn't be too expensive, and is only done when writing the fingerprint, which should only happen when the target is dirty. I'm not entirely certain why the caching logic was added in #4125.

Fixes rust-lang/rust#57142

5 years agoAuto merge of #6512 - matklad:serde-version, r=dwijnand
bors [Wed, 2 Jan 2019 16:16:56 +0000 (16:16 +0000)]
Auto merge of #6512 - matklad:serde-version, r=dwijnand

serialize version directly

Streamline serialization more, cc #6511

5 years agofix doc comment
Eh2406 [Wed, 2 Jan 2019 15:56:46 +0000 (10:56 -0500)]
fix doc comment

5 years agoAuto merge of #6355 - MarcusCalhoun-Lopez:dyld_fix, r=alexcrichton
bors [Wed, 2 Jan 2019 15:44:56 +0000 (15:44 +0000)]
Auto merge of #6355 - MarcusCalhoun-Lopez:dyld_fix, r=alexcrichton

use DYLD_FALLBACK_LIBRARY_PATH for dylib_path_envvar on macOS

See https://users.rust-lang.org/t/subprocess-and-dynamic-library-linking-problem-interaction/7873/10
See https://trac.macports.org/ticket/57692

5 years agosimplify test
Eh2406 [Wed, 2 Jan 2019 15:10:01 +0000 (10:10 -0500)]
simplify test