Commit Graph

12912 Commits

Author SHA1 Message Date
Arlo Siemsen fe7ff11f72 Remove sparse+ prefix for index.crates.io 2022-10-16 17:06:45 -05:00
Weihang Lo 0195423233
Remove unused `CompileOptions.local_rustdoc_args` 2022-10-16 08:03:48 +08:00
Weihang Lo 3fd7580c5b
remove unnecessary specialiized `FilterRule::try_collect` method 2022-10-16 07:31:26 +08:00
Weihang Lo f4da514ddc
doc(cargo_compile): more on compile filter 2022-10-16 06:42:55 +08:00
Weihang Lo e6d90b4c1f
refactor: extract `Packages` & `CompileFilter` to separate modules 2022-10-16 06:11:39 +08:00
Weihang Lo d86d3bfb3b
doc(build_context): module level doc 2022-10-16 05:06:15 +08:00
Weihang Lo fa50fc12b3
doc(target_info): add missing doc comments 2022-10-16 05:02:46 +08:00
bors afadab23a5 Auto merge of #11240 - epage:docs, r=Muscraft
docs(add): Add missing flags to reference

Fixes #11237
2022-10-14 18:41:07 +00:00
bors 2f93984d73 Auto merge of #11227 - cassaundra:remove-docs, r=epage
Document `cargo remove`

### What does this PR try to resolve?

This PR continues the deferred work of #11099 by adding documentation for the cargo remove subcommand.

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

Ensure that the documentation renders correctly and appropriately covers the feature.
2022-10-14 18:01:31 +00:00
Ed Page 85c8f63f2a docs(add): Add missing flags to reference
Fixes #11237
2022-10-14 09:24:18 -05:00
bors 99ff79e96e Auto merge of #11239 - epage:add, r=weihanglo
fix: Update help headings to  match clap

This was missed when upgrading to clap v4

Fixes #11238
2022-10-14 12:22:34 +00:00
Ed Page f46da373ba fix: Update help headings to match clap
This was missed when upgrading to clap v4

Fixes #11238
2022-10-14 07:16:27 -05:00
Cassaundra Smith 9bacebf9e1
Document `cargo remove` 2022-10-13 17:53:28 -07:00
bors b332991a57 Auto merge of #11170 - basile-henry:basile-henry/built-in-alias-shadow, r=epage
Differentiate the warning when an alias (built-in or user-defined) shadows an external subcommand

Fixes #11149
2022-10-13 22:05:28 +00:00
Basile Henry 3ff6d9e698 Add built-in alias shadowing not warning test 2022-10-13 22:22:52 +01:00
Basile Henry 444af4847e Don't warn about shadowing in the case where the alias is built-in 2022-10-13 22:22:52 +01:00
bors 351378006d Auto merge of #11235 - epage:clap, r=weihanglo
chore: Update tests for latest clap
2022-10-13 20:22:44 +00:00
Ed Page 5f30808d00 chore: Update tests for latest clap 2022-10-13 15:16:38 -05:00
Ed Page f2fc5ca86d fix(publish): Block until it is in index
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

So now `cargo` will block until it sees the package in the index.
- This is checking via the index instead of server APIs in case there
  are propagation delays.  This has the side effect of being noisy
  because of all of the "Updating index" messages.
- This is done unconditionally because cargo used to block and that
  didn't seem to be a problem, blocking by default is the less error
  prone case, and there doesn't seem to be enough justification for a
  "don't block" flag.

The timeout was 5min but I dropped it to 1m.  Unfortunately, I don't
have data from `cargo-release` to know what a reasonable timeout is, so
going ahead and dropping to 60s and assuming anything more is an outage.

