Commit graph

12896 commits

Author SHA1 Message Date
hi-rustin 7eadd58eef Update duplicate build targets test
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-12-01 08:58:52 +08:00
hi-rustin 494e29dcd3 Improve file found in multiple build targets warning
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-12-01 08:58:43 +08:00
bors 1985caf190 Auto merge of #11292 - arlosi:compression, r=epage
Add Accept-Encoding request header to enable compression

### What does this PR try to resolve?

Cargo does not request compression from servers. Enabling compression can save bandwidth and improve performance.

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

I validated locally that the header was being sent using a local proxy (Fiddler). It sent `Accept-Encoding: deflate, gzip` on Windows.
2022-10-27 01:37:25 +00:00
bors 1c1e9a61cb Auto merge of #11294 - ehuss:highfive-docs, r=weihanglo
Update contrib docs for highfive transition

As of #11293, this repo is now using triagebot (AKA `@rustbot)` for auto-assignment of PRs. This PR updates the contributor documentation to accommodate this change.
2022-10-27 00:16:45 +00:00
Eric Huss cf38262995 Update contrib docs for highfive transition 2022-10-26 16:58:34 -07:00
bors 1cb94b0733 Auto merge of #11293 - ehuss:highfive-triagebot, r=Mark-Simulacrum
Migrate from highfive to triagebot

This migrates the rust-lang/cargo repo to use triagebot instead of highfive.
2022-10-26 23:19:08 +00:00
bors 1945b44853 Auto merge of #11287 - Rageking8:fix-dupe-word-typos, r=weihanglo
Fix dupe word typos
2022-10-26 07:41:02 +00:00
Rageking8 61813d9d72 fix dupe word typos 2022-10-26 12:15:45 +08:00
bors da63337681 Auto merge of #11283 - arlosi:sparse-error, r=weihanglo
Fix confusing error messages when using -Zsparse-registry

Built-in replacements of crates.io have confusing a description:
> crates.io index (which is replacing registry `crates-io`)

This adds a special case for built-in source replacements of `crates-io`. User-defined replacements of crates.io continue to use the existing description.

Also fixes the test framework `__CARGO_TEST_CRATES_IO_URL_DO_NOT_USE_THIS` variable to strip the `sparse+` prefix when checking if a url `is_crates_io`.

Fixes #11277
2022-10-26 04:09:55 +00:00
Arlo Siemsen 7c89237104 Add Accept-Encoding request header to enable compression 2022-10-25 17:36:39 -05:00
bors 9210810d1f Auto merge of #11286 - ehuss:410-gone, r=Eh2406
Fix 410 gone response handling

This changes the sparse-registry support for the 410 "Gone" HTTP response code. This is out of sync with the [load function](8adf1df292/src/cargo/sources/registry/http_remote.rs (L375)) mentioned in the comment. I assume it is supposed to be 410 and not 401 since 401 is "Unauthorized", and that doesn't signify that the resource is "not found".

r? `@arlosi`
2022-10-25 22:31:50 +00:00
Eric Huss c8c6a963c0 Fix 410 gone response handling 2022-10-25 14:45:41 -07:00
Arlo Siemsen 40293266b2 Fix confusing error messages when using -Zsparse-registry 2022-10-25 13:51:43 -05:00
bors 8adf1df292 Auto merge of #11281 - smheidrich:fix-stale-mtime-log-ineq, r=ehuss
Fix inequality in "stale mtime" log messages

### What does this PR try to resolve?

If `CARGO_LOG=cargo::core::compiler::fingerprint=info` is set, cargo will print log messages that are useful for finding out why something is being recompiled. E.g. if the modification time (mtime) of a source file is newer than the cached build result, it will print something like:

```
stale: changed "/host//home/runner/.cargo/registry/src/github.com-1285ae84e5963aae/proc-macro2-1.0.47/build.rs"
          (vs) "/host/home/runner/target/release/build/proc-macro2-45f04ea9067a46ed/output"
               FileTime { seconds: 1666559031, nanos: 16426033 } != FileTime { seconds: 1666559080, nanos: 324117075 }
```

