Commit graph

80 commits

Author SHA1 Message Date
Weihang Lo ad2c45bde9
refactor: clean up package metadata
Like PR 12352 but for homepage and repository

Versions for

* `cargo-credential-1password`
* `cargo-util-schemas`
* `home`

are bumped along with the change.
2023-12-18 16:09:03 -05:00
Arlo Siemsen 04af5e7a06 Avoid writing CACHEDIR.TAG if it already exists 2023-12-07 14:51:01 -06:00
Weihang Lo 870f9ea7b3
lint: allow disallow_methods 2023-11-16 11:35:21 -05:00
Weihang Lo 1539b3dfc1
lint: dogfood ourselves lints table in manifest
These lint rules are from src/lib.rs. We aim to remove
them in the source code once `Zlints` hit stable.
2023-11-16 11:35:21 -05:00
Eric Huss 1d35833e3b Switch from AtomicU64 to Mutex.
Not all platforms support AtomicU64, so this swaps the usage with
Mutex. The difference in performance should be imperceptible.
2023-11-15 14:41:56 -08:00
Eric Huss 9588fb6dda Add a du utility function.
This adds a very primitive `du` function for determining the disk usage
in a directory. This should probably be improved or replaced at some
point in the future, this is just a start for supporting tracking sizes
of cache data.
2023-11-11 10:56:58 -08:00
bors f7e7cc2356 Auto merge of #12820 - linyihai:broken-symlink-target, r=weihanglo
add detailed message when target folder path is invalid

# What does this PR try to resolve?
close https://github.com/rust-lang/cargo/issues/12789

add more detailed message when target folder path is invalid

# How should we test and review this PR?

Before this PR, if the target folder refer to broken symbolic link like /a/b/c, then run cargo build, the output is:

```
error: Not a directory (os error 20)
```
the detailed error message is missing.

This PR will add the error context for it, the finall output will be
```
cargo build
error: failed to create directory `/root/workspace/playground/target`

Caused by:
  Not a directory (os error 20)
```
2023-10-14 04:43:58 +00:00
Lin Yihai ceac419776 add detailed message when target folder path is invalid 2023-10-14 11:34:42 +08:00
Ed Page 7846fe8cb4 chore: Sort dependency tables
This will make `cargo add` put things in the right place.

Verified by doing `cargo add arcstr && git diff && git reset --hard`
2023-10-10 15:03:22 -05:00
Tom Scanlan aee8c75410
bug: corruption when killed while writing 2023-10-01 08:29:24 -04:00
Eric Huss 62d86470d1 Add wrappers around std::fs::metadata
This adds wrappers around std::fs::metadata and
std::fs::symlink_metadata which provide better error messages indicating
the path that caused the error.
2023-09-06 21:41:54 -07:00
Ed Page 7a65c826a0 fix: Set MSRV for internal packages
For now, I'm punting on packages we generally expect others to use
2023-08-22 16:46:47 -05:00
Weihang Lo 5691da2b79
chore(cargo-util): bump version to 0.2.6 2023-08-16 20:06:40 +01:00
Weihang Lo 9d707e4b9a
chore: remove log, env_logger, and pretty_env_logger 2023-08-07 12:02:19 +01:00
Weihang Lo af1a78b424
refactor: find & replace log:: -> tracing::
Except HTTP network debugging
2023-08-07 11:25:40 +01:00
Weihang Lo 9f0565e985
chore: add tracing crate 2023-08-07 11:21:55 +01:00
Ed Page 4bd5f9ca50 chore(util): Version bump 2023-07-17 13:21:41 -05:00
Ed Page 5d80aa263d refactor: Provide workspace-level default license 2023-07-17 13:21:41 -05:00
Ed Page f358359a17 refactor: Provide a workspace-level default edition 2023-07-17 13:21:40 -05:00
trevyn 5dfae689fa Improve error chain formatting 2023-05-30 13:55:05 +04:00
trevyn 0b8c12f5c6 Document reasoning and report previous error chain 2023-05-30 07:51:07 +04:00
trevyn ddc49783ce Fall back to fs::remove_dir_all on error 2023-05-28 17:57:49 +04:00
bors d90ff55ca5 Auto merge of #11968 - bzEq:aix-libpath, r=weihanglo
fix: AIX searches dynamic libraries in `LIBPATH`.

### What does this PR try to resolve?

On IBM AIX machines people have encountered issues in `compiletest` and rustc's bootstrap builder. They haven't encountered any in cargo. This PR is made for avoiding potential failures in the future in cargo.

It's documented in <https://www.ibm.com/support/pages/libpath-environment-variables-aix-platforms>:

> The `LIBPATH` environment variable tells AIX applications where to find shared libraries when located in a different directories than those specified in the header section of the executable.

See also the counterpart in <https://github.com/rust-lang/rust/pull/109526>

### How to verify and test this in Cargo's CI?

This is indeed an issue. At IBM people are maintaining a buildbot since GitHub Action doesn't support AIX yet.
2023-05-25 10:20:29 +00:00
Scott Schafer 34b8c39d77 chore: Use [workspace.dependencies] 2023-04-28 09:56:09 -05:00
Eric Huss ac25009500 Update windows-sys 2023-04-23 12:40:00 -07:00
Kai Luo c5ed77629b AIX searches dynamic libraries in LIBPATH. 2023-04-13 13:20:54 +08:00
bors 16d0495d29 Auto merge of #11624 - vext01:poll-loop-fixes, r=ehuss
Poll loop fixes

### What does this PR try to resolve?

A couple of minor issues. See individual commits.

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

The existing test suite should have sufficient coverage.

### Additional information

(I have 5 apparently unrelated failures locally when running `cargo test`)
2023-03-20 12:42:45 +00:00
Andreas Hollmann 2f0ecf5425 Use sha2 to calculate SHA256 2023-03-05 00:03:28 +01:00
Weihang Lo b9bfda596f
chore: bump jobserver to respect --jobserver-auth=fifo:PATH'
See https://github.com/alexcrichton/jobserver-rs/pull/49
2023-02-28 16:08:12 +00:00
hzlinyiyu ae91d4ed41 do some clean up 2023-01-31 18:02:57 +08:00
Edd Barrett 5c3825ffc5
Set non-blocking IO more robustly.
- Check for errors.
 - Add O_NONBLOCK on top of any existing flags.

set_nonblock() is adapted from lang_tester:
e01072a0a4/src/tester.rs (L1041-L1048)
2023-01-25 12:15:14 +00:00
Edd Barrett 493ca3364a
Fix incorrect comment.
The event loop uses poll(2), not select(2).
2023-01-25 12:15:14 +00: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