Skip to content

can't getEmittedAsm() on a C/C++ program #22612

@EzequielRamis

Description

@EzequielRamis

Zig Version

0.14.0-dev.2851+b074fb7dd

Steps to Reproduce and Observed Behavior

Using this project as a minimal reproduction:

build.zig

   const test_step = b.step("test", "Run the tests");
   test_step.dependOn(&run_tests.step);

+  const emit_asm = b.addInstallFile(test_bin.getEmittedAsm(), "picohttpparser.s");
+  const asm_step = b.step("asm", "Emit assembly");
+  asm_step.dependOn(&emit_asm.step);
}

Produces this error mesasge:

> zig build asm
asm
└─ install generated to picohttpparser.s failure
error: unable to update file from '/home/ezequiel/Desktop/picohttpparser/.zig-cache/o/1ad04b11ce9a3fe4093ca75063b7a051/test-bin.s' to '/home/ezequiel/Desktop/picohttpparser/zig-out/picohttpparser.s': FileNotFound
Build Summary: 4/6 steps succeeded; 1 failed
asm transitive failure
└─ install generated to picohttpparser.s failure

Expected Behavior

An assembly file must be generated, as in any Zig program. I'm not sure if this occurred in an older version or there's something I'm missing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorzig build systemstd.Build, the build runner, `zig build` subcommand, package management

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions