Commit graph

477 commits

Author SHA1 Message Date
Eric Huss fa39fd4cd9 Bump to 0.65.0 2022-07-01 11:43:25 -07:00
bors 501b56b26e Auto merge of #10804 - ehuss:bump-cargo-util, r=joshtriplett
Bump cargo-util version.

#10546 made a semver-incompatible change to the API of `ProcessBuilder::get_args`. Unfortunately we did not catch that until it was published. This bumps the version of cargo-util to 0.2.1 to accommodate that change. Stable will get version 0.2.0 so that the changes on beta can be released as 0.2.1 in their own time.

cc #10803
2022-07-01 04:21:25 +00:00
Eric Huss 41ac6078aa Bump cargo-util version. 2022-06-30 14:25:28 -07:00
Eric Huss 72320bdcca Update os_info 2022-06-30 14:00:23 -07:00
Ed Page 6f475f090e chore: Upgrade to clap 3.2 2022-06-13 10:02:23 -05:00
Weihang Lo 8345cf5037
Revert #10427: switch from num_cpus
This reverts commit 6d11f9e7d4, reversing
changes made to c5cdd25c14.
2022-06-09 07:47:00 +08:00
Yuki Okushi 819f7a5cff
Enforce to use tar v0.4.38 2022-06-01 19:17:15 +09:00
Eric Huss 1bfb897485 Update libcurl 2022-05-23 08:21:50 -07:00
Eric Huss 447384ed72 Bump to 0.64.0 2022-05-20 13:27:39 -07:00
Ed Page 8e0868057a chore: Upgrade toml_edit 2022-04-26 10:16:26 -05:00
Ed Page 6ec86fc47b test(add): Import cargo-add tests
This is a fork of https://github.com/killercup/cargo-edit/tree/merge-add
at d561719161ed5564111ff2152ff206463ec24cef
2022-04-11 13:09:40 -05:00
Ed Page 5ca5f2f157 feat: Add add cargo subcommand
This is a fork of https://github.com/killercup/cargo-edit/tree/merge-add
at d561719161ed5564111ff2152ff206463ec24cef
2022-04-11 13:06:10 -05:00
bors 1073915930 Auto merge of #10546 - weihanglo:issue-10381-rustc-argfile, r=epage
Retry command invocation with argfile

### What does this PR try to resolve?

Fixes #10381

The goal is to invoke `rustc` and `rustdoc` with ``@path`` arg file as a fallback.

Since the `-Zcheck-cfg-features`[^1] has already been implemented, in the foreseeable future cargo will probably hit the “**command line too big**” more often on Windows. `rustdoc` and `rustc` both support ``@path`` argfile [^2][^3], so we can leverage the feature for the fallback logic.

The idea behind this PR is that we put the **retry logic** in `ProcessBuilder::exec*` functions and reuse them as much as possible.

### How should we test and review this PR?

Review it commit by commit is recommended.

Argfile fallback is hard to tested with integration tests, so I added some unit tests for `cargo_util::ProcessBuilder` and `cargo::ops::fix::FixArgs`.

If you do want to test the support of argfile manually, a new environment variable `__CARGO_TEST_FORCE_ARGFILE` is added for the sake of forcing cargo to use argfile for rustc invocations. For example, `__CARGO_TEST_FORCE_ARGFILE cargo test --test testsuite -- fix::` is usually a good start to test this feature.

[^1]: https://doc.rust-lang.org/beta/cargo/reference/unstable.html?highlight=check#check-cfg-features
[^2]: https://doc.rust-lang.org/rustc/command-line-arguments.html#path-load-command-line-flags-from-a-path
[^3]: https://doc.rust-lang.org/rustdoc/command-line-arguments.html#path-load-command-line-flags-from-a-path
2022-04-11 14:57:46 +00:00
bors b36cc6ed41 Auto merge of #10538 - Muscraft:rfc2906-part3, r=epage
Part 3 of RFC2906 - Add support for inheriting `license-path`, and `depednency.path`

Tracking issue: #8415
RFC: rust-lang/rfcs#2906

