Commit graph

13801 commits

Author SHA1 Message Date
Scott Schafer a5ec7e0266 chore: update features tests to use check 2023-02-20 12:21:15 -06:00
Scott Schafer ea75921f2d chore: update edition tests to use check 2023-02-20 12:21:15 -06:00
Scott Schafer 620dfb13e1 chore: update doc tests to use check 2023-02-20 12:21:15 -06:00
Scott Schafer 76bb60cec7 chore: update directory tests to use check 2023-02-20 12:21:15 -06:00
Scott Schafer 88e4714eb2 chore: update dep_info tests to use check 2023-02-20 12:21:15 -06:00
Scott Schafer 5ec0ad2c97 chore: update death tests to use check 2023-02-20 12:21:15 -06:00
Scott Schafer 7dd17a44fa chore: update corrupt_git tests to use check 2023-02-20 12:20:46 -06:00
Scott Schafer 6d429b04b9 chore: update config_include tests to use check 2023-02-20 12:20:46 -06:00
Scott Schafer 8507c1701d chore: update config tests to use check 2023-02-20 12:20:46 -06:00
Scott Schafer d89e73c171 chore: update check_cfg tests to use check 2023-02-20 12:20:26 -06:00
Scott Schafer 3845fc9b4d chore: update cfg tests to use check 2023-02-20 12:20:26 -06:00
Scott Schafer c10a4c60c5 chore: update cargo_features tests to use check 2023-02-20 12:20:26 -06:00
Scott Schafer 9c6a044b74 chore: update cargo_env_config test to use check 2023-02-20 12:20:26 -06:00
Scott Schafer e2a6ed7984 chore: update cache_messages test to use check 2023-02-20 12:20:26 -06:00
Scott Schafer e9838a50ee chore: update build_script_env test to use check 2023-02-20 12:20:13 -06:00
Scott Schafer 822b257946 chore: Update docs for writing UI tests to use case for the test function name 2023-02-20 11:30:22 -06:00
Scott Schafer 41cd166887 refactor: Rename test names to case for init 2023-02-20 11:25:40 -06:00
Scott Schafer 08c6bb8446 refactor: Rename test names to case for cargo_add 2023-02-20 11:25:14 -06:00
Scott Schafer 9708e6f62d refactor: Make two tests stderr not match their test name 2023-02-20 11:09:05 -06:00
Scott Schafer 1744d35e80 chore: Remove unneeded #[test] 2023-02-20 11:09:05 -06:00
bors 6e66ee88fb Auto merge of #11740 - weihanglo:issue/9707, r=epage
Enhance help texts of position args
2023-02-20 15:29:44 +00:00
bors 9608f69b64 Auto merge of #11741 - Infinixius:patch-1, r=weihanglo
Fix typo

```diff
- Do not use special Windows name such as "nul".
+ Do not use special Windows names such as "nul".
```
2023-02-20 14:19:44 +00:00
Weihang Lo e59ae78bd6
Enhance help texts of position args 2023-02-19 22:06:18 +00:00
Infinixius 43bfff1c37
Fix typo 2023-02-19 22:01:49 +00:00
TrAyZeN 98edd706ad Suggest cargo add when installing library crate 2023-02-18 17:39:11 +01:00
bors eff8d693b9 Auto merge of #11724 - ehuss:cargo-ok-comment, r=weihanglo
Update comment about cargo-ok

In #11665 I added some code to deal with a truncated `.cargo-ok` file. However I misunderstood the likely reason this was happening. Rust versions from 1.0 to 1.34 created empty files, and versions 1.36 to 1.49 could create empty files if they were interrupted during extraction.

This PR updates the comment to try to explain this in detail to replace the erroneous comment from before. I think the change of deleting the directory is still the safe choice, even if it causes some cache churn when dealing with crates extracted by versions before 1.34.
2023-02-18 00:10:28 +00:00
bors 17b3d0de08 Auto merge of #11733 - bebecue:issue-11726, r=weihanglo
fix: unsupported protocol error on old macos version

fix #11726
2023-02-17 19:45:09 +00:00
Kyle Matsuda b86426246c store OsString instead of String in config.env 2023-02-17 12:19:54 -07:00
bebecue 9e2933ee54 fix: also ignore pipewait error 2023-02-18 01:31:00 +08:00
bebecue 6dbfde37e1 refactor: move try_old_curl!() to util::network 2023-02-18 01:24:53 +08:00
bebecue f182b84813 fix: unsupported protocol error on old macos version
fix #11726
2023-02-18 00:47:58 +08:00
Kyle Matsuda a148cd4e2f another std::env::var to Config::get_env 2023-02-16 17:36:44 -07:00
Kyle Matsuda 577222c4dc change config to actually read the env variables through config.env snapshot 2023-02-16 17:36:44 -07:00
Kyle Matsuda 747cb6f3ea change from std::env::var(_os) to Config::get_env(_os) in places where config is available 2023-02-16 17:36:44 -07:00
Kyle Matsuda fd46d10f85 rename Config::get_env to Config::get_config_env; add public methods get_env and get_env_os 2023-02-16 17:36:37 -07:00
bors a66f1233f9 Auto merge of #11600 - Akida31:issue-11571-bad-token, r=Eh2406
Error on invalid alphanumeric token for crates.io

