#713

0.11.0 npm package: missing @embedFile input prevents downstream Zig build graph evaluation

Openzogienopened 15d ago

Adding the published @native-sdk/cli@0.11.0 package as a dependency breaks a downstream Zig project's build graph evaluation. Even zig build --help fails, before any application compilation or test execution.

Reproduction

Create an empty Zig project and extract the published npm package:

mkdir native-npm-repro
cd native-npm-repro
zig init --minimal
zig build --help
npm pack @native-sdk/cli@0.11.0
tar -xzf native-sdk-cli-0.11.0.tgz

The initial zig build --help succeeds.

Add this field to the generated build.zig.zon, keeping its existing fields:

.dependencies = .{
    .native_sdk = .{ .path = "package" },
},

Replace build.zig with:

const std = @import("std");

pub fn build(b: *std.Build) void {
    _ = b.dependency("native_sdk", .{});
}

Run again:

zig build --help

Actual result

The command exits with code 2:

package\build.zig:4814:82: error: unable to open 'tests/ts-core/gpu-dashboard-reference/main.zig': FileNotFound
    _ = gpu_dashboard_stage.add("gpu_dashboard_reference_access.zig", @embedFile("tests/ts-core/gpu-dashboard-reference/main.zig") ++
                                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
referenced by:
    build: package\build.zig:452:48

No application source or SDK test execution is needed to trigger the failure.

Expected result

A downstream project should be able to evaluate its build graph using the published SDK package without requiring files absent from that package.

Findings

Environment

  • Windows x64
  • Zig 0.16.0
  • Node.js 24.16.0
  • npm 11.13.0
  • @native-sdk/cli 0.11.0

Activity

3
zhuyuanmin7d ago

I have got same error

luckbyte7d ago

+1

zogien7d ago

Looks like this is still unresolved. Might need to fork it and fix it there for now.