[Part 1](https://github.com/rust-lang/cargo/pull/10497)
[Part 2](https://github.com/rust-lang/cargo/pull/10517)

This PR focuses on adding support for inheriting `license-path`, and `depednency.path`:
- To adjust the relative paths from being workspace-relative to package-relative, we use `pathdiff` which `cargo-add` is also going to be using for a similar purpose
- `ws_path` was added to `InheritableFields` so we can resolve relative paths from  workspace-relative to package-relative
- Moved `resolve` for toml dependencies from `TomlDependency::<P>` to `TomlDependency`
  - This was done since resolving a relative path should be a string
  - You should never inherit from a `.cargo/config.toml` which is the reason `P` was added

Remaining implementation work for the RFC
- Relative paths for `readme`
- Path dependencies infer version directive
- Lock workspace dependencies and warn when unused
- Optimizations, as needed
- Evaluate any new fields for being inheritable (e.g. `rust-version`)
2022-04-08 15:38:07 +00:00
Weihang Lo 4f6a2ec28b
Bump cargo-util to 0.1.3 2022-04-08 15:39:36 +08:00
Eric Huss 3d5f944180 Bump to 0.63.0 2022-04-07 15:04:31 -07:00
Scott Schafer 3d07652c38 Part 3 of RFC2906 - Add support for inheriting license-path, and depednency.path 2022-04-07 16:34:34 -05:00
Weihang Lo 0e044546f8
Bump git2@0.14.2 and libgit2-sys@0.13.2
The previous libgit2-sys release forgot to include the fix of libgit2 1.4.2.
https://github.com/rust-lang/git2-rs/pull/820#issuecomment-1064284814
That might cause problems when people don't have "Git for Windows"
installed on their machines.
2022-03-15 07:26:45 +08:00
bors 6d11f9e7d4 Auto merge of #10427 - weihanglo:drop-num_cpus, r=joshtriplett
Use `available_parallelism` instead of `num_cpus`
2022-03-08 17:07:30 +00:00
bors e756c130cf Auto merge of #10442 - Urgau:git2-update, r=alexcrichton
Update git2 dependencies

This pull-request update git2 to 0.14.1 and git2-curl to 0.15.0 and libgit2-sys to 0.13.1.

This fix a memory corruption that I have locally when running the testsuite:
```
==2338650==  Uninitialised value was created by a stack allocation
==2338650==    at 0x11FE3A0: git2::remote::Remote::fetch (remote.rs:276)
```
2022-03-01 18:12:20 +00:00
Loïc BRANSTETT dd701a17f3 Update git2 to 0.14.1 and git2-curl to 0.15.0 and libgit2-sys to 0.13.1 2022-03-01 18:39:22 +01:00
Weihang Lo 1988bc8d37
Use available_parallelism instead of num_cpus
`std:🧵:available_parallelism` has been stabilized since 1.59.0.

Also, we don't want to block timing data output, so if parallelism
data is not available the table will display `ncpu=n/a` instead.
2022-02-26 16:52:59 +08:00
Eric Huss 560ee81ec1 Bump to 0.62.0 2022-02-24 13:47:20 -08:00
Jon Gjengset dfda89a82e Bump clap to match when deprecations happened 2022-02-16 20:01:57 -08:00
Ed Page 0f75237617 test: Fix compatibilty with new toml_edit
`toml_edit` fixed a bug in 0.13.4 that this test was relying on that is
meant to help with rust-lang/cargo#10349.  This basically restores us
back to the pre-toml_edit behavior for published manifests.
2022-01-31 10:57:38 -06:00
Weihang Lo 13a09beccf
Bump clap to 3.0.13 2022-01-27 19:27:52 +08:00
bors bb96b3a3e8 Auto merge of #10086 - epage:toml, r=ehuss
Port cargo from toml-rs to toml_edit

Benefits:
- A TOML 1.0 compliant parser
- Unblock future work
  - Have `cargo init` add the current crate to the workspace, rather
    than error
  - #5586: Upstream `cargo-add`

TODO
- [x] Analyze performance and address regressions
- [x] Identify and resolve incompatibiies
- [x] Resolve remaining test failures, see
      https://github.com/ordian/toml_edit/labels/cargo
- [x] ~~Switch the code from https://github.com/rust-lang/cargo/pull/10176 to only parse once~~ (this PR is being merged first)
2022-01-20 03:56:18 +00:00
Eric Huss a25d3864d9 Bump to 0.61.0 2022-01-14 10:57:54 -08:00
Ed Page 320c279f43 Port cargo from toml-rs to toml_edit
Benefits:
- A TOML 1.0 compliant parser
- Unblock future work
  - Have `cargo init` add the current crate to the workspace, rather
    than error
  - #5586: Upstream `cargo-add`
2022-01-13 09:27:27 -06:00
bors e77c0719fd Auto merge of #10269 - ehuss:stabilized-new-features, r=alexcrichton
Stabilize namespaced and weak dependency features.

This stabilizes the namespaced and weak dependency features.  Support is now enabled on crates.io, so this should be ready to go.

As a part of this change, the new feature resolver is now enabled all of the time. This is fairly risky, since there are likely edge cases that haven't been exercised.
NOTE: Projects using `resolver="1"` *should* continue to have the same behavior, the old resolver behavior is emulated.

Closes #8813
Closes #8832
2022-01-12 15:15:09 +00:00
Eric Huss 43a063c80a Stabilize namespaced and weak dependency features. 2022-01-06 15:56:56 -08:00
Ed Page f17ecafc24 Upgrade to Clap 3
- One parser change found by `cargo_config::includes` is that clap 2
  would ignore any values after a `=` for flags.
  `cargo config --show-origin` is a flag but the test passed `--show-origin=yes` which
  happens to give the desired result for that test but is the same as
  `--show-origin=no` or `--show-origin=alien-invasion`.
- The parser now panics when accessing an undefined attribute but clap
  takes advantage of that for sharing code across commands that have
  different subsets of arguments defined.  I've extended clap so we can
  "look before you leap" and put the checks at the argument calls to
  start off with so its very clear what is tenuously shared.  This
  allows us to go in either direction in the future, either addressing
  how we are sharing between commands or by moving this down into the
  extension methods and pretending this clap feature doesn't exist
- On that topic, a test found clap-rs/clap#3263.  For now, there is a
  hack in clap.  Depending on how we fix that in clap for clap 4.0, we
  might need to re-address things in cargo.
- `value_of_os` now requires setting `allow_invalid_utf8`, otherwise it
  asserts.  To help catch this, I updated the argument definitions
  associated with lookups reported by:
  - `rg 'values?_os' src/`
  - `rg 'values?_of_os' src/`
- clap now reports `2` for usage errors, so we had to bypass clap's
  `exit` call to keep the same exit code.

BREAKING CHANGE: API now uses clap3
2022-01-05 19:54:54 -06:00
pinkforest e4f09b6afa Bumps up tar to 0.4.36 2021-12-15 15:01:43 +11:00
bors 599961b320 Auto merge of #10155 - ehuss:bump-deps, r=alexcrichton
Bump versions of local deps.

There have only been very minor changes since the last version.
2021-12-13 17:47:44 +00:00
bors 5d7ac5897d Auto merge of #10154 - ehuss:version-bump, r=alexcrichton
Bump to 0.60.0, update changelog
2021-12-13 17:00:36 +00:00
Weihang Lo cc267c7a72
Upgrade clap to 2.34.0
That includes the fix of preventing panicking on a broken pipe.
accf3d2511
2021-12-05 01:33:38 +08:00
Eric Huss 06bffb59a7 Bump versions of local deps. 2021-12-03 11:05:03 -08:00
Eric Huss c52f8e2b3b Bump to 0.60.0 2021-12-03 10:21:10 -08:00
Russ Weas 22ff7ac47c Update curl dependency, remove M1 macOS build error note 2021-11-20 22:04:58 -06:00
Eric Huss 84283f0c3a Update curl. 2021-11-04 21:14:19 -07:00
Alex Crichton c687d83ada Remove authors directives from Cargo crates
Most of these are pretty dated and Cargo defaults nowadays to not
emitting an `authors` field so this commit also removes them from the
manifests.
2021-10-22 10:27:20 -07:00
Alex Crichton cabe1cca0a Upgrade Cargo to the 2021 edition
This didn't actually result in any code changes yet, for now this simply
flips the edition flag for all of our crates and documentation.
2021-10-22 10:25:52 -07:00
Eric Huss 88117505b8 Bump to 0.59.0 2021-10-22 07:53:17 -07:00
Eric Huss 5a8be7ba21 Add os to verbose version string. 2021-10-11 11:22:48 -07:00
Eric Huss c5318a17e7 Add some more information to verbose version. 2021-10-08 12:54:24 -07:00
Eric Huss ed2bfc2cc8 Update git2 2021-10-06 16:04:41 -07:00
Alex Crichton 6b2ca55acd Bump curl-sys dependency
Brings in curl 7.79.1
2021-09-22 06:22:36 -07:00
Eric Huss 637ee66375 Temporarily revert curl-sys update. 2021-09-18 12:43:14 -07:00
Eric Huss 28eb20305c Update curl-sys 2021-09-17 03:04:06 -07:00
Alex Crichton 3093df485c Bump Cargo's curl requirement to 7.79.0
Brings in the latest release of `curl`
2021-09-15 07:39:25 -07:00