337 Commits

Author SHA1 Message Date
Weihang Lo
3d862d8d8b
by default saves credentials to .cargo/credentials.toml 2023-01-04 16:25:52 +00:00
bors
dd9900585a Auto merge of #11407 - dnbln:reasons-for-rebuilding, r=weihanglo
Reasons for rebuilding
2022-12-30 13:25:46 +00:00
bors
7fb01c68c1 Auto merge of #10771 - Eh2406:asymmetric_tokens, r=ehuss
Asymmetric tokens

Builds on and is blocked by #10592. This adds initial support for Asymmetric Tokens #10519.
2022-12-29 16:39:06 +00:00
Dinu Blanovschi
0beb5fe93d Simple explanations for why cargo rebuilds crates 2022-12-28 16:27:50 +01:00
Jacob Finkelman
cd967098ea Indentation and spelling 2022-12-19 19:08:48 +00:00
Julien Merzoug Cosnuau
4db4a13662 Fix typo 2022-12-16 22:02:41 +01:00
Jacob Finkelman
5e709d45f1 add comment to Mutation 2022-12-14 20:50:51 +00:00
Jacob Finkelman
29ff25f6d9 cleanups round 1 2022-12-13 23:49:07 +00:00
Jacob Finkelman
2ac15086fb end-to-end tests 2022-12-12 21:50:08 +00:00
Jacob Finkelman
6d1c07bcc5 Send asymmetric tokens with mutations 2022-12-12 20:11:26 +00:00
Lucio Franco
ac9da4b193 home: Remove github ci, link license, remove others 2022-12-12 13:52:23 -05:00
Lucio Franco
6a1a9edd40 Merge branch 'homemerge' into lucio/home-crate 2022-12-12 13:46:59 -05:00
Lucio Franco
dbb8dada19 Add crate 2022-12-12 13:46:41 -05:00
Ed Page
48895b1681 fix: Move off atty to resolve soundness issue
There is a soundness issue with atty when building on Windows with a
custom allocator.

This PR switches direct dependencies on atty to is-terminal.  New semver
compatible versions of clap and snapbox remove atty. #11417 upgrades
env_logger to remove it from there.

Fixes #11415
2022-11-25 06:28:01 -06:00
bors
de56c1251b Auto merge of #10343 - willcrichton:example-analyzer, r=weihanglo
Change rustdoc-scrape-examples to be a target-level configuration

This PR addresses issues raised in rust-lang/cargo#9525. Specifically:
1. It enables examples to be scraped from `#[test]` functions, by passing additional flags to Rustdoc to ensure that these functions aren't ignored by rustc.
2. It moves the `arg` from `-Z rustdoc-scrape-examples={arg}` into a target-level configuration that can be added to Cargo.toml.

The added test `scrape_examples_configure_target` shows a concrete example. In short, examples will be default scraped from Example and Lib targets. Then the user can enable or disable scraping like so:

```toml
[lib]
doc-scrape-examples = false

[[test]]
name = "my_test"
doc-scrape-examples = true
```
2022-11-25 06:58:20 +00:00
Expyron
bb837662d8 chore: Upgrade miow 2022-11-18 14:08:46 +01:00
Arlo Siemsen
9827412fee Implement RFC 3139: alternative registry authentication support 2022-11-16 14:36:19 -06:00
Will Crichton
39e6737de7 Change rustdoc-scrape-examples to be a target-level configuration 2022-11-16 09:18:33 -08:00
Weihang Lo
054a19ba2f
Bump crate crates-io to 0.35.0 2022-11-13 10:55:15 +00:00
Weihang Lo
851492c788
Bump crate cargo-util to 0.2.3 2022-11-13 10:55:10 +00:00
RyanAD
eb8d3e2932 simplify join_paths error message and add test 2022-11-12 18:44:22 -07:00
RyanAD
730e8ca46d make call to paths::join_paths and warn if path contains invalid chars 2022-11-12 18:43:46 -07:00
RyanAD
23c1a51ad0 Improve error message in join_paths when env contains a path separator 2022-11-12 18:43:37 -07:00
hi-rustin
6de9ed11be Fix not a hyperlink warnings
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-11-10 08:52:32 +08:00
Arlo Siemsen
90c6b5854d Fix waiting for publishing to complete when publishing to a sparse registry 2022-11-08 18:14:52 -06:00
bors
9286a1beba Auto merge of #11328 - epage:upgrade, r=weihanglo
chore: Upgrade dependencies

