Skip to content

Fetched Zig package omits files required by Roc's compiler libraries #12069

Description

@lukewilliamboswell

Downstream Zig packages should be able to depend on Roc's repository through build.zig.zon and use the exported compiler modules (compile, check, lir, eval, etc.) without maintaining a compiler checkout or copying its support sources.

At ce7b298cacaee79e7dbcaba3b6cde6d8f3d73bf9, Roc's manifest includes build.zig, build.zig.zon, src, LICENSE, and legal_details, but omits vendor. Zig therefore removes the vendored files when fetching the package, although src/build/modules.zig registers and imports modules rooted there, including vendor/parse_float/parse_float.zig, vendor/ryu.zig, and vendor/relocatable_loader/mod.zig.

Reproduction

Using Zig 0.16.0:

roc_cache="$(mktemp -d)"
roc_hash="$(zig fetch --global-cache-dir "$roc_cache" git+https://github.com/roc-lang/roc.git#ce7b298cacaee79e7dbcaba3b6cde6d8f3d73bf9)"
mkdir "$roc_cache/source"
tar -xf "$roc_cache/p/$roc_hash.tar.gz" -C "$roc_cache/source"
zig build --build-file "$roc_cache/source/$roc_hash/build.zig" \
  --global-cache-dir "$roc_cache" build-test-builtin-bake-reproducible

The builtin compiler, which prepares the checked builtin artifacts needed by compiler-library consumers, fails:

vendor/parse_float/parse_float.zig: file_hash FileNotFound

The files exist in a full repository checkout, so checkout-based embedding tests do not catch this package-boundary failure.

Expected behavior

A separately built downstream package can fetch Roc, import its public compiler modules with b.dependency("roc", ...).module(...), and drive checking and lowering through the documented embedding API. All required source files and generated builtin dependencies should be available through that package.

Include the required vendored sources in the package and add a regression that builds and runs a separate consumer against the actual fetched package, rather than a local path dependency or a full source checkout.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions