Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incremental: handle @embedFile #22602

Merged
merged 4 commits into from
Jan 26, 2025
Merged

incremental: handle @embedFile #22602

merged 4 commits into from
Jan 26, 2025

Conversation

mlugg
Copy link
Member

@mlugg mlugg commented Jan 25, 2025

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
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
8 of 10 checks passed
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