This upgrades several dependencies to the latest "major" release.  The original intent was just to get onto the latest snapbox but I noticed several others that could be updated and thought "why not".

- `snapbox` broke compatibility on less used APIs
- Its unclear from the docs if `miow` or `remove_dir_all` even broke compatibility

I did not touch `mdman` as that has several large, stale deps
2022-11-04 06:41:49 +00:00
Ed Page
8d6a828c18 chore: Upgrade miow 2022-11-03 19:59:25 -05:00
Eric Huss
fa8375b3c9 Remove remove_dir_all 2022-11-03 16:51:48 -07:00
Ed Page
25f838bfb7 chore: Upgrade snapbox 2022-11-02 23:15:48 -05:00
bors
352175f810 Auto merge of #11285 - jonhoo:cargo-env, r=weihanglo
Make cargo forward pre-existing CARGO if set

Currently, Cargo will always set `$CARGO` to point to what it detects its own path to be (using `std::env::current_exe`). Unfortunately, this runs into trouble when Cargo is used as a library, or when `current_exe` is not actually the binary itself (e.g., when invoked through Valgrind or `ld.so`), since `$CARGO` will not point at something that can be used as `cargo`. This, in turn, means that users can't currently rely on `$CARGO` to do the right thing, and will sometimes have to invoke `cargo` directly from `$PATH` instead, which may not reflect the `cargo` that's currently in use.

This patch makes Cargo re-use the existing value of `$CARGO` if it's already set in the environment. For Cargo subcommands, this will mean that the initial invocation of `cargo` in `cargo foo` will set `$CARGO`, and then Cargo-as-a-library inside of `cargo-foo` will inherit that (correct) value instead of overwriting it with the incorrect value `cargo-foo`. For other execution environments that do not have `cargo` in their call stack, it gives them the opportunity to set a working value for `$CARGO`.

One note about the implementation of this is that the test suite now needs to override `$CARGO` explicitly so that the _user's_ `$CARGO` does not interfere with the contents of the tests. It _could_ remove `$CARGO` instead, but overriding it seemed less error-prone.

Fixes #10119.
Fixes #10113.
2022-11-02 12:38:30 +00:00
Anton Lazarev
d70a4ee93c
update stderr in tests for unrelated functionality 2022-10-28 17:13:25 -07:00
Rageking8
61813d9d72 fix dupe word typos 2022-10-26 12:15:45 +08:00
Jon Gjengset
724a1977ce Make cargo forward pre-existing CARGO if set
Currently, Cargo will always set `$CARGO` to point to what it detects
its own path to be (using `std::env::current_exe`). Unfortunately, this
runs into trouble when Cargo is used as a library, or when `current_exe`
is not actually the binary itself (e.g., when invoked through Valgrind
or `ld.so`), since `$CARGO` will not point at something that can be used
as `cargo`. This, in turn, means that users can't currently rely on
`$CARGO` to do the right thing, and will sometimes have to invoke
`cargo` directly from `$PATH` instead, which may not reflect the `cargo`
that's currently in use.

This patch makes Cargo re-use the existing value of `$CARGO` if it's
already set in the environment. For Cargo subcommands, this will mean
that the initial invocation of `cargo` in `cargo foo` will set `$CARGO`,
and then Cargo-as-a-library inside of `cargo-foo` will inherit that
(correct) value instead of overwriting it with the incorrect value
`cargo-foo`. For other execution environments that do not have `cargo`
in their call stack, it gives them the opportunity to set a working
value for `$CARGO`.

One note about the implementation of this is that the test suite now
needs to override `$CARGO` explicitly so that the _user's_ `$CARGO` does
not interfere with the contents of the tests. It _could_ remove `$CARGO`
instead, but overriding it seemed less error-prone.

Fixes #10119.
Fixes #10113.
2022-10-25 13:51:27 -07:00
Ed Page
a9f704aaaa fix: Remove leading newline in vendor output
This supersedes #11271
2022-10-21 12:27:21 -05:00
Ed Page
04d836fa71 feat(publish): Support 'publish.timeout' config behind '-Zpublish-timeout'
Originally, crates.io would block on publish requests until the publish
was complete, giving `cargo publish` this behavior by extension.  When
crates.io switched to asynchronous publishing, this intermittently broke
people's workflows when publishing multiple crates.  I say interittent
because it usually works until it doesn't and it is unclear why to the
end user because it will be published by the time they check.  In the
end, callers tend to either put in timeouts (and pray), poll the
server's API, or use `crates-index` crate to poll the index.

