49 Commits

Author SHA1 Message Date
hzlinyiyu
ae91d4ed41 do some clean up 2023-01-31 18:02:57 +08:00
Ed Page
ed8b85f10e chore: Fix typos 2023-01-10 20:03:11 -06:00
Expyron
bb837662d8 chore: Upgrade miow 2022-11-18 14:08:46 +01: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
Ed Page
8d6a828c18 chore: Upgrade miow 2022-11-03 19:59:25 -05:00
Rageking8
61813d9d72 fix dupe word typos 2022-10-26 12:15:45 +08:00
Arlo Siemsen
d51ed05324 Fix deadlock when build scripts are waiting for input on stdin 2022-10-12 11:46:51 -05:00
Eric Huss
41ac6078aa Bump cargo-util version. 2022-06-30 14:25:28 -07:00
Arlo Siemsen
24dac452c5 Improve testing framework for http registries
Improve integration of the http server introduced by the http-registry feature.
Now the same HTTP server is used for serving downloads, the index, and
the API.

This makes it easier to write tests that deal with authentication and
http registries.
2022-06-10 16:51:35 -05:00
Scott Schafer
cab6d30c1d fix typos found by the typos-cli crate 2022-05-10 16:47:28 -05:00
bors
7a3b56b486 Auto merge of #10553 - sourcefrog:cachedir, r=weihanglo
Mark .cargo/git and .cargo/registry as cache dirs

Fixes #10457

### What does this PR try to resolve?

As we previously discussed in #10457 this marks `~/.cargo/git` and `~/.cargo/registry` as not to be included in backups, and not subject to content indexing. These directories can be fairly large and frequently changed, and should only contain content that can be re-downloaded if necessary.

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

I did two manual tests:

1. Using the binary built from this tree, run `cargo update` in a source tree that has a git dependency, and observe that afterwards, there is a `CACHEDIR.TAG` in `~/.cargo/git`.
2. Similarly, run `cargo update` and observe that there's a `CACHEDIR.TAG` in `~/.cargo/registry`.