Fixes #9507
2022-10-13 12:56:40 -05:00
bors b592ba4d97 Auto merge of #11230 - epage:unstable2, r=weihanglo
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 (https://github.com/rust-lang/cargo/issues/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 16:21:09 +00:00
bors 0b61503914 Auto merge of #11231 - hi-rustin:rustin-patch-build-doc, r=epage
Add missing edition

### What does this PR try to resolve?

When I read this doc, I found that we are missing the edition key in this manifest. I think we should add it because `cargo new` always does this.
2022-10-13 15:37:33 +00:00
hi-rustin fa815f345c Add missing edition
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-10-13 23:14:31 +08: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
Scott Schafer 66b62d2745 test(publish): Demonstrate the impact of non-blocking publish 2022-10-13 08:40:26 -05:00
Scott Schafer 8fadfe7f33 test(registry): Allow `custom_responders` to call normal responders 2022-10-13 08:40:26 -05:00
bors 9bdc926508 Auto merge of #11219 - weihanglo:doc/profiles, r=ehuss
doc(profiles): add module level doc
2022-10-12 22:48:04 +00:00
bors 823d917df0 Auto merge of #11216 - epage:registry, r=ehuss
refactor(publish): Clarify which SourceId is being used

Ran into confusion on this when updating #11062 to be on top of #10907. This now threads both types of sources through which comments explaining each so callers will always have to explicitly acknowledge which they are dealing with.
2022-10-12 21:47:33 +00:00
bors 5788d76d68 Auto merge of #11209 - arlosi:sparse-kind, r=ehuss
Add new SourceKind::SparseRegistry to differentiate sparse registries

Refactor sparse registry to have its own `SourceKind`.
Follow up from https://github.com/rust-lang/cargo/pull/11177#issuecomment-1272395571

r? `@ehuss`
2022-10-12 21:03:19 +00:00
bors 642a0e625d Auto merge of #11205 - arlosi:build-deadlock, r=ehuss
Fix deadlock when build scripts are waiting for input on stdin

### What does this PR try to resolve?

#10738 introduced a regression where build scripts did not close stdin, causing deadlocks for build scripts waiting for stdin.

Fixes #11196 by not piping `stdin` unless requested by the `ProcessBuilder`.

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

Run a build script that reads from stdin and check that it no longer hangs. See the POC in the linked issue. The included test hangs without the fix.

r? `@ehuss`
2022-10-12 20:18:44 +00:00
bors 953a63013e Auto merge of #11184 - weihanglo:features2-refactor, r=ehuss
refactor: New variant `FeaturesFor::ArtifactDep`
2022-10-12 19:35:06 +00:00
Weihang Lo 74d7fe395a
doc(profiles): add module level doc 2022-10-12 19:10:41 +01:00
Arlo Siemsen d51ed05324 Fix deadlock when build scripts are waiting for input on stdin 2022-10-12 11:46:51 -05:00
bors 35162068fb Auto merge of #11221 - arlosi:fixci, r=weihanglo
Fix rustdoc warning about unclosed HTML tag

nightly rustdoc is warning about `<name>` being an unclosed HTML tag. Fix by using backticks instead of single quotes.
2022-10-12 15:14:38 +00:00
Arlo Siemsen c99e9732f9 Use backticks instead of single quotes to fix rustdoc CI 2022-10-12 10:07:15 -05:00
Ed Page c9f984a9b4 refactor(publish): Clarify which SourceId is being used
Ran into confusion on this when updating #11062 to be on top of #10907.
This now threads both types of sources through which comments explaining
each so callers will always have to explicitly acknowledge which they
are dealing with.
2022-10-12 09:57:29 -05:00
bors 83a1f66d11 Auto merge of #11210 - epage:publish, r=weihanglo
refactor(tests): Prepare for wait-for-publish test changes

In #11062, we are updating `cargo publish` to wait until a package is published.   The problem is a lot of our tests will block until the timeout.  In finding the tests to update, I was originally relying on test failures from the extra output when timing out.  The problem is not all tests verify the test output so they don't fail.

This tries to update the tests to make the introduction of a timeout more obvious.
- Adding `with_stderr` where it wasn't before
- Moving away from `with_stderr_contains` for publish tests

To help with that, I made the predicates on cargo commands more consistent.

I also moved descriptions of tests to be outside of the test so I can more easily document the `registry::init` calls with what we are doing.
2022-10-11 22:59:06 +00:00
bors 8e740bb6c8 Auto merge of #11215 - arlosi:sparse-cfg, r=weihanglo
Add configuration option for controlling crates.io protocol

### What does this PR try to resolve?

Currently, if `-Z sparse-registry` is passed, then Cargo will access crates.io using the sparse protocol. Since we want to stabilize this feature soon, we need a stable way to control which protocol is used.

This adds a config option `registries.crates-io.protocol` that can be set to either `sparse` or `git`. If the option is unset, it will be `sparse` if `-Z sparse-registry` is enabled, otherwise it will be `git`.

This PR does not stabilize `sparse-registry`. Using `registries.crates-io.protocol` without `-Z sparse-registry` will result in an error.

The next steps after PR are to:
* stabilize `sparse-registry`
* make `sparse` the default protocol

### Additional information
The config option is based on the discussion in this note: https://hackmd.io/`@rust-cargo-team/B13O52Zko`
2022-10-11 22:01:32 +00:00
Ed Page 487d7e5268 refactor(tests): Publish using a real registry 2022-10-11 15:24:54 -05:00
Arlo Siemsen d77aef5ba4 Add configuration option for controlling crates.io protocol
`registries.crates-io.protocol` can be set to either `sparse` or `git`.
The default is `git` unless `-Z sparse-registry` is passed.
2022-10-11 14:44:09 -05:00
Arlo Siemsen 56f68168f3 Add new SourceKind::SparseRegistry to differentiate sparse registries 2022-10-11 09:26:59 -05:00
bors b8f30cb23c Auto merge of #11207 - weihanglo:doc-polish, r=epage
Add more doc comments for three modules
2022-10-10 19:16:06 +00:00
Weihang Lo 24fa52780b
doc(util/profile): polish 2022-10-10 20:01:38 +01:00
Weihang Lo b981b7e542
doc(cargo_compile): polish 2022-10-10 20:01:38 +01:00
bors fef785a14f Auto merge of #11208 - tshepang:patch-1, r=epage
docs: fix
2022-10-10 18:26:19 +00:00
Tshepang Mbambo daf6fd366c
docs: fix 2022-10-10 20:17:31 +02:00
Ed Page 33ba607783 refactor(tests): Hack publish to balance testing/wait_for_publish 2022-10-10 13:10:29 -05:00
Ed Page 8995e84124 docs(tests): Clarify why a local registry is preferred 2022-10-10 13:05:56 -05:00
Ed Page 08df53ba48 refactor(tests): Be explicit about publish stderr 2022-10-10 13:03:20 -05:00
Ed Page 5e5b5325be refactor(tests): Be more explicit about publish stderr
This will help find tests timing out due to #11062
2022-10-10 12:54:32 -05:00
Weihang Lo 92007a5897
doc(unit_dependencies): polish 2022-10-10 18:52:44 +01:00