Add optional OCI output artifacts - #2790
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bee2e09576
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
a9e3ac3 to
65362c6
Compare
daf969e to
71ddce7
Compare
Support optional Acton output artifacts fetched from OCI repositories during dependency resolution. Artifacts are keyed by source content hash, interface version, and target tuple. Use valid local cache entries before registry lookups and fall back to source when no matching artifact is available. Add artifact pack, push, and hash commands, local OCI layout support, tests, and guide documentation.
An artifact ships the compiled type interfaces (.tydb) only, without source or generated C. Producing one (acton artifact pack/push) now runs just the front passes: a new skip_backpass compile option creates no back jobs at all, eager or deferred, and keeps codegen staleness from forcing any work. The option is also exposed as acton build --skip-backpass for interface-only builds. Code generation is deferred to the consuming build, which regenerates C from the shipped .tydb. With no source available the generated code carries no #line directives, because the source is needed to map byte offsets to newlines. A later full build in the producer checkout likewise finds the generated code missing via the impl hash tags in .c/.h and runs the back passes then.
Producing an artifact (acton artifact hash/push) seeds the shared Zig cache with the producer's own source, so on that host -- and in CI where produce and consume share a runner -- dependency resolution always found cached source and re-type-checked the dependency from scratch, never consuming the artifact it had just published. Passing --artifact-repo now expresses artifact consumption: a valid output artifact is preferred over already-cached source, both when the deps cache holds a source checkout (which is replaced in place) and when only the Zig cache is seeded. On a miss resolution falls back to the cached source as before. Without the flag cached source still wins, so ordinary builds never retry artifact pulls for deps they have. Also gate the fresh-fetch path on cacheEntryExists so dir and archive cache forms behave the same; hashing a local path seeds the archive form.
71ddce7 to
15cbaee
Compare
| Passing `--artifact-repo` opts the build into artifact consumption: a valid | ||
| artifact is preferred even when a cached source entry already exists, and the | ||
| cached source is used only when no artifact can be found. This matters on a | ||
| machine that has published the artifact itself, since producing seeds the | ||
| caches with the package source, which would otherwise always win over the | ||
| artifact. Without `--artifact-repo`, a cached source entry is used as is, | ||
| without probing remote artifact repositories. |
There was a problem hiding this comment.
It seems to me that the only use of this option is to test the artifacts. The design is that the cached artifact output is 100% deterministic, so there is no such case as "invalid cache / artifact", so why would anyone need this?
If you want to clear the cache for testing, I think it is better you run rm -rf ~/.cache/acton/...
| Artifact.writeManifest tmp (Artifact.expectedManifest sourceHash) | ||
| runProcessChecked Nothing "tar" | ||
| [ "-czf", output0 | ||
| , "--exclude=*.c", "--exclude=*.h" |
There was a problem hiding this comment.
I don't want options for this. I am fine to remove the .c and .h file entirely from the artifact since it is only the TYDB that can truly be cached. I should probably have made it only TYDB from the beginning...
| optimize :: OptimizeMode, | ||
| only_build :: Bool, | ||
| skip_build :: Bool, | ||
| skip_backpass :: Bool, |
There was a problem hiding this comment.
This should not be an option. New selective back loader will see 0 roots for typical device model project, so no output .c files will be produced at all.
|
@plajjan I rebased this branch many times over. It predated DBP, and at one point was also based on |
Support optional Acton output artifacts fetched from OCI repositories during dependency resolution. Artifacts are keyed by source content hash, interface version, and target tuple.
Use valid local cache entries before registry lookups and fall back to source when no matching artifact is available.
Add artifact pack, push, and hash commands, local OCI layout support, tests, and guide documentation.