This isn't sufficient because
- For any new interested party, this is a pit of failure they'll fall
  into
- crates-index has re-implemented index support incorrectly in the past,
  currently doesn't handle auth, doesn't support `git-cli`, etc.
- None of these previous options work if we were to implement
  workspace-publish support (#1169)
- The new sparse registry might increase the publish times, making the
  delay easier to hit manually
- The new sparse registry goes through CDNs so checking the server's API
  might not be sufficient
- Once the sparse registry is available, crates-index users will find
  out when the package is ready in git but it might not be ready through
  the sparse registry because of CDNs

This introduces unstable support for blocking by setting
`publish.timeout` to non-zero value.

A step towards #9507
2022-10-13 08:53:36 -05:00
Arlo Siemsen
d51ed05324 Fix deadlock when build scripts are waiting for input on stdin 2022-10-12 11:46:51 -05:00
Arlo Siemsen
dd5134c7a5 Implement RFC 3289: source replacement ambiguity 2022-10-07 22:30:59 -05:00
Arlo Siemsen
dcc512b317 Add retry support to sparse registries 2022-10-07 12:00:24 -05:00
Scott Schafer
251a2c7915 cargo-test-support: Make publish http api write to file system 2022-09-22 10:00:49 -06:00
Scott Schafer
0ba6224a70 cargo-test-support: allow processing of the body of a request for test http registries 2022-09-21 10:07:09 -06:00
Pietro Albini
0bf436d0d2
fix formatting 2022-09-14 16:14:11 +02:00
Weihang Lo
dafe4a7ea0
CVE-2022-36113: add tests 2022-09-14 10:54:47 +02:00
bors
e5ec3a8ff9 Auto merge of #11004 - jonhoo:bump-git2, r=weihanglo
Bump git2 to 0.15 and libgit2-sys to 0.14

This will allow cargo to avoid vendored builds of git2 in up-to-date
environments going forward, and brings in the [libgit2 1.4.4 CVE fix].

[libgit2 1.4.4 CVE fix]: https://github.com/libgit2/libgit2/releases/tag/v1.4.4
2022-08-27 09:22:12 +00:00
Jon Gjengset
ed78e6b747 Bump snapbox to 0.3
0.3 has a small number of [breaking changes], but makes diffs much
easier to visually parse by eliding large sections of unchanged content.

[breaking changes]: https://github.com/assert-rs/trycmd/blob/main/crates/snapbox/CHANGELOG.md#030---2022-08-01
2022-08-17 22:07:20 +00:00
Jon Gjengset
30fe22b260 Bump git2 to 0.15 and libgit2-sys to 0.14
This will allow cargo to avoid vendored builds of git2 in up-to-date
environments going forward, and brings in the [libgit2 1.4.4 CVE fix].

[libgit2 1.4.4 CVE fix]: https://github.com/libgit2/libgit2/releases/tag/v1.4.4
2022-08-17 22:02:28 +00:00
Wim Looman
61c4b11eae
Ensure rustc-echo-wrapper works with an overridden build.target-dir 2022-08-10 17:37:40 +02:00
Eric Holk
8de9adfb0d Use old Windows path handling on CI 2022-08-03 16:09:06 -07:00
Eric Holk
e9c7544c19 Move Windows path test function to test code 2022-08-03 15:59:59 -07:00
bors
333478d0aa Auto merge of #10929 - ehuss:ignore-reason, r=weihanglo
Add reasons to all ignored tests.

This adds a reason string to all `#[ignore]` attributes. This will be displayed when running the test (since 1.61), which can help quickly see and identify why tests are being ignored. It looks roughly like:

```
test basic ... ignored, requires nightly, CARGO_RUN_BUILD_STD_TESTS must be set
test build::simple_terminal_width ... ignored, --diagnostic-width is stabilized in 1.64
test check_cfg::features_with_cargo_check ... ignored, --check-cfg is unstable
test plugins::panic_abort_plugins ... ignored, requires rustc_private
```
2022-08-03 03:54:05 +00:00
Eric Huss
a8e285aa18 Always allow hg to be missing on CI. 2022-08-02 15:18:16 -07:00