Commit Graph
90 Commits
Author SHA1 Message Date
bflatastic accec3112e Merge remote-tracking branch 'origin/main' into fix-1417
# Conflicts:
#	crates/xtask/Cargo.toml
#	crates/xtask/README.md
2026-11-30 01:11:56 +07:00
dotCooCoo ea8e588730 xtask: compare pinned repositories as Cargo does
`git_source` writes an IPv6 host in the compressed form Cargo writes,
so `https://[0:0:0:0:0:0:0:1]/r` pins as `https://[::1]/r`.

`check_commits` compares a source's repository with the rule's URL by
Cargo's repository identity: a trailing `/` and `.git` are removed, and
a `github.com` URL is compared over https with a lowercase path. A
dependency spelled `craft-libs.git` is now grouped with `craft-libs`,
and `craft-libs-extra` stays out of the group. A scheme containing `+`
keeps its `.git` suffix and path case.
2026-11-29 04:29:28 -08:00
dotCooCoo 5c307a8218 xtask layers: honor SameLayer::Allowed for testkit dependencies
- With `SameLayer::Allowed`, a testkit's dependency on a layered or
  standalone crate at `testkit_layer` now passes and enters the cycle
  check. `SameLayer::Ordered` still reports it as `Upward`.
- The `from_metadata` doc and the README now say that a `[patch]` that
  redirects a registry dependency to a workspace member is not detected,
  since `--no-deps` output does not resolve patches.
2026-11-29 04:02:35 -08:00
dotCooCoo 89398f2db1 xtask layers: check testkit cycles, keep Unix backslashes, reject repeated allowlists
- Same-layer edges to a testkit now enter the cycle check, so two testkits
  that use each other are reported. An edge that `format_allowed` rejects
  is reported once and no longer enters the cycle check.
