19545 Commits

Author SHA1 Message Date
Ed Page
a00d0bade5 refactor(embedded): Name the steps when trimming 2025-02-14 10:09:35 -06:00
Ed Page
544013e786 refactor(embedded): Clarify the parser 2025-02-14 10:06:57 -06:00
Ed Page
e148c3d3e1 refactor(embedded): Extract shebang splitting
This is intended to make the code more closely match rustc
2025-02-14 10:04:57 -06:00
Ed Page
fbd2993c3d test(embedded): Add more frontmatter cases 2025-02-13 15:55:48 -06:00
Weihang Lo
c52d4da4e6
refactor: Consolidate creation of SourceId from manifest path (#15172)
### What does this PR try to resolve?

This preps more features for cargo-script support and makes it clearer
where we don't yet support it.

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

### Additional information
2025-02-12 00:41:17 +00:00
Weihang Lo
81d8406781
docs(embedded): Note the shebang deviation (#15173)
### What does this PR try to resolve?

rustc considers the following valid and without a shebang:
```rust

// Hello

[allow(dead_code)]

fn main() {
    println!("Hello, world!");
}
```
and
```rustc
[allow(dead_code)]

fn main() {
    println!("Hello, world!");
}
```

In both cases, we consider it to have a shebang. This commit documents
that intention.

We could add our own heuristics
(e.g. `#!` with only whitespace is not a shebang)
but we should either be a subset or intentionally different than rustc
(e.g. require a non `[`-prefixes interpreter)
rather than do both.

Fixes #15170

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

This will be reflected in the tracking issue which will handle the final
decision for the team on this matter.

### Additional information
2025-02-11 22:05:19 +00:00
Ed Page
48224c19c6 docs(embedded): Note the shebang deviation
rustc considers the following valid and without a shebang:
```rust

// Hello

[allow(dead_code)]

fn main() {
    println!("Hello, world!");
}
```
and
```rustc
[allow(dead_code)]

fn main() {
    println!("Hello, world!");
}
```

In both cases, we consider it to have a shebang.  This commit documents
that intention.

We could add our own heuristics
(e.g. `#!` with only whitespace is not a shebang)
but we should either be a subset or intentionally different than rustc
(e.g. require a non `[`-prefixes interpreter)
rather than do both.

This will be reflected in the tracking issue which will handle the final
decision for the team on this matter.

Fixes #15170
2025-02-11 15:30:47 -06:00
Ed Page
080f7474aa refactor: Consolidate to SourceId::from_manifest_path 2025-02-11 14:05:57 -06:00
Ed Page
5a351405dc refactor: Centralize SourceId creation for manifests 2025-02-11 14:00:10 -06:00
Eric Huss
b64750d83d
refactor(embedded): Integrate cargo-script logic into main parser (#15168)
### What does this PR try to resolve?

This is a part of #12207

Now that the experiment is over and we can be intrusive, this merges all
of the permanent cargo-script manifest logic into the regular manifest
loading code path with the goal of reducing the number of places people
need to be aware to check to know how things work so we're less likely
to overlook them (e.g. `package.name`s being optional). This should also
make error reporting better as we will eventually only use the real
manifest users specify, instead of one with a lot of edits by us.

This comes at the cost of some uglier code needed to check some of these
cases.

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

### Additional information
2025-02-11 14:54:56 +00:00
Weihang Lo
321f14e03e
feat: implement workspace feature unification (#15157)
### What does this PR try to resolve?

Adds workspace feature unification for #14774

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

In a workspace that has dependencies with different activated features
depending on the packages being built, add the
`resolver.feature-unification = "workspace"` option to
`.cargo/config.toml`. Build the entire workspace with `--workspace` and
then build individual packages, ensuring no dependencies are being
recompiled.

### Additional information

Originally, the RFC and tracking issue mention some more complex changes
required in cargo's dependency/feature resolution phases in order to
support workspace feature unification. However, it seems like it also
works by just modifying the list of `PackageIdSpec`s passed to the
workspace resolver to include all workspace members, and then using the
original list of specs when generating the build units. I'm wondering if
I missed something because this change feels a bit *too* simple...

I tested it on a fairly large workspace containing about 100 packages
and didn't see any recompilations when building with different sets of
packages. I also added an integration test that verifies the correct
features are enabled. If there are any other test cases I should
include, please let me know and I'll try to add it.
2025-02-11 13:30:10 +00:00
Andrew Liu
a471adbd2c feat: implement workspace feature unification 2025-02-11 15:10:39 +09:00
Andrew Liu
91e83d70ed test: verify feature unification behavior in workspaces 2025-02-11 12:15:12 +09:00
Ed Page
e3fa31e335
Fix race condition in panic_abort_tests (#15169)
This fixes a race condition in the `panic_abort_tests` test which can
randomly fail. Prior to https://github.com/rust-lang/cargo/pull/14226
the test would check the lines individually (which was also kinda broken
for the same reason, but wouldn't actually fail).
2025-02-10 21:47:09 +00:00
Eric Huss
be6598b7f0 Fix race condition in panic_abort_tests 2025-02-10 13:15:15 -08:00
Ed Page
39399182ab
Update all dependencies (#15166)
It's been a long while since dependencies were updated, so let's go
ahead and update those. Updates are:

    Updating allocator-api2 v0.2.18 -> v0.2.21
    Updating anstream v0.6.15 -> v0.6.18
    Updating anstyle v1.0.8 -> v1.0.10
    Updating anstyle-lossy v1.1.2 -> v1.1.3
    Updating anstyle-parse v0.2.5 -> v0.2.6
    Updating anstyle-query v1.1.1 -> v1.1.2
    Updating anstyle-svg v0.1.4 -> v0.1.7
    Updating anstyle-wincon v3.0.4 -> v3.0.7
    Updating anyhow v1.0.86 -> v1.0.95
    Updating arrayref v0.3.7 -> v0.3.9
    Updating arrayvec v0.7.4 -> v0.7.6
    Updating autocfg v1.3.0 -> v1.4.0
    Updating bit-set v0.5.3 -> v0.8.0
    Updating bit-vec v0.6.3 -> v0.8.0
    Removing bitflags v1.3.2
    Removing bitflags v2.6.0
      Adding bitflags v2.8.0
    Updating blake3 v1.5.2 -> v1.5.5
    Updating bstr v1.9.1 -> v1.11.3
    Updating bumpalo v3.16.0 -> v3.17.0
      Adding byteorder v1.5.0
    Updating bytes v1.6.0 -> v1.10.0
    Updating camino v1.1.6 -> v1.1.9
    Updating cargo-platform v0.1.8 -> v0.1.9
    Updating cargo_metadata v0.19.0 -> v0.19.1
    Updating cc v1.1.22 -> v1.2.13
    Updating clap v4.5.20 -> v4.5.28
    Updating clap_builder v4.5.20 -> v4.5.27
    Updating clap_lex v0.7.2 -> v0.7.4
    Updating clru v0.6.1 -> v0.6.2
    Updating color-print v0.3.6 -> v0.3.7
    Updating color-print-proc-macro v0.3.6 -> v0.3.7
    Updating colorchoice v1.0.2 -> v1.0.3
    Updating constant_time_eq v0.3.0 -> v0.3.1
    Updating cpufeatures v0.2.12 -> v0.2.17
    Updating crc32fast v1.4.0 -> v1.4.2
    Updating crossbeam-channel v0.5.12 -> v0.5.14
    Updating crossbeam-deque v0.8.5 -> v0.8.6
    Updating crossbeam-utils v0.8.19 -> v0.8.21
    Updating crunchy v0.2.2 -> v0.2.3
    Updating ct-codecs v1.1.1 -> v1.1.3
    Updating curl v0.4.46 -> v0.4.47
      Adding darling v0.20.10
      Adding darling_core v0.20.10
      Adding darling_macro v0.20.10
      Adding derive_builder v0.20.2
      Adding derive_builder_core v0.20.2
      Adding derive_builder_macro v0.20.2
      Adding displaydoc v0.2.5
    Updating dunce v1.0.4 -> v1.0.5
    Updating dyn-clone v1.0.17 -> v1.0.18
    Updating either v1.10.0 -> v1.13.0
    Updating encoding_rs v0.8.33 -> v0.8.35
    Updating errno v0.3.9 -> v0.3.10
    Updating fastrand v2.1.0 -> v2.3.0
    Updating fiat-crypto v0.2.7 -> v0.2.9
    Updating filetime v0.2.23 -> v0.2.25
    Updating flate2 v1.0.34 -> v1.0.35
    Updating glob v0.3.1 -> v0.3.2
    Updating globset v0.4.14 -> v0.4.15
    Updating half v2.4.0 -> v2.4.1
    Updating handlebars v6.2.0 -> v6.3.1
    Updating hermit-abi v0.3.9 -> v0.4.0
    Updating home v0.5.9 -> v0.5.11
    Updating http-auth v0.1.9 -> v0.1.10
      Adding icu_collections v1.5.0
      Adding icu_locid v1.5.0
      Adding icu_locid_transform v1.5.0
      Adding icu_locid_transform_data v1.5.0
      Adding icu_normalizer v1.5.0
      Adding icu_normalizer_data v1.5.0
      Adding icu_properties v1.5.1
      Adding icu_properties_data v1.5.0
      Adding icu_provider v1.5.0
      Adding icu_provider_macros v1.5.0
      Adding ident_case v1.0.1
    Updating idna v0.5.0 -> v1.0.3
      Adding idna_adapter v1.2.0
    Updating ignore v0.4.22 -> v0.4.23
    Updating indexmap v2.3.0 -> v2.7.1
    Updating is-terminal v0.4.12 -> v0.4.15
    Updating is_executable v1.0.3 -> v1.0.4
    Updating itoa v1.0.11 -> v1.0.14
    Updating jiff v0.1.13 -> v0.1.29
    Updating jiff-tzdb v0.1.1 -> v0.1.2
    Updating jiff-tzdb-platform v0.1.1 -> v0.1.2
    Updating js-sys v0.3.69 -> v0.3.77
    Updating kstring v2.0.0 -> v2.0.2
    Updating libc v0.2.158 -> v0.2.169
    Updating libloading v0.8.5 -> v0.8.6
    Removing libm v0.2.8
    Updating libnghttp2-sys v0.1.10+1.61.0 -> v0.1.11+1.64.0
      Adding libredox v0.1.3
    Updating libssh2-sys v0.3.0 -> v0.3.1
    Updating libz-sys v1.1.20 -> v1.1.21
    Updating linux-raw-sys v0.4.14 -> v0.4.15
      Adding litemap v0.7.4
    Updating lock_api v0.4.11 -> v0.4.12
    Updating log v0.4.22 -> v0.4.25
    Updating memmap2 v0.9.4 -> v0.9.5
    Updating miniz_oxide v0.8.0 -> v0.8.3
    Updating normpath v1.2.0 -> v1.3.0
    Updating once_cell v1.19.0 -> v1.20.3
    Updating oorandom v11.1.3 -> v11.1.4
    Updating opener v0.7.1 -> v0.7.2
    Updating openssl-probe v0.1.5 -> v0.1.6
    Updating openssl-src v111.28.2+1.1.1w -> v300.4.1+3.4.0
    Updating openssl-sys v0.9.92 -> v0.9.105
    Updating orion v0.17.6 -> v0.17.8
    Updating os_info v3.8.2 -> v3.10.0
    Updating p384 v0.13.0 -> v0.13.1
    Updating parking_lot v0.12.1 -> v0.12.3
    Updating parking_lot_core v0.9.9 -> v0.9.10
    Updating pasetors v0.7.0 -> v0.7.2
    Updating pathdiff v0.2.1 -> v0.2.3
    Updating pest v2.7.9 -> v2.7.15
    Updating pest_derive v2.7.9 -> v2.7.15
    Updating pest_generator v2.7.9 -> v2.7.15
    Updating pest_meta v2.7.9 -> v2.7.15
    Updating pin-project-lite v0.2.14 -> v0.2.16
    Updating pkg-config v0.3.30 -> v0.3.31
    Updating plotters v0.3.5 -> v0.3.7
    Updating plotters-backend v0.3.5 -> v0.3.7
    Updating plotters-svg v0.3.5 -> v0.3.7
      Adding portable-atomic v1.10.0
      Adding portable-atomic-util v0.2.4
    Updating ppv-lite86 v0.2.17 -> v0.2.20
    Updating proc-macro2 v1.0.92 -> v1.0.93
    Updating proptest v1.5.0 -> v1.6.0
    Updating pulldown-cmark v0.12.1 -> v0.12.2
    Updating quote v1.0.36 -> v1.0.38
    Updating redox_syscall v0.4.1 -> v0.5.8
    Updating regex v1.10.5 -> v1.11.1
    Updating regex-automata v0.4.7 -> v0.4.9
    Updating regex-syntax v0.8.4 -> v0.8.5
    Updating rustc-hash v2.0.0 -> v2.1.1
    Updating rustix v0.38.37 -> v0.38.44
      Adding rustversion v1.0.19
    Updating ryu v1.0.18 -> v1.0.19
    Updating schannel v0.1.23 -> v0.1.27
    Updating security-framework v3.0.0 -> v3.2.0
    Updating security-framework-sys v2.12.0 -> v2.14.0
    Updating semver v1.0.23 -> v1.0.25
    Updating serde v1.0.204 -> v1.0.217
    Updating serde_derive v1.0.204 -> v1.0.217
    Updating serde_json v1.0.135 -> v1.0.138
    Updating serde_spanned v0.6.7 -> v0.6.8
    Updating sha1_smol v1.0.0 -> v1.0.1
    Updating similar v2.6.0 -> v2.7.0
    Updating snapbox v0.6.20 -> v0.6.21
    Updating socket2 v0.5.6 -> v0.5.8
      Adding stable_deref_trait v1.2.0
    Updating subtle v2.5.0 -> v2.6.1
    Updating supports-hyperlinks v3.0.0 -> v3.1.0
    Updating syn v2.0.90 -> v2.0.98
      Adding synstructure v0.13.1
    Updating tar v0.4.42 -> v0.4.43
    Updating tempfile v3.10.1 -> v3.16.0
    Updating terminal_size v0.4.0 -> v0.4.1
    Removing thiserror v1.0.63
    Removing thiserror v2.0.3
      Adding thiserror v1.0.69
      Adding thiserror v2.0.11
    Removing thiserror-impl v1.0.63
    Removing thiserror-impl v2.0.3
      Adding thiserror-impl v1.0.69
      Adding thiserror-impl v2.0.11
    Updating time v0.3.36 -> v0.3.37
    Updating time-macros v0.2.18 -> v0.2.19
      Adding tinystr v0.7.6
    Updating tinyvec v1.8.0 -> v1.8.1
    Updating toml v0.8.19 -> v0.8.20
    Updating toml_edit v0.22.20 -> v0.22.23
    Updating tracing v0.1.40 -> v0.1.41
    Updating tracing-attributes v0.1.27 -> v0.1.28
    Updating tracing-core v0.1.32 -> v0.1.33
    Updating tracing-subscriber v0.3.18 -> v0.3.19
    Updating typeid v1.0.0 -> v1.0.2
    Updating ucd-trie v0.1.6 -> v0.1.7
    Updating unicase v2.7.0 -> v2.8.1
    Removing unicode-bidi v0.3.15
    Updating unicode-ident v1.0.13 -> v1.0.16
    Updating unicode-normalization v0.1.23 -> v0.1.24
    Removing unicode-width v0.1.13
    Updating unicode-xid v0.2.4 -> v0.2.6
    Updating url v2.5.2 -> v2.5.4
      Adding utf16_iter v1.0.5
      Adding utf8_iter v1.0.4
    Updating valuable v0.1.0 -> v0.1.1
    Updating version_check v0.9.4 -> v0.9.5
    Updating wait-timeout v0.2.0 -> v0.2.1
    Updating wasm-bindgen v0.2.92 -> v0.2.100
    Updating wasm-bindgen-backend v0.2.92 -> v0.2.100
    Updating wasm-bindgen-macro v0.2.92 -> v0.2.100
    Updating wasm-bindgen-macro-support v0.2.92 -> v0.2.100
    Updating wasm-bindgen-shared v0.2.92 -> v0.2.100
    Updating web-sys v0.3.69 -> v0.3.77
    Updating winapi-util v0.1.8 -> v0.1.9
    Removing winnow v0.6.18
      Adding winnow v0.6.26
      Adding winnow v0.7.1
      Adding write16 v1.0.0
      Adding writeable v0.5.5
      Adding yoke v0.7.5
      Adding yoke-derive v0.7.5
    Updating zerocopy v0.8.14 -> v0.8.17
    Updating zerocopy-derive v0.8.14 -> v0.8.17
      Adding zerofrom v0.1.5
      Adding zerofrom-derive v0.1.5
    Updating zeroize v1.7.0 -> v1.8.1
      Adding zerovec v0.10.4
      Adding zerovec-derive v0.10.3
2025-02-10 20:56:38 +00:00
Ed Page
0ee181e986 refactor(embedded): Clarify functions limited role 2025-02-10 14:32:49 -06:00
Ed Page
a81650c84c refactor(embedded): Move embedded validation to to_real_manifest
This is where a lot of the other logic like it is
2025-02-10 14:29:15 -06:00
Ed Page
dffd0fd4c7 refactor(embedded): Move workspace to normalization 2025-02-10 14:29:15 -06:00
Ed Page
3582b788cd refactor(embedded): Move package to normalization 2025-02-10 14:29:15 -06:00
Ed Page
8a40b36fdc refactor(embedded): Move package.name to normalization 2025-02-10 14:29:15 -06:00
Ed Page
d5b5074024 refactor(schema): Make TomlPackage defaultable 2025-02-10 14:29:15 -06:00
Ed Page
6ec8da96f4 fix(schema): Mark package.name as optional 2025-02-10 14:29:15 -06:00
Ed Page
911f174832 refactor(embedded): Move package.edition to normalization 2025-02-10 14:29:14 -06:00
Ed Page
f6b9c8f874 refactor(embedded): Move package.auto* to normalization 2025-02-10 14:28:27 -06:00
Ed Page
9527082298 refactor(embedded): Move package.build to normalization 2025-02-10 14:28:27 -06:00
Ed Page
f2a20cf3c1 refactor(toml): Track the normalized name, not original 2025-02-10 14:28:27 -06:00
Ed Page
7cd183386f refactor(toml): Track the normalized name, not original 2025-02-10 14:28:27 -06:00
Ed Page
4da874fae0 refactor(toml): Centralize package name lookup 2025-02-10 14:28:27 -06:00
Ed Page
8d6985679f refactor(toml): Centralize package name lookup 2025-02-10 14:28:27 -06:00
Ed Page
21f008e30c refactor(toml): Pull out field normalization for TomlPackage 2025-02-10 14:28:27 -06:00
Ed Page
b6619af363 refactor(toml): Ensure package normalization has access to the file name 2025-02-10 14:28:27 -06:00
Ed Page
c1db5cf99c refactor(toml): Centralize is_embedded query
Need access to this in more places.  I decided to centralize it (instead
of adding more calls) because of the fact that it touches the
filesystem.
2025-02-10 14:28:27 -06:00
Ed Page
b7db1833b8 test(embedded): Verify fields are unsupported 2025-02-10 14:28:27 -06:00
Ed Page
d398ce60b1 fix(embedded): Make errors consistent 2025-02-10 14:28:21 -06:00
Eric Huss
3948fa5e15 Update all dependencies 2025-02-09 15:50:36 -08:00
Weihang Lo
fcb79a5c45
Update curl from 8.9.0 to 8.12.0 (#15162)
Quite a lot of changes between these releases:

Release notes: https://curl.se/ch/8.12.0.html
Release notes: https://curl.se/ch/8.11.1.html
Release notes: https://curl.se/ch/8.11.0.html
Release notes: https://curl.se/ch/8.10.1.html
Release notes: https://curl.se/ch/8.10.0.html
Blog: https://daniel.haxx.se/blog/2025/02/05/curl-8-12-0/
Blog: https://daniel.haxx.se/blog/2024/12/11/curl-8-11-1/
Blog: https://daniel.haxx.se/blog/2024/11/06/curl-8-11-0/
Blog: https://daniel.haxx.se/blog/2024/09/18/curl-8-10-1/
Blog: https://daniel.haxx.se/blog/2024/09/11/curl-8-10-0/
2025-02-09 22:42:00 +00:00
Weihang Lo
d64e7a462d
Update annotate-snippets from 0.11.4 to 0.11.5 (#15165)
Changelog:
https://github.com/rust-lang/annotate-snippets-rs/blob/master/CHANGELOG.md#0115---2024-12-09

Looks to have some minor rendering differences.
2025-02-09 21:36:06 +00:00
Weihang Lo
71ad027733
Update deny.toml (#15164)
`cargo deny` is complaining about some deprecated settings in our
`deny.toml`. This updates it to the latest structure, and also
synchronizes the file with the latest template.
2025-02-09 20:50:43 +00:00
Weihang Lo
9c229bd40c
Update rusqlite from 0.32.1 to 0.33.0 (#15163)
Changes: https://github.com/rusqlite/rusqlite/releases/tag/v0.33.0
2025-02-09 20:47:31 +00:00
Eric Huss
b5394da406 Update annotate-snippets from 0.11.4 to 0.11.5
Changelog: https://github.com/rust-lang/annotate-snippets-rs/blob/master/CHANGELOG.md#0115---2024-12-09

Looks to have some minor rendering differences.
2025-02-09 12:46:36 -08:00
Eric Huss
013f31d6ae Update deny.toml comments to latest template
This updates the deny.toml comments to the latest template. This
includes the removal of some settings, etc.
2025-02-09 12:21:39 -08:00
Eric Huss
b370adcb2c Change cargo deny db settings to default
This changes the db-path to the default of `advisory-dbs` (with an s)
just to remain consistent with other projects possibly using this tool.
2025-02-09 12:21:01 -08:00
Eric Huss
61e6730cd5 Update cargo-deny structure
`cargo deny` is complaining that the current structure is deprecated.
2025-02-09 12:19:25 -08:00
Eric Huss
0d2ddc9942 Update rusqlite from 0.32.1 to 0.33.0
Changes: https://github.com/rusqlite/rusqlite/releases/tag/v0.33.0
2025-02-09 12:06:21 -08:00
Eric Huss
84eabfa746 Update curl from 8.9.0 to 8.12.0 2025-02-09 11:48:06 -08:00
Eric Huss
abf1338921
fix: align first line of unordered list with following (#15161)
### What does this PR try to resolve?

`\h` controls horizontal spacing.
This changes unordered lists from moving 2 units (`\h'+02'`) to 3 units
(`\h'+03'`).

This looks more nature.
Most other popular software programs follow the same style.
For example, git-merge, tar, and bash.

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

```
cargo build
target/debug/cargo help package
```

### Additional information

This was found during #15148.
2025-02-09 15:53:33 +00:00
Weihang Lo
f7c9066169
fix: align first line of unordered list with following
This looks more nature.
Most of other popular softwares follow the same style.
For example, git-merge, tar, and bash.
2025-02-09 10:15:42 -05:00
Ed Page
2928e32734
Simplify backtrack (#15150)
### What does this PR try to resolve?

Some very small simplifications made while poking around the resolver. I
was trying to understand when we would end up hitting a `continue` in
the code. The easiest way was to run the tests with a panic instead.
Turns out I was right, we cannot/(can no longer) hit that code path.
Which allowed us to simplify some other surrounding code.

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

All tests pass on each commit.

### Additional information
2025-02-07 16:50:22 +00:00
Weihang Lo
49e5d24870
Don't use on Solaris libc::LOCK_* which were removed from libc in ver… (#15143)
Relevant libc change was:
251e8e839a
2025-02-07 13:14:25 +00:00