(I ran this on Linux. This code should also trigger OS-specific behavior on macOS and Windows that's the same as is currently applied to `target/`.)

I added some test assertions.
2022-04-27 08:55:00 +00:00
Martin Pool
ae5fd5e2e1 exclude_from_backups_and_indexing can't fail
Ignore errors creating the registry directory
2022-04-25 18:29:13 -07:00
Martin Pool
ce9a6ab648 Mark .cargo/git and .cargo/registry as cache dirs
Fixes #10457 (but still needs tests)
2022-04-10 16:19:21 -07:00
Weihang Lo
7146111afe
Close tempfile explicitly after the command to exist 2022-04-10 22:23:20 +08:00
Weihang Lo
5e8827f26e
Debug assertion for rustc argfile invocations 2022-04-10 22:23:19 +08:00
Weihang Lo
3f749f615b
Ensure non-UTF8 compatibility of argfile arg 2022-04-10 21:46:43 +08:00
Weihang Lo
9155c0062b
Ensure that temporary argfile lives longer them command execution 2022-04-10 21:46:43 +08:00
Weihang Lo
877c0add35
State that arg in argfile must not contain newlines 2022-04-10 21:46:42 +08:00
Weihang Lo
4f6a2ec28b
Bump cargo-util to 0.1.3 2022-04-08 15:39:36 +08:00
Weihang Lo
b788e52246
Retry with argfile if hitting "command line too big" error
- Add `ProcessBuilder::output` and ProcessBuilder::status`, which are
  unopinionated version of `exec_*` (won't error out when exitcode > 0)
- Add `ProcessBuilder::retry_with_argfile` to enable trying with argfile
  when hitting the "command line too big" error.
2022-04-08 15:39:36 +08:00
Weihang Lo
c9d443a063
Separate command wrappers from command arguments 2022-04-08 13:38:14 +08:00
maxwase
2623af0c43 Use is_symlink() method 2022-01-14 00:36:24 +03:00
bors
180f599f60 Auto merge of #10196 - charlesroussel:master, r=alexcrichton
Add workaround for sporadic kills when building on Macos

This is the workaround for the issue https://github.com/rust-lang/cargo/issues/10060
2021-12-16 16:36:36 +00:00
Charles Roussel
c9c67c0a93 Add workaround for sporadic kills when building on Macos 2021-12-16 16:59:57 +01:00
Eric Huss
06bffb59a7 Bump versions of local deps. 2021-12-03 11:05:03 -08:00
bors
dc6a1d5304 Auto merge of #10000 - alexcrichton:upgrade-edition, r=Eh2406
Upgrade Cargo to the 2021 edition

While I was poking around in the manifests I also went ahead and removed the `authors` entries since at least the one for Cargo itself is quite outdated and Cargo otherwise doesn't use these any more.
2021-10-23 18:08:27 +00:00
Sebastian Thiel
cf8e464d6f
Do not canonicalize the exe-candidate at all
And here is why: https://github.com/rust-lang/cargo/pull/9991#issuecomment-949727679
2021-10-23 15:29:47 +08: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
Sebastian Thiel
4906ef2364
Assure the binary name won't change after canonicalization, and keep looking if it does. 2021-10-21 18:21:18 +08:00
Sebastian Thiel
0d06193bf1
Only canonicalize executable path if it has relative directories
Otherwise symbolic links may also accidentally be resolved which may
lead to unexpected results in the case of 'coreutils', a binary
that depends on the executable name being a symbolic link.

This means a path like /bin/echo being canonicalized to /bin/coreutils
will loose all information about the desired functionality.

Test failures will occur if 'echo' is resolved that way and it's
not trivial to find the cause of it in the provided error messages.
2021-10-21 17:03:58 +08:00
Eric Huss
4fbf61da10 Bump cargo-util version. 2021-07-29 09:23:23 -07:00
Toothbrush
c973a6d0af
rustfmt 2021-06-29 18:18:28 +01:00
Toothbrush
684391e444
Change if cfg!(..) { } to #[cfg!(..)] { }
This fixes builds on non-Windows platforms.
2021-06-29 17:19:14 +01:00
Toothbrush
f1c8e56909
Format exclude_from_content_indexing 2021-06-28 21:45:59 +01:00
Toothbrush
9d96a88961
Exclude target from content-indexing on Windows
This has a noticeable performance improvement for most projects, especially when the storage device is a hard drive.

Closes #8694
2021-06-28 20:12:44 +01:00
Tomasz Miąsko
8df771f381 Avoid quadratic complexity when splitting output into lines
When searching for newlines in a process output keep track which part of
buffer was already examined to avoid processing the same data again and
again.
2021-06-18 20:00:55 +02:00
Tomasz Miąsko
9f60fcacaf Simplify line splitting code in exec_with_streaming NFC 2021-06-18 20:00:55 +02:00
Weihang Lo
df82a44f9e
refactor: extract common make_dep_path to cargo_util 2021-06-01 11:14:53 +08:00
Paul Mabileau
9ea1cbdeda
Fix doc warnings for cargo-util::paths
Add parentheses to disambiguate from `write!`.

Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr>
2021-05-09 19:47:08 +02:00
Eric Huss
4aa1ec2419 Move Sha256 to cargo-util. 2021-03-20 17:42:41 -07:00
Eric Huss
1dae5acb7d Move paths to cargo-util. 2021-03-20 17:42:41 -07:00
Eric Huss
dbfdd49559 Move is_ci to cargo-util. 2021-03-20 17:42:32 -07:00
Eric Huss
888100352a Move ProcessBuilder to cargo-util. 2021-03-20 15:19:03 -07:00
Eric Huss
669340333a Split util code into a separate package. 2021-03-20 15:15:54 -07:00