ref #11571

When using `cargo login` and calling an api which requires authentification there will be an error if the given token is not a valid alphanumerical string.
This check is only enabled for crates.io because
only for that registry we can be certain, that the generated token should have been alphanumeric, see [the code here](7ea41e9d34/src/util/token.rs (L15)). So if I'm not mistaken, this should not be a breaking change, since crates.io only generates fitting tokens. (Should I add a comment to the crates.io code that modifying this logic can break cargo?)

I'm not sure if the fix works and is enough to close the issue, please say if you have any corrections or improvements!

I don't know if the check should also be enabled for other registries and it would be really bad if the check is too strict.
In the linked issue it was recommended to encode invalid characters, but I don't know in which encoding. I saw in [this http rfc](https://www.rfc-editor.org/rfc/rfc7230#section-3.2.4) that only the ISO-8859-1 charset is allowed and everything else must be [encoded](https://www.rfc-editor.org/rfc/rfc7230#section-3.2.4) but this seems somewhat complex and hard to implement. There is a crate `rust-encoding` which should be capable doing this (from a first look), but I don't know if a new dependency only for this is justified. There seems to be `percent encoding` already in the dependency tree but I have no idea if it would be correct and work.
If you have any idea about this encoding, please say so.

r? `@Eh2406` (since you suggested the encoding part)
2023-02-16 19:46:40 +00:00
akida31 8502fa8568
remove double check 2023-02-16 20:28:02 +01:00
akida31 823ab52f19
Address review comments
* moved `is_empty` check into `check_token`
* improved error message (is quite long now but should explain the error
  well)
* removed one helper function from new test
2023-02-16 19:12:46 +01:00
akida31 3d2e107b5a
Error on invalid token for registry auth
When using registry operations with authentication there will be now an
error if the given token is not valid.
This is a technically a breaking change because a registry might give
some tokens which will be denied by these new checks.
In practice these tokens cause issues with HTTP so no registry should
generate them.
2023-02-16 16:42:30 +01:00
Eric Huss c43136e9fa Update comment about cargo-ok 2023-02-15 13:39:43 -08:00
Scott Schafer 7fcb542f7f chore: update bad_manifest_path test to use check 2023-02-15 15:28:48 -06:00
Scott Schafer 9174c22744 chore: update build_config test to use check 2023-02-15 15:28:48 -06:00
Scott Schafer 1873c33482 chore: update alt_registry test to use check 2023-02-15 15:28:48 -06:00
bors 2f84e1a45c Auto merge of #11722 - Muscraft:add-clippy-lints, r=epage
Add clippy lints

It was discussed in a recent cargo team meeting that it would be okay to allow specific `clippy` lints to be `warn`/`deny` within cargo.

This PR adds a CI job that denies `clippy` warnings for cargo's `lib`. As well as sets [`clippy::self_named_module_files`](https://rust-lang.github.io/rust-clippy/master/index.html#self_named_module_files) to be a warning.

[`clippy::self_named_module_files`](https://rust-lang.github.io/rust-clippy/master/index.html#self_named_module_files): "Checks that module layout uses only `mod.rs` files". This allows cargo's structure to be consistent and enforced across the board.
2023-02-15 21:25:01 +00:00
Scott Schafer d7d27cd74c chore: Warn on clippy::self_named_module_files 2023-02-15 12:14:22 -06:00
Scott Schafer bf52c09991 ci: Add a job to deny clippy warnings 2023-02-15 12:13:21 -06:00
bors 25b8771541 Auto merge of #11719 - Muscraft:order-toml-deps, r=weihanglo
chore: Make dependencies alphabetical order

`[dependencies]` in some `Cargo.toml` were out of alphabetical order. This made it slightly more time-consuming to find if a dependency was in a `Cargo.toml`.

This PR makes it so that they are in alphabetical order.

Note: `rustc-workspace-hack` was left alone at the bottom as it is a special dependency.
2023-02-15 16:49:13 +00:00
Scott Schafer c3043d9a9e chore: Make dependencies alphabetical order 2023-02-15 09:22:08 -06:00
bors 2555e1c898 Auto merge of #11716 - weihanglo:bump-mdbook, r=Muscraft
chore: bump mdbook to 0.4.27

Previously mdbook was bumped in #11646 for contrib.yml worflow
but main.yaml workflow. This makes the two in sync and also
upgrades to the latest 0.4.27. (Though there is nothing really
changed for application users as us)
2023-02-15 14:44:09 +00:00
Weihang Lo 3e1f60fcb0
chore: bump mdbook to 0.4.27
Previously mdbook was bumped in #11646 for contrib.yml worflow
but main.yaml workflow. This makes the two in sync and also
upgrades to the latest 0.4.27. (Though there is nothing really
changed for application users as us)
2023-02-15 11:37:35 +00:00