1120 Commits

Author SHA1 Message Date
Ed Page
878caf7447 docs: Surround identifiers in backticks
This was mostly done by clippy via `clippy::doc_markdown`.
I then reviewed it to fix words that shouldn't have it or where `--fix`
put the backtick in the wrong location.
2024-11-15 09:33:23 -06:00
Ed Page
c02c9f2517 docs(build-rs): Remove reference to encoding 2024-11-13 14:46:11 -06:00
Ed Page
8b43030bb7 chore(build-rs): Remove comment about update
At this point, it is assumed to always be up-to-date
2024-11-13 13:55:14 -06:00
Ed Page
611ec991fb feat(build-rs): Add cargo_manifest_path 2024-11-13 13:54:48 -06:00
Ed Page
4ff0809afd fix(build-rs)!: Prefer None/empty-Vec to empty-String 2024-11-13 13:49:23 -06:00
Ed Page
27c577286e refactor(build-rs): Extract minor version extraction 2024-11-13 13:44:04 -06:00
Ed Page
347fa09b1b perf(build-rs): Remove an allocation 2024-11-13 13:42:46 -06:00
Ed Page
f4193559c2 refactor(build-rs): Make env vars more composable 2024-11-13 13:32:25 -06:00
Ed Page
5e53b21e19 refactor(build-rs): Clarify bool policy 2024-11-13 12:54:59 -06:00
Ed Page
58ac23d60a feat(build-rs): Add cargo_makeflags 2024-11-13 12:46:44 -06:00
Ed Page
e4e7a36eaa docs(build-rs): Correct documentation for manifest_links 2024-11-13 12:46:43 -06:00
Ed Page
eef4b30d31 docs(build-rs): Split out short descriptions 2024-11-13 12:46:25 -06:00
Weihang Lo
e5ce5e5588
Migrate build-rs to the Cargo repo (#14786)
### What does this PR try to resolve?

Fixes #12432

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

This pulls in https://github.com/cad97/build-rs at
eb389d1104dae2dc2eb4eafa9d6e821a7dcb45a7 with the following changes:
- `Cargo.toml` metadata
- Removal of `.github`, `.gitignore`, `Cargo.lock`

We'll need to integrate `test-lib` into our processes but that seemed
more invasive, so I wanted to leave that for a future PR.

### Additional information

Infra changes are being coordinated in
https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/Transfering.20.60build-rs.60.20crate.20to.20rust-lang/near/480779960

Context: per [Cargo's
charter](https://doc.crates.io/contrib/team.html#decision-process), we
approved this transfer in an
[FCP](https://github.com/rust-lang/cargo/issues/12432#issuecomment-2389528102).
2024-11-13 05:13:01 +00:00
Ed Page
49d8696823 style: Workaround clippy 2024-11-08 13:58:51 -06:00
Ed Page
13255d0fc1 fix(schemas): Support deserializing str's as well as Strings
Not needed for `toml` but could be useful for other formats.
2024-11-08 10:21:50 -06:00
Ed Page
9814045a03 docs: Declare build-rs as intentional 2024-11-08 08:58:45 -06:00
Ed Page
80c117a99b chore(ci): Don't check build-rs against past commits 2024-11-08 08:58:45 -06:00
Ed Page
82a912a2ee chore: Silence clippy for intregration 2024-11-08 08:58:45 -06:00
Ed Page
54660c665e chore: Integrate build-rs into the workspace 2024-11-08 08:58:45 -06:00
Ed Page
8b9eaa51f5 chore: Merge build-rs into Cargo 2024-11-08 08:55:29 -06:00
Ed Page
af3cfd5abe fix(test): Un-deprecate contains assertions 2024-11-07 15:55:35 -06:00
Ed Page
d20216c302 docs(test): Document Execs assertions based on port effort
A lot of this was pulled from #14039
2024-11-07 15:54:41 -06:00
Ed Page
84ac190045 refactor(test): Turn WildStr panic into compiler error 2024-11-07 15:22:51 -06:00
Ed Page
1b76a90343 refactor(test): Limit the scope of WildStr 2024-11-07 15:19:12 -06:00
Ed Page
2dd062fc9d refactor(test): Move normalize functions after use 2024-11-07 15:18:42 -06:00
Ed Page
0c7577d48a chore: Stage build-rs for merging 2024-11-07 08:39:59 -06:00
Ed Page
a03adcf6e2 fix(test): Make redactions consistent with snapbox
I'm unsure how we should be replacing these use cases, so I'm exploring
keeping them but making them use snapbox under the hood.
Part of the intent of snapbox is that it provides you the building
blocks to make what you need.
2024-11-06 20:03:53 -06:00
bors
be87c96b23 Auto merge of #14785 - epage:test-unordered, r=ehuss
test(gc): Update remaining unordered tests to snapbox

### What does this PR try to resolve?

This gets rid of the last unordered tests and removes the functions from `cargo-test-support` as part of #14039

Some tests are being less specific than they were before but in talking to ehuss, it sounded like that was ok.

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

### Additional information
2024-11-06 18:06:06 +00:00
Ed Page
bfa097e5d5 fix(test)!: Remove unused with_stdout_unordered,with_stderr_unordered 2024-11-05 10:39:30 -06:00
Alexander Saites
7d6889b5d9 replace special-case duplicate handling with error 2024-11-04 18:24:36 -07:00
bors
3dedb85a25 Auto merge of #14747 - saites:rustfix-transactional, r=weihanglo
Add transactional semantics to `rustfix`

### What does this PR try to resolve?

This PR adds transactional semantics to `rustfix::Data`, enabling `rustfix::CodeFix` to apply `Suggestion`s as atomic units and rollback partially-applied changes when they conflict with existing ones. The basic approach and goals are discussed [in a comment on issue 14699](https://github.com/rust-lang/cargo/issues/14699#issuecomment-2427501232). In that comment, I proposed a solution which extended the existing `State` enumeration, but described an alternative that simplifies the overall tracking of incoming changes; this PR implements the latter.

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

I've added an additional test and updated the existing ones. The tests in `parse_and_replace` already cover this case, particularly thanks to https://github.com/rust-lang/cargo/pull/14765 added by `@weihanglo.` It's still a good idea to experiment with `cargo clippy --fix` on repos that match the cases described in these open issues.

### Additional information

Fixes #14699
Fixes rust-lang/rust-clippy/issues/13549
2024-11-02 21:45:48 +00:00
Alexander Saites
f73b1d8c74 add transactional semantics to rustfix 2024-11-02 13:01:21 -07:00
TheSlapstickDictator
9b4f03a876 chore: update handlebars to v6, fix build error
DirectorySourceOptions is marked as #[non_exhaustive], and only
exposes the Default trait, so we need to instantiate a mutable
instance using default(), and then change tpl_extension to the
value we want.
2024-11-01 14:55:20 -07:00
bors
40d6078baf Auto merge of #14765 - weihanglo:rustfix, r=epage
test(rustfix): switch to a simpler case for dedup-suggestions
2024-11-01 15:37:00 +00:00
bors
2fcc3755a3 Auto merge of #14750 - epage:normalize, r=weihanglo
fix(util): Respect all `..`s in `normalize_path`

### What does this PR try to resolve?

The fact that `normalize_path` was only designed for absolute paths bit us when working out #14497 and so I decided to make sure it worked.  The other alternative I considered was having it assert that the path was absolute.

Since I did try out the assert and Cargo tests hit it, this likely fixes something but I haven't dug through to be able to say what.

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

### Additional information
2024-11-01 02:27:41 +00:00
Weihang Lo
8aec0a40f5
test(rustfix): switch to a simpler case for dedup-suggestions
This case also emits an insert-only suggestions (span start == end),
and doesn't rely on any lint behavior.

See also

* https://github.com/rust-lang/cargo/pull/13728
* https://github.com/rust-lang/cargo/issues/13027
2024-10-31 22:05:24 -04:00
Ed Page
8a8254eb1f refactor(test): Remove dead 'expect_stdout_contains_n' check
This was missed when removing the assert
2024-10-31 15:59:16 -05:00
Weihang Lo
634450e4b6
fix: track version in fingerprint dep-info files
Encodes the version information into Cargo's fingerprint dep-info files,
so that when the format encoding changes in the future,
Cargo understands a dep-info file was outdated and doesn't bother parsing it.

Since there was no version info encoded in the old format (call it v0),
to be compatible with older cargoes,
this PR works around it with a horrible hack.
It is explained in the doc comment of `EncodedDepInfo`.
2024-10-30 18:43:30 -04:00
Ed Page
7a6eaf9667 fix(util): Respect all ..s in normalize_path 2024-10-30 14:41:47 -05:00
Ed Page
c53bdc4745 refactor(util): Clarify intent of normalize_path 2024-10-30 14:40:51 -05:00
Ed Page
1f8b294b87 test(util): Show relative path behavior for normalize_path 2024-10-30 14:04:32 -05:00
bors
28274d0a51 Auto merge of #14724 - epage:resolver, r=weihanglo
test(install): Verify 2024 edition / resolver=3 doesn't affect resolution

### What does this PR try to resolve?

I was worried there might be bugs related to this.  With this out of the way, I think we'll be ready to stabilize `resolver = "3"`.

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

### Additional information
2024-10-25 13:41:40 +00:00
bors
cf9152007e Auto merge of #14683 - dacianpascu06:355adcad7, r=epage
Added unstable-schema generation for Cargo.toml

### What does this PR try to resolve?

Added unstable-schema feature that generates JsonSchema for Cargo.toml

See #12883
finished first step of [plan](https://github.com/rust-lang/cargo/issues/12883#issuecomment-2407648385)

### Information
In cargo-util-schemas,  run cargo test --feature unstable-schema  . If there have been any changes to manifest.schema.json, rerun with env variable SNAPSHOTS=overwrite  and it will update them.

### How should we test and review this PR?
In cargo-util-schemas run cargo test --features unstable-schema and it will generate manifest.schema.json
2024-10-24 21:26:44 +00:00
dacian
21ce69ef37 feat: unstable-json-schema generation for Cargo.toml 2024-10-25 00:05:11 +03:00
Ed Page
646e29abb5 feat(test): Allow setting edition on published packages 2024-10-23 15:14:08 -05:00
Ed Page
255f622299 feat(test): Allow setting resolver on published packages 2024-10-23 14:53:46 -05:00
bors
42f41439b2 Auto merge of #14707 - x-hgg-x:sat-fixes, r=Eh2406
test: add fixes in the sat resolver

### What does this PR try to resolve?

This is a follow-up of https://github.com/rust-lang/cargo/pull/14614.

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

Commit 1 removes duplicate variables in the sat resolver.
Commit 2 removes useless clones in the sat resolver.

r? Eh2406
2024-10-22 18:17:36 +00:00
Weihang Lo
c9102e54bb
refactor(rustfix): only compute snippets when needed 2024-10-20 20:42:22 -04:00
Weihang Lo
f483dc0b95
refactor(rustfix): simplify debug print for Span 2024-10-20 20:42:22 -04:00
Weihang Lo
6ac20fd1be
refactor(rustfix): remove unnecessary indentations 2024-10-20 20:42:22 -04:00