Skip to content
This repository was archived by the owner on Nov 26, 2025. It is now read-only.
This repository was archived by the owner on Nov 26, 2025. It is now read-only.

translate-c unhappy when building outside source directory #47

@jburgy

Description

@jburgy

Zig Version

0.14.0

Steps to Reproduce and Observed Behavior

$ git clone https://gist.github.com/jburgy/081992ed24df120cd2edde6e56346371
$ cd 081992ed24df120cd2edde6e56346371/
$ zig build
$ PYTHONPATH=zig-out/lib /opt/python/3.13.0/bin/python3 -c "import libext"
$ echo $?
0

Everything works as expected in the happy path above. However, if you do

$ mkdir ../scratch
$ cd ../scratch
$ zig build --build-file ../081992ed24df120cd2edde6e56346371/build.zig

you'll get error: failed to check cache: '../081992ed24df120cd2edde6e56346371/.zig-cache/o/4e4e86279020dbd67ed90b5b94e6e6ba/py.zig' file_hash FileNotFound. Not only does py.zig not exist, its parent (4e4e86279020dbd67ed90b5b94e6e6ba/) does not exist either

Expected Behavior

zig translate-c should write its output to a file regardless of in what folder zig build is run

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions