#The b.addInstallFile does not update the file!

1 messages · Page 1 of 1 (latest)

arctic cargo
#
    // objdump
    const objdump = b.addSystemCommand(&.{
        "riscv64-unknown-elf-objdump",
        "-SW",
        "zig-out/bin/esp32c6.elf",
    });
    objdump.step.dependOn(&elf.step);
    b.default_step.dependOn(&objdump.step);

    const copy_objdump = b.addInstallFile(objdump.captureStdOut(), "esp32c6.objdump");
    copy_objdump.step.dependOn(&objdump.step);
    b.default_step.dependOn(&copy_objdump.step);
#

It only generates esp32c6.objdump during the first build. If you modify main.zig and use zig build afterwards, the build system will not update esp32c6.objdump.

#

Is there anything wrong with my usage here?

tired dove
#

run zig build with --summary all, it will include a graph of step dependencies that could help you verify that they look correct

#

I think your problem is that you passed the path to the built artifact as a string literal instead of a real LazyPath.

#

if you do something like```ts
const objdump = b.addSystemCommand(&.{
"riscv64-unknown-elf-objdump",
"-SW",
});
objdump.addFileArg(esp32c6.getEmittedBin());

arctic cargo
#

He worked correctly!!

#

It's really unclear to me under what circumstances the zig build system can discover dependencies correctly!