19345 Commits

Author SHA1 Message Date
Ed Page
d9f65ec218
Make "C" explicit in extern "C". (#15034)
We're making the `missing_abi` lint a warning in rustc, see:
https://github.com/rust-lang/rust/pull/132397
2025-01-08 17:51:15 +00:00
Mara Bos
a9b50c201b Make "C" explicit in extern "C". 2025-01-08 18:14:15 +01:00
Weihang Lo
b696870dd8
simplify SourceID Ord/Eq (#14980)
### What does this PR try to resolve?

This is a followup to #14800. Like that PR, this is a small incremental
change that does not pull its own weight. If this PR is accepted, the
next PR will unlock large performance wins. I am not posting them
together because the logic of why this PR is correct is subtle and
deserves to be discussed and reviewed without unrelated code changes.

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

All tests pass on all commits. This **should** be reviewed one commit at
a time.

### Additional information

I pushed one commit at a time, so that CI can confirm that the assert
(in the first commit) is never hit.
2025-01-07 19:24:18 +00:00
Ed Page
83615cfa78
Setup cargo environment for cargo rustc --print (#15026)
It turns out, running `cargo rustc --print cfg -Zunstable-options` (and
the like, https://github.com/rust-lang/cargo/issues/9357) fail with
`.cargo/config.toml` setups like
```toml
[build]
# custom target json that lives in `./targets/my-super-cool-target.json`
target = "my-super-cool-target"

[env]
RUST_TARGET_PATH = { value = "./targets", relative = true }
```
resulting in
```

❯ cargo rustc --print cfg -Zunstable-options
error: Error loading target specification: Could not find specification for target "my-super-cool-target". Run `rustc --print target-list` for a list of built-in targets

error: process didn't exit successfully: `C:\Users\lukas\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\bin\rustc.exe --target my-super-cool-target --print cfg` (exit code: 1)
```

The reason for that is that cargo recognizes the target from the
`.cargo/config` and then implicitly passes that along to the spawned
rustc process, but it does so without passing along the important
environment that is required for the target tuple to make sense.

(can add a test if desired, just tell me where)
2025-01-07 18:39:52 +00:00
Lukas Wirth
b7a0c9dc56 Setup cargo environment for cargo rustc --print 2025-01-07 18:57:54 +01:00
Lukas Wirth
cedab5d9fd Add test for cargo rustc --print cfg that relies on an env target 2025-01-07 18:57:03 +01:00
Rustin
9438fe303a
Avoid naming variables str (#15025)
This renames variables named `str` to other names, to make sure `str`
always refers to a type.
2025-01-07 14:11:18 +00:00
Josh Triplett
1fe4591da3 Avoid naming variables str
This renames variables named `str` to other names, to make sure `str`
always refers to a type.
2025-01-07 13:50:15 +02:00
Ed Page
c1febbe121
Bump to 0.87.0; update changelog (#15022)
[rendered](https://github.com/weihanglo/cargo/blob/version-bump/CHANGELOG.md)
2025-01-07 01:27:29 +00:00
Weihang Lo
6ee4968d2a
docs: update changelog for 1.86.0 2025-01-06 19:54:35 -05:00
Weihang Lo
63f1325fcb
docs: update changelog for 1.85.0 2025-01-06 19:54:35 -05:00
Weihang Lo
637c41e987
chore: bump to 0.87.0 2025-01-06 14:35:04 -05:00
Weihang Lo
12541d6e5e
Update libgit2 to 1.9 (#15018)
This is a routine update of libgit2 to 1.9.

libgit2 1.9 release notes:
https://github.com/libgit2/libgit2/releases/tag/v1.9.0
git2:
https://github.com/rust-lang/git2-rs/blob/master/CHANGELOG.md#0200---2025-01-04
2025-01-05 02:59:36 +00:00
Eric Huss
f96b7298a7 Update git2 2025-01-04 16:55:32 -08:00
Weihang Lo
0f9e730043
Remove condition on RUSTUP_WINDOWS_PATH_ADD_BIN (#15017)
This is no longer needed since rustup 1.27.1 which changed the default
to false.

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

On windows, run `cargo test --test testsuite -- global_cache_tracker`
2025-01-04 20:18:39 +00:00
Weihang Lo
d10e9cdf65
Fix https::self_signed_should_fail for macos (#15016)
This no longer generates the same error message for the same reason that
it changed for linux in https://github.com/rust-lang/cargo/pull/13970.

Note that Windows does things slightly differently, and doesn't need
adjustment.
2025-01-04 19:50:59 +00:00
Eric Huss
e6ecef6cc8 Remove condition on RUSTUP_WINDOWS_PATH_ADD_BIN
This is no longer needed since rustup 1.27.1 which changed the default
to false.
2025-01-04 11:49:20 -08:00
Eric Huss
506f409a2e Fix https::self_signed_should_fail for macos
This no longer generates the same error message for the same reason that
it changed for linux in https://github.com/rust-lang/cargo/pull/13970.

Note that Windows does things slightly differently, and doesn't need
adjustment.
2025-01-04 11:19:35 -08:00
Ed Page
fd784878cf
chore: bump gix-lock to remove thiserror@1 from cargo (#15012)
### What does this PR try to resolve?

A follow-up of #14998

Other dev tools for cargo development are fine keeping v1. They are not
shipped to end users.

Before

```
$ cargo tree --workspace -i thiserror@1.0.63
thiserror v1.0.63
├── cargo_metadata v0.19.0
│   └── capture v0.1.0 (/projects/cargo/benches/capture)
├── gix-lock v15.0.0
│   ├── gix v0.69.1
│   │   └── cargo v0.86.0 (/projects/cargo)
│   │       ├── benchsuite v0.0.0 (/projects/cargo/benches/benchsuite)
│   │       ├── resolver-tests v0.0.0 (/projects/cargo/crates/resolver-tests)
│   │       ├── xtask-bump-check v0.0.0 (/projects/cargo/crates/xtask-bump-check)
│   │       └── xtask-lint-docs v0.1.0 (/projects/cargo/crates/xtask-lint-docs)
│   │   [dev-dependencies]
│   │   └── cargo v0.86.0 (/projects/cargo) (*)
│   ├── gix-index v0.37.0
│   │   ├── gix v0.69.1 (*)
│   │   ├── gix-dir v0.11.0
│   │   │   └── gix v0.69.1 (*)
│   │   └── gix-worktree v0.38.0
│   │       ├── gix v0.69.1 (*)
│   │       └── gix-dir v0.11.0 (*)
│   ├── gix-protocol v0.47.0
│   │   └── gix v0.69.1 (*)
│   ├── gix-ref v0.49.1
│   │   ├── gix v0.69.1 (*)
│   │   ├── gix-config v0.42.0
│   │   │   ├── gix v0.69.1 (*)
│   │   │   └── gix-submodule v0.16.0
│   │   │       └── gix v0.69.1 (*)
│   │   ├── gix-discover v0.37.0
│   │   │   ├── gix v0.69.1 (*)
│   │   │   └── gix-dir v0.11.0 (*)
│   │   └── gix-protocol v0.47.0 (*)
│   └── gix-shallow v0.1.0
│       ├── gix v0.69.1 (*)
│       └── gix-protocol v0.47.0 (*)
├── handlebars v6.2.0
│   └── mdman v0.0.0 (/projects/cargo/crates/mdman)
├── pest v2.7.9
│   ├── handlebars v6.2.0 (*)
│   ├── pest_derive v2.7.9 (proc-macro)
│   │   └── handlebars v6.2.0 (*)
│   ├── pest_generator v2.7.9
│   │   └── pest_derive v2.7.9 (proc-macro) (*)
│   └── pest_meta v2.7.9
│       └── pest_generator v2.7.9 (*)
├── varisat v0.2.2
│   └── resolver-tests v0.0.0 (/projects/cargo/crates/resolver-tests)
├── varisat-checker v0.2.2
│   └── varisat v0.2.2 (*)
└── varisat-dimacs v0.2.2
    ├── varisat v0.2.2 (*)
    └── varisat-checker v0.2.2 (*)
```

After

```
$ cargo tree --workspace -i thiserror@1.0.63
thiserror v1.0.63
├── cargo_metadata v0.19.0
│   └── capture v0.1.0 (/projects/cargo/benches/capture)
├── handlebars v6.2.0
│   └── mdman v0.0.0 (/projects/cargo/crates/mdman)
├── pest v2.7.9
│   ├── handlebars v6.2.0 (*)
│   ├── pest_derive v2.7.9 (proc-macro)
│   │   └── handlebars v6.2.0 (*)
│   ├── pest_generator v2.7.9
│   │   └── pest_derive v2.7.9 (proc-macro) (*)
│   └── pest_meta v2.7.9
│       └── pest_generator v2.7.9 (*)
├── varisat v0.2.2
│   └── resolver-tests v0.0.0 (/projects/cargo/crates/resolver-tests)
├── varisat-checker v0.2.2
│   └── varisat v0.2.2 (*)
└── varisat-dimacs v0.2.2
    ├── varisat v0.2.2 (*)
    └── varisat-checker v0.2.2 (*)
```

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

It has nothing changed but thiserror version.

https://diff.rs/gix-lock/15.0.0/gix-lock/15.0.1/Cargo.toml/
2025-01-03 20:06:26 +00:00
Weihang Lo
3e9b28a0d6
chore: bump gix-lock to remove thiserror@1 from cargo
Other dev tools for cargo development are fine keeping v1.
They are not shipped to end users.

Before

```
cargo tree --workspace -i thiserror@1.0.63

thiserror v1.0.63
├── cargo_metadata v0.19.0
│   └── capture v0.1.0 (/projects/cargo/benches/capture)
├── gix-lock v15.0.0
│   ├── gix v0.69.1
│   │   └── cargo v0.86.0 (/projects/cargo)
│   │       ├── benchsuite v0.0.0 (/projects/cargo/benches/benchsuite)
│   │       ├── resolver-tests v0.0.0 (/projects/cargo/crates/resolver-tests)
│   │       ├── xtask-bump-check v0.0.0 (/projects/cargo/crates/xtask-bump-check)
│   │       └── xtask-lint-docs v0.1.0 (/projects/cargo/crates/xtask-lint-docs)
│   │   [dev-dependencies]
│   │   └── cargo v0.86.0 (/projects/cargo) (*)
│   ├── gix-index v0.37.0
│   │   ├── gix v0.69.1 (*)
│   │   ├── gix-dir v0.11.0
│   │   │   └── gix v0.69.1 (*)
│   │   └── gix-worktree v0.38.0
│   │       ├── gix v0.69.1 (*)
│   │       └── gix-dir v0.11.0 (*)
│   ├── gix-protocol v0.47.0
│   │   └── gix v0.69.1 (*)
│   ├── gix-ref v0.49.1
│   │   ├── gix v0.69.1 (*)
│   │   ├── gix-config v0.42.0
│   │   │   ├── gix v0.69.1 (*)
│   │   │   └── gix-submodule v0.16.0
│   │   │       └── gix v0.69.1 (*)
│   │   ├── gix-discover v0.37.0
│   │   │   ├── gix v0.69.1 (*)
│   │   │   └── gix-dir v0.11.0 (*)
│   │   └── gix-protocol v0.47.0 (*)
│   └── gix-shallow v0.1.0
│       ├── gix v0.69.1 (*)
│       └── gix-protocol v0.47.0 (*)
├── handlebars v6.2.0
│   └── mdman v0.0.0 (/projects/cargo/crates/mdman)
├── pest v2.7.9
│   ├── handlebars v6.2.0 (*)
│   ├── pest_derive v2.7.9 (proc-macro)
│   │   └── handlebars v6.2.0 (*)
│   ├── pest_generator v2.7.9
│   │   └── pest_derive v2.7.9 (proc-macro) (*)
│   └── pest_meta v2.7.9
│       └── pest_generator v2.7.9 (*)
├── varisat v0.2.2
│   └── resolver-tests v0.0.0 (/projects/cargo/crates/resolver-tests)
├── varisat-checker v0.2.2
│   └── varisat v0.2.2 (*)
└── varisat-dimacs v0.2.2
    ├── varisat v0.2.2 (*)
    └── varisat-checker v0.2.2 (*)
```

After

```
cargo tree --workspace -i thiserror@1.0.63
thiserror v1.0.63
├── cargo_metadata v0.19.0
│   └── capture v0.1.0 (/projects/cargo/benches/capture)
├── handlebars v6.2.0
│   └── mdman v0.0.0 (/projects/cargo/crates/mdman)
├── pest v2.7.9
│   ├── handlebars v6.2.0 (*)
│   ├── pest_derive v2.7.9 (proc-macro)
│   │   └── handlebars v6.2.0 (*)
│   ├── pest_generator v2.7.9
│   │   └── pest_derive v2.7.9 (proc-macro) (*)
│   └── pest_meta v2.7.9
│       └── pest_generator v2.7.9 (*)
├── varisat v0.2.2
│   └── resolver-tests v0.0.0 (/projects/cargo/crates/resolver-tests)
├── varisat-checker v0.2.2
│   └── varisat v0.2.2 (*)
└── varisat-dimacs v0.2.2
    ├── varisat v0.2.2 (*)
    └── varisat-checker v0.2.2 (*)
```
2025-01-03 14:30:08 -05:00
Weihang Lo
2939e969f5
refactor(manifest): Clean up field -> env var handling (#15008)
### What does this PR try to resolve?

This is basically my PR feedback for #14973.

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

### Additional information
2025-01-02 22:20:42 +00:00
Ed Page
0414bb5ac1 refactor(manifest): Keep struct/impl close for easier viewing 2025-01-02 15:06:17 -06:00
Ed Page
711d6bef36 refactor(manifest): Make env macro as minimal as possible
Macros add a lot of code complexity.  This tries to reduce it by making
the macro do the bare minimum possible.

This does cause some extra branching (unless its compiled out) but that
shouldn't be prohibitive.
2025-01-02 15:03:11 -06:00
Ed Page
b16514de3b refactor(manifest): Fully qualify manifest env vars
This simplifies the macro and makes the content searchable
2025-01-02 14:52:57 -06:00
Ed Page
f30f452e3c
chore(deps): update rust crate thiserror to v2 (#14998)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [thiserror](https://redirect.github.com/dtolnay/thiserror) |
workspace.dependencies | major | `1.0.63` -> `2.0.0` |

---

### Release Notes

<details>
<summary>dtolnay/thiserror (thiserror)</summary>

###
[`v2.0.9`](https://redirect.github.com/dtolnay/thiserror/releases/tag/2.0.9)

[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/2.0.8...2.0.9)

- Work around `missing_inline_in_public_items` clippy restriction being
triggered in macro-generated code
([#&#8203;404](https://redirect.github.com/dtolnay/thiserror/issues/404))

###
[`v2.0.8`](https://redirect.github.com/dtolnay/thiserror/releases/tag/2.0.8)

[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/2.0.7...2.0.8)

- Improve support for macro-generated `derive(Error)` call sites
([#&#8203;399](https://redirect.github.com/dtolnay/thiserror/issues/399))

###
[`v2.0.7`](https://redirect.github.com/dtolnay/thiserror/releases/tag/2.0.7)

[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/2.0.6...2.0.7)

- Work around conflict with #\[deny(clippy::allow_attributes)]
([#&#8203;397](https://redirect.github.com/dtolnay/thiserror/issues/397),
thanks [@&#8203;zertosh](https://redirect.github.com/zertosh))

###
[`v2.0.6`](https://redirect.github.com/dtolnay/thiserror/releases/tag/2.0.6)

[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/2.0.5...2.0.6)

- Suppress deprecation warning on generated From impls
([#&#8203;396](https://redirect.github.com/dtolnay/thiserror/issues/396))

###
[`v2.0.5`](https://redirect.github.com/dtolnay/thiserror/releases/tag/2.0.5)

[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/2.0.4...2.0.5)

- Prevent deprecation warning on generated impl for deprecated type
([#&#8203;394](https://redirect.github.com/dtolnay/thiserror/issues/394))

###
[`v2.0.4`](https://redirect.github.com/dtolnay/thiserror/releases/tag/2.0.4)

[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/2.0.3...2.0.4)

- Eliminate needless_lifetimes clippy lint in generated `From` impls
([#&#8203;391](https://redirect.github.com/dtolnay/thiserror/issues/391),
thanks [@&#8203;matt-phylum](https://redirect.github.com/matt-phylum))

###
[`v2.0.3`](https://redirect.github.com/dtolnay/thiserror/releases/tag/2.0.3)

[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/2.0.2...2.0.3)

- Support the same Path field being repeated in both Debug and Display
representation in error message
([#&#8203;383](https://redirect.github.com/dtolnay/thiserror/issues/383))
- Improve error message when a format trait used in error message is not
implemented by some field
([#&#8203;384](https://redirect.github.com/dtolnay/thiserror/issues/384))

###
[`v2.0.2`](https://redirect.github.com/dtolnay/thiserror/releases/tag/2.0.2)

[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/2.0.1...2.0.2)

- Fix hang on invalid input inside #\[error(...)] attribute
([#&#8203;382](https://redirect.github.com/dtolnay/thiserror/issues/382))

###
[`v2.0.1`](https://redirect.github.com/dtolnay/thiserror/releases/tag/2.0.1)

[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/2.0.0...2.0.1)

- Support errors that contain a dynamically sized final field
([#&#8203;375](https://redirect.github.com/dtolnay/thiserror/issues/375))
- Improve inference of trait bounds for fields that are interpolated
multiple times in an error message
([#&#8203;377](https://redirect.github.com/dtolnay/thiserror/issues/377))

###
[`v2.0.0`](https://redirect.github.com/dtolnay/thiserror/releases/tag/2.0.0)

[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/1.0.69...2.0.0)

#### Breaking changes

- Referencing keyword-named fields by a raw identifier like `{r#type}`
inside a format string is no longer accepted; simply use the unraw name
like `{type}`
([#&#8203;347](https://redirect.github.com/dtolnay/thiserror/issues/347))

This aligns thiserror with the standard library's formatting macros,
which gained support for implicit argument capture later than the
release of this feature in thiserror 1.x.

    ```rust
    #[derive(Error, Debug)]
    #[error("... {type} ...")]  // Before: {r#type}
    pub struct Error {
        pub r#type: Type,
    }
    ```

- Trait bounds are no longer inferred on fields whose value is shadowed
by an explicit named argument in a format message
([#&#8203;345](https://redirect.github.com/dtolnay/thiserror/issues/345))

    ```rust
    // Before: impl<T: Octal> Display for Error<T>
    // After: impl<T> Display for Error<T>
    #[derive(Error, Debug)]
    #[error("{thing:o}", thing = "...")]
    pub struct Error<T> {
        thing: T,
    }
    ```

- Tuple structs and tuple variants can no longer use numerical `{0}`
`{1}` access at the same time as supplying extra positional arguments
for a format message, as this makes it ambiguous whether the number
refers to a tuple field vs a different positional arg
([#&#8203;354](https://redirect.github.com/dtolnay/thiserror/issues/354))

    ```rust
    #[derive(Error, Debug)]
    #[error("ambiguous: {0} {}", $N)]
// ^^^ Not allowed, use #[error("... {0} {n}", n = $N)]
    pub struct TupleError(i32);
    ```

- Code containing invocations of thiserror's `derive(Error)` must now
have a direct dependency on the `thiserror` crate regardless of the
error data structure's contents
([#&#8203;368](https://redirect.github.com/dtolnay/thiserror/issues/368),
[#&#8203;369](https://redirect.github.com/dtolnay/thiserror/issues/369),
[#&#8203;370](https://redirect.github.com/dtolnay/thiserror/issues/370),
[#&#8203;372](https://redirect.github.com/dtolnay/thiserror/issues/372))

#### Features

- Support disabling thiserror's standard library dependency by disabling
the default "std" Cargo feature: `thiserror = { version = "2",
default-features = false }`
([#&#8203;373](https://redirect.github.com/dtolnay/thiserror/issues/373))

- Support using `r#source` as field name to opt out of a field named
"source" being treated as an error's `Error::source()`
([#&#8203;350](https://redirect.github.com/dtolnay/thiserror/issues/350))

    ```rust
    #[derive(Error, Debug)]
    #[error("{source} ==> {destination}")]
    pub struct Error {
        r#source: char,
        destination: char,
    }

    let error = Error { source: 'S', destination: 'D' };
    ```

- Infinite recursion in a generated Display impl now produces an
`unconditional_recursion` warning
([#&#8203;359](https://redirect.github.com/dtolnay/thiserror/issues/359))

    ```rust
    #[derive(Error, Debug)]
    #[error("??? {self}")]
    pub struct Error;
    ```

- A new attribute `#[error(fmt = path::to::myfmt)]` can be used to write
formatting logic for an enum variant out-of-line
([#&#8203;367](https://redirect.github.com/dtolnay/thiserror/issues/367))

    ```rust
    #[derive(Error, Debug)]
    pub enum Error {
        #[error(fmt = demo_fmt)]
        Demo { code: u16, message: Option<String> },
    }

fn demo_fmt(code: &u16, message: &Option<String>, formatter: &mut
fmt::Formatter) -> fmt::Result {
        write!(formatter, "{code}")?;
        if let Some(msg) = message {
            write!(formatter, " - {msg}")?;
        }
        Ok(())
    }
    ```

- Enums with an enum-level format message are now able to have
individual variants that are `transparent` to supersede the enum-level
message
([#&#8203;366](https://redirect.github.com/dtolnay/thiserror/issues/366))

    ```rust
    #[derive(Error, Debug)]
    #[error("my error {0}")]
    pub enum Error {
        Json(#[from] serde_json::Error),
        Yaml(#[from] serde_yaml::Error),
        #[error(transparent)]
        Other(#[from] anyhow::Error),
    }
    ```

###
[`v1.0.69`](https://redirect.github.com/dtolnay/thiserror/releases/tag/1.0.69)

[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/1.0.68...1.0.69)

- Backport
[2.0.2](https://redirect.github.com/dtolnay/thiserror/releases/tag/2.0.2)
fixes

###
[`v1.0.68`](https://redirect.github.com/dtolnay/thiserror/releases/tag/1.0.68)

[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/1.0.67...1.0.68)

- Handle incomplete expressions more robustly in format arguments, such
as while code is being typed
([#&#8203;341](https://redirect.github.com/dtolnay/thiserror/issues/341),
[#&#8203;344](https://redirect.github.com/dtolnay/thiserror/issues/344))

###
[`v1.0.67`](https://redirect.github.com/dtolnay/thiserror/releases/tag/1.0.67)

[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/1.0.66...1.0.67)

- Improve expression syntax support inside format arguments
([#&#8203;335](https://redirect.github.com/dtolnay/thiserror/issues/335),
[#&#8203;337](https://redirect.github.com/dtolnay/thiserror/issues/337),
[#&#8203;339](https://redirect.github.com/dtolnay/thiserror/issues/339),
[#&#8203;340](https://redirect.github.com/dtolnay/thiserror/issues/340))

###
[`v1.0.66`](https://redirect.github.com/dtolnay/thiserror/releases/tag/1.0.66)

[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/1.0.65...1.0.66)

- Improve compile error on malformed format attribute
([#&#8203;327](https://redirect.github.com/dtolnay/thiserror/issues/327))

###
[`v1.0.65`](https://redirect.github.com/dtolnay/thiserror/releases/tag/1.0.65)

[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/1.0.64...1.0.65)

- Ensure OUT_DIR is left with deterministic contents after build script
execution
([#&#8203;325](https://redirect.github.com/dtolnay/thiserror/issues/325))

###
[`v1.0.64`](https://redirect.github.com/dtolnay/thiserror/releases/tag/1.0.64)

[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/1.0.63...1.0.64)

- Exclude derived impls from coverage instrumentation
([#&#8203;322](https://redirect.github.com/dtolnay/thiserror/issues/322),
thanks [@&#8203;oxalica](https://redirect.github.com/oxalica))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 5am on the first day of the
month" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/rust-lang/cargo).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS44NS4wIiwidXBkYXRlZEluVmVyIjoiMzkuODUuMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciIsImxhYmVscyI6W119-->
2025-01-02 19:58:01 +00:00
renovate[bot]
13af53a518 chore(deps): update rust crate thiserror to v2 2025-01-02 13:18:39 -06:00
Weihang Lo
fbca21b87b
test(git): Clean up shallow fetch tests (#15002)
### What does this PR try to resolve?

When looking to add shallow fetch for the git CLI, I found it hard to
tell what we test. This tries to clean up the tests and make it easier
to add new ones. My hope is to later generalize the test bodies so we
can more easily test any git backend in any combination of shallow or
deep fetches.

This is part of #13285.

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

### Additional information
2025-01-02 04:15:36 +00:00
Ed Page
0200aa0d63
fix(schema): Correct and update the JSON Schema (#15000)
### What does this PR try to resolve?

Fixes #14999

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

### Additional information
2025-01-01 17:59:14 +00:00
Weihang Lo
f73259dbff
chore(deps): update rust crate itertools to 0.14.0 (#14996)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [itertools](https://redirect.github.com/rust-itertools/itertools) |
workspace.dependencies | minor | `0.13.0` -> `0.14.0` |

---

### Release Notes

<details>
<summary>rust-itertools/itertools (itertools)</summary>

###
[`v0.14.0`](https://redirect.github.com/rust-itertools/itertools/blob/HEAD/CHANGELOG.md#0140)

[Compare
Source](https://redirect.github.com/rust-itertools/itertools/compare/v0.13.0...v0.14.0)

##### Breaking

- Increased MSRV to 1.63.0
([#&#8203;960](https://redirect.github.com/rust-itertools/itertools/issues/960))
- Removed generic parameter from `cons_tuples`
([#&#8203;988](https://redirect.github.com/rust-itertools/itertools/issues/988))

##### Added

- Added `array_combinations`
([#&#8203;991](https://redirect.github.com/rust-itertools/itertools/issues/991))
- Added `k_smallest_relaxed` and variants
([#&#8203;925](https://redirect.github.com/rust-itertools/itertools/issues/925))
- Added `next_array` and `collect_array`
([#&#8203;560](https://redirect.github.com/rust-itertools/itertools/issues/560))
- Implemented `DoubleEndedIterator` for `FilterOk`
([#&#8203;948](https://redirect.github.com/rust-itertools/itertools/issues/948))
- Implemented `DoubleEndedIterator` for `FilterMapOk`
([#&#8203;950](https://redirect.github.com/rust-itertools/itertools/issues/950))

##### Changed

- Allow `Q: ?Sized` in `Itertools::contains`
([#&#8203;971](https://redirect.github.com/rust-itertools/itertools/issues/971))
- Improved hygiene of `chain!`
([#&#8203;943](https://redirect.github.com/rust-itertools/itertools/issues/943))
- Improved `into_group_map_by` documentation
([#&#8203;1000](https://redirect.github.com/rust-itertools/itertools/issues/1000))
- Improved `tree_reduce` documentation
([#&#8203;955](https://redirect.github.com/rust-itertools/itertools/issues/955))
- Improved discoverability of `merge_join_by`
([#&#8203;966](https://redirect.github.com/rust-itertools/itertools/issues/966))
- Improved discoverability of `take_while_inclusive`
([#&#8203;972](https://redirect.github.com/rust-itertools/itertools/issues/972))
- Improved documentation of `find_or_last` and `find_or_first`
([#&#8203;984](https://redirect.github.com/rust-itertools/itertools/issues/984))
- Prevented exponentially large type sizes in `tuple_combinations`
([#&#8203;945](https://redirect.github.com/rust-itertools/itertools/issues/945))
- Added `track_caller` attr for `asser_equal`
([#&#8203;976](https://redirect.github.com/rust-itertools/itertools/issues/976))

##### Notable Internal Changes

- Fixed clippy lints
([#&#8203;956](https://redirect.github.com/rust-itertools/itertools/issues/956),
[#&#8203;987](https://redirect.github.com/rust-itertools/itertools/issues/987),
[#&#8203;1008](https://redirect.github.com/rust-itertools/itertools/issues/1008))
- Addressed warnings within doctests
([#&#8203;964](https://redirect.github.com/rust-itertools/itertools/issues/964))
- CI: Run most tests with miri
([#&#8203;961](https://redirect.github.com/rust-itertools/itertools/issues/961))
- CI: Speed up "cargo-semver-checks" action
([#&#8203;938](https://redirect.github.com/rust-itertools/itertools/issues/938))
- Changed an instance of `default_features` in `Cargo.toml` to
`default-features`
([#&#8203;985](https://redirect.github.com/rust-itertools/itertools/issues/985))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 5am on the first day of the
month" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/rust-lang/cargo).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS44NS4wIiwidXBkYXRlZEluVmVyIjoiMzkuODUuMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciIsImxhYmVscyI6W119-->
2025-01-01 16:34:23 +00:00
Ed Page
876f17d46b chore(ci): Ensure JSON schema gets updated 2025-01-01 10:16:18 -06:00
Ed Page
729776b589 fix(schema): Correct and update the JSON Schema
Fixes #14999
2025-01-01 10:14:31 -06:00
Weihang Lo
03a5f111b1
fix: env table config can't trigger rebuild with rerun-if-env-changed. (#14756)
### What does this PR try to resolve?

As #10358 said, `When a build.rs script emits
cargo:rerun-if-env-changed, it is not re-run when the value of the
specified variable is changed via the env configuration.`

Fixes #10358

### How should we test and review this PR?
Add test bofore fixing to reflect the issue, the next commit fixed it.

### Additional information

The PR is a sucessor of https://github.com/rust-lang/cargo/pull/14058,
so the previous dicussion can be refer to it.
2025-01-01 06:46:41 +00:00
Lin Yihai
76ffbe0571 fix: envs in config can trigger rebuild by custom build script with rerun-if-env-changed. 2025-01-01 14:10:00 +08:00
Weihang Lo
61d587fbf4
chore(deps): update alpine docker tag to v3.21 (#14995)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| alpine | final | minor | `3.20` -> `3.21` |

---

### Configuration

📅 **Schedule**: Branch creation - "before 5am on the first day of the
month" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/rust-lang/cargo).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS44NS4wIiwidXBkYXRlZEluVmVyIjoiMzkuODUuMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciIsImxhYmVscyI6W119-->
2025-01-01 02:56:30 +00:00
renovate[bot]
fb55f9b311
chore(deps): update rust crate itertools to 0.14.0 2025-01-01 02:26:09 +00:00
renovate[bot]
5f42cf2873
chore(deps): update alpine docker tag to v3.21 2025-01-01 02:26:01 +00:00
Ed Page
d85d76199f
fix(package): check dirtiness of symlinks source files (#14981)
### What does this PR try to resolve?

This adds a special case for checking source files are symlinks
and have been modified when under a VCS control

This is required because those paths may link to a file outside the
current package root, but still under the git workdir, affecting the
final packaged `.crate` file.

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

Pretty similar to #14966, as a part of #14967.

This may have potential performance issue. If a package contains
thousands of symlinks, Cargo will fire `git status` for each of them.
Not sure if we want to do anything proactively now.

The introduction of the `PathEntry` struct gives us more room for
storing file metadata to satisfiy use cases in the future. For
instances,

* Knowing a source file is a symlink and resolving it when packaging on
Windows
  * #5664
  * #14965
* Knowing more about a file's metadata (e.g. permission bits from Git)
  * #4413
  * #8006
* Provide richer information for `cargo package --list`, for example
JSON output mode
  * #11666
  * #13331
  * #13953
2024-12-31 22:44:40 +00:00
Weihang Lo
24dd205d5a
fix(package): deduplicate dirty symlink detection
metdata path fields may point to a dirty symlilnk and cause
duplicate report. This commit combines `dirty_metadata_paths`
and `dirty_symlinks` into one so is able to de-duplicate them.
2024-12-31 16:25:31 -05:00
Weihang Lo
de39f59e26
fix(package): check dirtiness of symlink source files
This adds a special case for checking source files are symlinks
and have been modified when under a VCS control

This is required because those paths may link to a file outside the
current package root, but still under the git workdir, affecting the
final packaged `.crate` file.

This may have potential performance issue. If a package contains
thousands of symlinks, Cargo will fire `git status` for each of them.
2024-12-31 16:25:31 -05:00
Weihang Lo
014e516e74
test(package): symlink dirty also under dirtiness check
This show that a regular file under a symlink directory
is also not tarcked by the current vcs dirtiness check.
2024-12-31 16:25:31 -05:00
Weihang Lo
aaac6887c6
refactor(source): preserve whether a path is under a symlink dir
This is helpful for VCS status check.
Paths emitted by PathSource are always under package root,
We lose the track of file type info of paths under symlink dirs,
so we need this extra bit of information.
2024-12-31 16:25:30 -05:00
Weihang Lo
081545ff2a
refactor(package): simplify metadata path field report path join
`abs_path` and `workdir.join(rel_path)` are the same at that point.
2024-12-31 16:21:44 -05:00
Weihang Lo
4c06c57d0d
refactor(cargo-util): one generic for each argument
So `path` and `base` are able to accept different types
2024-12-31 16:21:43 -05:00
Ed Page
d73d2caf9e
fix(package): warn if symlinks checked out as plain text files (#14994)
### What does this PR try to resolve?

`cargo package` will warn users when git `core.symlinks` is `false`
and some symlinks were checked out as plain files during packaging.

Git config [`core.symlinks`] defaults to true when unset.
In git-for-windows (and git as well),
the config should be set to false explicitly when the repo was created,
if symlink support wasn't detected [^1].

We assume the config was always set at creation time and never changed.
So, if it is true, we don't bother users with any warning.

[^1]:
f1241afcc7/setup.c (L2394-L2403)

[`core.symlinks`]:
https://git-scm.com/docs/git-config#Documentation/git-config.txt-coresymlinks

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

CI passes.

This shares two commits 42dc4eff43ce480350979e07c8605e0f12983b79 and
c8c8223c265ba8e7ea4cd29f829583ce786834f6 with #14981.

I didn't commit to fix all symlink issues all at once.
This PR demonstrates how we could leverage metadata in `PathEntry`.
Maybe later we can really follow plain-text symlinks and resolve the
issue.

### Additional information

cc #5664
0.86.0
2024-12-31 20:51:21 +00:00
Weihang Lo
059fe16085
fix(package): warn if symlinks checked out as plain text files
`cargo package` will warn users when git `core.symlinks` is `false`
and some symlinks were checked out as plain files during packaging.

Git config [`core.symlinks`] defaults to true when unset.
In git-for-windows (and git as well),
the config should be set to false explicitly when the repo was created,
if symlink support wasn't detected [^1].

We assume the config was always set at creation time and never changed.
So, if it is true, we don't bother users with any warning.

[^1]: <f1241afcc7/setup.c (L2394-L2403)>

[`core.symlinks`]: https://git-scm.com/docs/git-config#Documentation/git-config.txt-coresymlinks
2024-12-31 14:19:55 -05:00
Weihang Lo
871b17f59a
test(package): show behavior with core.symlinks=false 2024-12-31 11:52:44 -05:00
Weihang Lo
8adbe0eb06
refactor(package): preserve file type information in PathEntry
So that we can tell whether a path is a symlink and need to
traverse to the actual file to check dirtiness or copy real content.
2024-12-31 11:49:51 -05:00
Weihang Lo
1df629b2fa
refactor(source): wrap PathBuf with PathEntry
This gives us more room to store file metadata.
For example,

* knowing a source file is a symlink and resolving it when packaging,
* providing a rich JSON output for `cargo package --list`
* enriching the `.cargo-vcs-info.json` with copied/symlinked file info
2024-12-31 11:49:35 -05:00
Lin Yihai
a014fd0814 test: add test for rerun-if-env-changed custom build script. 2024-12-31 14:44:13 +08:00
Ed Page
0499e318a6
test: track caller for .crate file publish verification (#14992)
### What does this PR try to resolve?

This was found during some recent works around `cargo package`.
The purpose of it is showing the caller's line number when panicking.

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

Wait for CI. Nothing really change though.
2024-12-30 15:44:15 +00:00