However, the `!=` in the log message is misleading, as equality is not the [criterion that's actually used](071eeaf210/src/cargo/core/compiler/fingerprint.rs (L1761)) to determine when to rebuild.

This PR fixes that by changing `!=` to `<`, corresponding to the actual criterion.

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

Look at the [criterion](071eeaf210/src/cargo/core/compiler/fingerprint.rs (L1761)) I linked and trace `stale_mtime` in the log message back to `path_mtime` in said criterion to see why it has to be `<`.
2022-10-25 02:55:45 +00:00
Eric Huss 92bdd2582f Migrate from highfive to triagebot 2022-10-24 09:32:22 -07:00
bors 62b6d5a112 Auto merge of #11282 - weihanglo:doc/cargo-tree, r=epage
doc(cargo-tree): mention it considering feature unification
2022-10-24 16:25:26 +00:00
Weihang Lo 4a76339cb5
doc(cargo-tree): mention it considering feature unification 2022-10-24 23:27:03 +08:00
bors 19d37d29b1 Auto merge of #11280 - hi-rustin:rustin-patch-error-msg, r=weihanglo
Improve the error message if `publish` is `false` or empty list

### What does this PR try to resolve?

close https://github.com/rust-lang/cargo/issues/11262

Improve the error message if `publish` is the false or empty list.

Say `publish` is set to `false` or an empty list in Cargo.toml and prevents publishing.
### How should we test and review this PR?

Unit test

### Additional information

If there was a way we could tell `publish` to be empty or `false`, I think it would get better. If you know an easy way to implement it, please feel free to comment.
2022-10-24 15:17:27 +00:00
hi-rustin 6c9f36d99b Update not in list error message
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-10-24 22:50:25 +08:00
hi-rustin 66a8488cf6 Update error messages for tests
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-10-24 21:25:47 +08:00
bors 6e9da768f5 Auto merge of #11278 - ehuss:deleted-entry-test, r=epage
Add test for deleted index entry

This adds a test for when an entry is deleted from the index. This is done on crates.io occasionally for things like copyright takedown requests.

This behavior was tripping a debug assert which this removes. I'm not entirely certain why the debug assert is there, but I think it is not correct, since this is obviously a scenario where there might be a cached file, but the index responds with NotFound.
2022-10-24 13:14:51 +00:00
smheidrich f3fd53d544 Fix inequality in "stale mtime" log messages 2022-10-24 01:27:32 +02:00
hi-rustin 3bbd5a5dbe Improve error message if publish is false or empty list
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-10-23 15:51:35 +08:00
Eric Huss 5e6da66c03 Add test for deleted index entry 2022-10-22 18:20:52 -07:00
bors 071eeaf210 Auto merge of #11273 - epage:toml, r=weihanglo
fix: Remove leading newline in vendor output

This supersedes #11271
2022-10-22 01:17:55 +00:00
bors 174ec748c3 Auto merge of #11268 - arlosi:fix-sparse-publish, r=ehuss
Fix publishing with a dependency on a sparse registry

### What does this PR try to resolve?
On publishing, the `registry_index` field was being set to the registry URL without the `sparse+` prefix. During the verification build, Cargo would attempt to fetch the registry as a `git` registry. Caused by #11209.

Fixes #11263.

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

Added a test that fails without the change.
2022-10-22 00:17:11 +00:00
Ed Page a9f704aaaa fix: Remove leading newline in vendor output
This supersedes #11271
2022-10-21 12:27:21 -05:00
Arlo Siemsen 49fb8f3d88 Fix publishing with a dependency on a sparse registry 2022-10-20 17:21:32 -05:00
bors b1b25a0255 Auto merge of #11265 - hi-rustin:rustin-patch-missing, r=epage
Add missing edition

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-20 14:55:24 +00:00
hi-rustin 96bf10e1d4 Add missing edition
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-10-20 21:52:43 +08:00
bors a6e72d0a27 Auto merge of #11255 - epage:registry, r=arlosi
fix(publish): Check remote git registry more than once post-publish

With `publish-timeout` on remote git registries, we were checking once and never checking again.  There were 3 layers of guards preventing the cache from being updating
- `needs_update`, handled via `invalidate_cache`
- `config.updated_sources()`,. handled by removing from the HashSet
- `updated`, inaccessible

This change collapses `updated` into `config.updated_sources()`, allowing the cache to be updated

Tested by publishing `epage-publish-test`.  After about 7 registry updates, it succeded.  Before, it just hit the timeout of 60s.  No tests are added as we don't have the plumbing setup to be able to control when the test remote git registry publishes.  All of our tests focus on the remote http registry.

Fixes #11253
2022-10-20 11:17:03 +00:00
bors bab91cafb3 Auto merge of #11258 - hi-rustin:rustin-patch-typo, r=weihanglo
Fix typo

### What does this PR try to resolve?
It's `first-come-first-serve` not `first-come-first- serve`.
<img width="743" alt="image" src="https://user-images.githubusercontent.com/29879298/196712847-f575615a-2538-45ae-915a-64406dc5c7e8.png">
2022-10-20 03:55:34 +00:00
hi-rustin 49b0fbbb26 Fix typo
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-10-19 21:59:15 +08:00
Ed Page dd696741fd fix(publish): Check remote git registry more than once post-publish
With `publish-timeout` on remote git registries, we were checking once
and never checking again.  There were 3 layers of guards preventing the
cache from being updating
- `needs_update`, handled via `invalidate_cache`
- `config.updated_sources()`,. handled by removing from the HashSet
- `updated`, inaccessible

This change collapses `updated` into `config.updated_sources()`,
allowing the cache to be updated

Tested by publishing `epage-publish-test`.  After about 7 registry
updates, it succeded.  Before, it just hit the timeout of 60s.  No tests
are added as we don't have the plumbing setup to be able to control when
the test remote git registry publishes.  All of our tests focus on the
remote http registry.

Fixes #11253
2022-10-18 11:39:41 -05:00
bors 3ff044334f Auto merge of #11243 - weihanglo:refactor/cargo_compile, r=epage
Some tiny refactors around `ops::cargo_compile`

### What does this PR try to resolve?

Some tiny refactors I found during polishing documentations.

- Extract `CompileFilter` and `Packages` from `ops::cargo_compile` to their own modules.
- Remove `FilterRule::try_collect` as its intent is not clear, and we don't need this indirection.
- Remove `CompileOptions::local_rustdoc_args`, which is obsolete since 1ef954ea.
2022-10-17 20:25:00 +00:00
Weihang Lo 886c9d2153
refactor(cargo_compile): move to mod.rs 2022-10-18 01:59:12 +08:00
bors e008032442 Auto merge of #11241 - weihanglo:doc/build_context, r=epage
Polish docs for module `build_context`
2022-10-17 12:27:27 +00:00
bors 76293b3ade Auto merge of #11247 - arlosi:fix-sparse, r=Eh2406
Remove sparse+ prefix for index.crates.io

### What does this PR try to resolve?

#11209 changed how sparse registry URLs are stored in a `SourceId` to remove the `sparse+` prefix, however the URL was not updated.

Fixes #11246

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

Run a command that requires sparse registry `cargo  -Z sparse-registry update --dry-run`

Tests can't really be added for this case, since the `index.crates.io` URL was incorrect, and tests shouldn't access the network.

r? `@Eh2406`
2022-10-16 22:48:25 +00:00
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