- `normalize_path` turns `\` into `/` only in a Windows path (a drive
  letter, or two leading separators of either kind). On Unix a `\` stays
  part of the name, so `/x/a\b` and `/x/a/b` no longer compare equal.
- The policy check rejects a `format_allowed` crate listed more than once.
- The piped-stderr test now writes a marker instead of a 4 MiB flood and
  checks that it reaches the reader's stderr file, so the test fails
  instead of hanging when `read_json` stops replacing a piped stderr.
2026-11-29 01:07:58 -08:00
dotCooCoo 409d450a1c xtask layers: document where dev_exceptions apply
The README and the `Policy::dev_exceptions` doc now say that a listed dev
pair passes only from a layered or testkit crate to a layered or standalone
crate. A standalone crate's dependencies still follow `standalone_deps`, and a
dependency on an exempt package is still reported as `OnExempt`. The README's
cycle sentence now covers only the same-layer dependencies that pass.

A new test checks that a listed dev pair on an exempt package still reports
`OnExempt`.
2026-11-29 00:51:55 -08:00
dotCooCoo 13a06bccd9 Merge main into feat/craft-xtask-pins-one-commit 2026-11-28 14:25:42 -08:00
dotCooCoo 37900e797f Merge main into feat/craft-xtask-layers 2026-11-28 14:23:12 -08:00
dotCooCoo 307d64756c Merge main into feat/craft-xtask-pins-one-commit 2026-11-28 05:26:16 -08:00
dotCooCoo b64fdc42cf Merge main into feat/craft-xtask-fetch 2026-11-28 05:21:40 -08:00
dotCooCoo 312e00c711 Merge main into feat/craft-xtask-layers 2026-11-28 05:21:40 -08:00
bflatastic 6b41fb6814 craft-xtask: compare canonical paths in the working-directory test
On macOS the temp directory is under /var, a link to /private/var, so current_dir() reads back the /private/var path and the assert failed on main's macOS gate.
2026-11-28 18:55:41 +07:00
dotCooCoo bba210c37d xtask fetch: escape names in messages, limit parts to 255 bytes, fold sharp S
- FetchError's Display escapes control characters in names, since a refused pin or an archive
  entry can hold them.
- A name part longer than 255 bytes is refused.
- Names compare by the lowercase of the uppercase of their lowercase, so a capital sharp S, a
  small sharp S and "ss" are one name.
- A file entry that names the archive's root (`.` or `./`) is refused instead of dropped; only a
  folder entry may name it.
- The README says which names the path rules apply to.
- The system-tar test removes TAR_OPTIONS from tar's environment.
2026-11-28 02:19:47 -08:00
dotCooCoo 4d38322be1 Merge main into feat/craft-xtask-layers 2026-11-28 02:15:19 -08:00
dotCooCoo 133c892d10 Merge main into feat/craft-xtask-pins-one-commit 2026-11-28 02:13:47 -08:00
dotCooCoo 945396f612 Merge main into feat/craft-xtask-icon 2026-11-28 02:10:07 -08:00
dotCooCoo ff6c3f7388 Merge main into feat/craft-xtask-fetch
# Conflicts:
#	Cargo.lock
#	crates/xtask/Cargo.toml
#	crates/xtask/README.md
2026-11-28 02:10:06 -08:00
dotCooCoo 38cfb2bd12 Merge main into feat/craft-xtask-pins-one-commit 2026-11-28 01:48:05 -08:00
dotCooCoo a29d1ae3cc Merge main into feat/craft-xtask-layers 2026-11-28 01:47:41 -08:00
dotCooCoo 035586b081 Merge main into feat/craft-xtask-names 2026-11-28 01:39:11 -08:00
dotCooCoo 4da945035b xtask: cover shared process output drain deadline 2026-11-26 15:43:28 -08:00
dotCooCoo 4ec8a1cc62 Merge feat/craft-xtask-pins into feat/craft-xtask-pins-one-commit 2026-11-26 15:32:28 -08:00
dotCooCoo 121b185ec2 Merge main into feat/craft-xtask-names 2026-11-26 14:54:37 -08:00
dotCooCoo 09a8d64ffb docs(xtask): clarify exact feature requirements 2026-11-26 14:48:33 -08:00
dotCooCoo 552f325de1 xtask version: retain trailing spaces in path requirements 2026-11-26 07:10:02 -08:00
dotCooCoo 73e2c45a2e xtask version: replace version strings in place, restore the lock before the online retry
The manifest is edited at the source ranges of the version strings, so key order, comments and line endings outside them are unchanged. A path pin written as a multi-line string moves with the workspace version and keeps its delimiters. The online `cargo update` attempt starts from the Cargo.lock that existed before the offline attempt.
2026-11-26 00:22:57 -08:00
dotCooCoo 0ffdc84369 craft-xtask: send dot segments as written, cap the curl limit, check the destination and archive name first, hash cached files within the limit, and refuse a trailing slash on a file entry 2026-11-26 00:06:38 -08:00
dotCooCoo f48d7da107 craft-xtask: document that the link checks run before the writes
The link checks on dest and the folders under it run before each write rather than as part of it, so the README and the extract and fetch_pinned_with docs now say that every folder on the way to a written file must be writable only by the user running the fetch or the system.
2026-11-25 22:32:21 -08:00
dotCooCoo 218d6d5d97 craft-xtask: report curl size refusals as TooLarge and compose names before folding case
- curl runs with --globoff, so brackets and braces in a pin's address are sent as they are.
- curl's exit status 63 (--max-filesize refused the body) becomes an error of kind FileTooLarge,
  which the fetch reports as TooLarge, the same result as a body stopped while counting.
- curl's failure message no longer includes the address.
- fold puts a name in NFC before the case mapping as well as after it, so alpha followed by
  U+0345 and U+0301 in either order gets one key.
- entry_parts checks the parts and measures the kept length before collecting anything.
- The tests use tempfile for their scratch folders, and the system tar test skips only when tar
  is not installed.
2026-11-25 22:21:17 -08:00
dotCooCoo b7fa315333 craft-xtask: drop the redundant png_info link target in ico::read docs
rustdoc -D warnings rejects the explicit super::png_info target because
png_info is imported into the module.
2026-11-25 22:09:23 -08:00
dotCooCoo 3eee4ac167 Merge main into feat/craft-xtask-pins-one-commit 2026-11-25 20:33:26 -08:00
dotCooCoo a82336c70b craft-xtask: refuse fetch names that differ only in Unicode normalization
A composed `é` and an `e` followed by a combining accent are one name on
macOS, so two pins or two archive entries spelled that way wrote the
same file. Names are now compared in Normalization Form C after the case
fold. The integration tests move to `tests/it/main.rs`.
2026-11-25 20:11:39 -08:00
dotCooCoo d5481f603f Merge main into feat/craft-xtask-fetch 2026-11-25 19:58:43 -08:00
dotCooCoo 3f81db1828 Merge main into feat/craft-xtask-pins 2026-11-25 19:56:57 -08:00
dotCooCoo 0d0cb7a0f0 Merge main into feat/craft-xtask-icon 2026-11-25 19:53:11 -08:00
dotCooCoo 3d826a97dd Merge main into feat/craft-xtask-names 2026-11-25 19:38:56 -08:00
dotCooCoo 9ed7f5f869 craft-xtask: read and write the version with toml_edit
The hand-written TOML scanner is removed. `read` and `replace` parse the
root manifest with toml_edit 0.25 and set the version strings in place,
keeping their quotes and the comments and spaces around them. The
manifest's line endings (LF or CRLF, per line) and a missing final line
ending are kept. A manifest that is not valid TOML, a duplicate key
included, is an error before anything is written.
2026-11-25 19:38:02 -08:00
dotCooCoo a653a36116 Merge main into feat/craft-xtask-layers
Keep serde_json optional and put the layer check behind a new layers feature.
2026-11-25 19:26:58 -08:00
dotCooCoo b87bd78d03 Merge main into feat/craft-xtask-version 2026-11-25 19:22:45 -08:00
dotCooCoo 994d03d02f craft-xtask: drop only the out-of-scope pending declarations
Pending declarations are kept innermost last, so a closing delimiter or
an item's end now pops the ones above the current depth from the end
instead of scanning the whole list. A source with 200,000 pending `fn`s
and 200,000 `[]` groups took 216 s in a debug test before and reads at
once now.
2026-11-24 23:17:10 -08:00
dotCooCoo 08c0d99732 craft-xtask: describe parameter, cast and drive-relative input rules
The README and the `literals` docs now say that a comma in the type of
a parameter after its pattern, or of a cast, does not end test-only
code, and that a drive-relative input is resolved once before it is
listed.
2026-11-24 19:35:40 -08:00
dotCooCoo f84b8eec3d craft-xtask: resolve each input once before it is listed
Each input is now joined to the base, or a Windows drive-relative
input (`C:src`) to the current folder of its drive, before its folder
is listed. The listing and the reads use that path, and findings keep
the input's spelling, so a change of the drive's current folder during
the walk does not change which files are read.
2026-11-24 19:34:27 -08:00
dotCooCoo 6f34164a37 craft-xtask: read enum discriminants as expressions
A `=` among an enum's variants starts a discriminant that runs to the
next `,`, and its `( .. )` and `{ .. }` are an expression's, so a call
such as `V = f(..)` is no longer read as a tuple variant's fields. A
`(` after a path, a method or an operator is not a variant's either,
which covers a discriminant whose generic arguments hold a comma
(`V = m::f::<u8, u16>::call(..)`). Variants named by a macro's
`$name` or after repeated macro attributes keep their fields.
2026-11-24 19:32:34 -08:00
dotCooCoo 3641b5c8bc craft-xtask: keep a declaration pending across a macro in its header
A `{` or `(` right after a macro's `!` in a struct, union or enum
header (`struct S where ty!{}: Copy { .. }`) is the macro's group, not
the declaration's fields. The declaration stays pending until its own
body brace, so the body still opens as typed fields.
2026-11-24 19:24:46 -08:00
dotCooCoo a83685686a craft-xtask: keep generic commas in test-only cast types
An `as` in test-only code now starts a cast type that runs until a
token a type does not hold. A `<` after a word in that type opens
generic brackets, so a comma in `ptr as *const Pair<A, B>`, in a
qualified or generic path (`<T as Trait>::Assoc<A, B>`,
`Pair<u8>::Assoc<A, B>`) or in a function pointer's return type
(`f as fn() -> Pair<A, B>`) no longer ends the test-only code. A
comparison after the cast's parentheses (`(a as u8) < b`) or after an
operator (`a as u8 + a < b`) is still read as a comparison.
2026-11-24 19:23:22 -08:00
dotCooCoo 3e48c109c5 craft-xtask: keep a declaration pending across nested declarations in its header
The pending declarations are now a stack, innermost last. A `fn`
pointer type or a local item inside a declaration's header
(`struct S<T = (fn(),)>`, `Box<[fn(u8, u16); 2]>`, a const generic
default block that declares a struct) is consumed by its own delimiter
and leaves the outer declaration pending, so the outer body still
opens as typed fields.
2026-11-24 19:13:46 -08:00
dotCooCoo a2854ae0fb craft-xtask: read the type after a test-only parameter pattern
A `:` at the level of a test-only parameter now starts its type after
any pattern (`mut p`, `ref mut p`, `(a, b)`, `&(a, b)`, `P { x, .. }`,
`m::P(x)`), not only after a bare name, so a generic comma in that
type no longer ends the test-only code.
2026-11-24 19:09:47 -08:00
dotCooCoo 26bd1410ae craft-xtask: pins writes a git URL's port as its number
Cargo writes the port of an http or https git URL as a number, so
https://host:0443/r has the default port and its source is
https://host/r. git_source and check_commits kept :0443, so a valid pin
failed and check_commits could miss that repository's packages. A port
of digits is now written as its number before the default port is
left out.
2026-11-24 18:54:16 -08:00
dotCooCoo f5c2f1870b craft-xtask: pins runs the held-stderr test on Unix only
On Windows a child inherits every inheritable handle of the process
that starts it, so the lingering child in
a_failing_command_returns_while_another_process_holds_its_stderr also
holds the command's standard output. The call then ends with a read
timeout instead of the exit error the test expects, which failed the
Windows gate. The test now runs only on Unix.
2026-11-24 18:51:03 -08:00
dotCooCoo 2e30cc9522 craft-xtask: keep generic commas, borrowed closures and raw identifiers in test-only code
- A Windows drive-relative input (`C:a.rs`) is keyed by the file it
  opens under the current folder of its drive, so it deduplicates with
  the absolute path and takes part in the mixed-kind conflict check.
- A `<` opens generic brackets where an operand starts
  (`<Pair<A, B> as Fixture>::LABEL`, also after `return` and the like),
  in the type of a declared field or parameter (`field: Pair<A, B>`),
  and in a tuple field, so their commas do not end the test-only
  region. Fields and parameters count as declared only in the braces or
  parentheses of a struct, union, enum variant or function, so a
  comparison in a struct expression (`probe: a < b`) stays one.
- A closure after a borrow (`&|_, _|`, `&mut move |..|`) keeps its
  parameter commas.
- A raw identifier (`r#let`) is read as one word and is never taken for
  a keyword.
2026-11-24 11:37:33 -08:00
dotCooCoo b50cdb5e0e craft-xtask: pins tests the stderr wait after a failing exit
- drain_left gives the part of DRAIN after the exit that is left when
  standard output closes, and output passes it to Head::finish.
- The test the_stderr_wait_ends_drain_after_the_exit checks the wait
  when standard output closes at the exit, half of DRAIN after it, and
  at or past DRAIN after it.
2026-11-24 09:13:14 -08:00