Skip to content

incremental: handle @embedFile - #22602

Merged
mlugg merged 4 commits into
ziglang:masterfrom
mlugg:incr-embedfile
Jan 26, 2025
Merged

mlugg merged 4 commits into
ziglang:masterfrom
mlugg:incr-embedfile

Conversation

@mlugg

@mlugg mlugg commented Jan 25, 2025 •

Copy link
Copy Markdown
Member

Uses of @embedFile register dependencies on the corresponding Zcu.EmbedFile. At the start of every update, we iterate all embedded files and update them if necessary, and invalidate the dependencies if they changed.

In order to properly integrate with the lazy analysis model, failed embed files are now reported by the AnalUnit which actually used @embedFile; the filesystem error is stored in the Zcu.EmbedFile.

An incremental test is added covering incremental updates to embedded files, and I have verified locally that dependency invalidation is working correctly.

EDIT: why not, this branch now also contains a nice lil incr-check enhancement: we now actually check that the compile errors match what's expected!

This allows joining paths without allocating using a `Writer`.
@mlugg mlugg mentioned this pull request Jan 25, 2025
8 of 13 tasks
Uses of `@embedFile` register dependencies on the corresponding
`Zcu.EmbedFile`. At the start of every update, we iterate all embedded
files and update them if necessary, and invalidate the dependencies if
they changed.

In order to properly integrate with the lazy analysis model, failed
embed files are now reported by the `AnalUnit` which actually used
`@embedFile`; the filesystem error is stored in the `Zcu.EmbedFile`.

An incremental test is added covering incremental updates to embedded
files, and I have verified locally that dependency invalidation is
working correctly.
The real problem here is that Git for Windows has horrendous defaults
which convert LF to CRLF. However, rather than changing this
configuration on the CI runners, it's worth supporting inexplicable CRLF
in these files so that anyone else cloning Zig on Windows doesn't get
unexpected test failures.
Also modifies all incremental cases using `#expect_error` to include the
errors and notes which are expected.
@mlugg
mlugg merged commit 3767b08 into ziglang:master Jan 26, 2025
@mlugg
mlugg deleted the incr-embedfile branch May 18, 2025 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant