-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setting global cache directory to relative path causes build failure of dependencies #20129
Comments
I think this is known and you need to do |
figured, but I'd rather just fix it outright (god knows I already sunk enough time into figuring out solution to this) Solutions that I see so
personally I think 1 is better solution here |
This will make path related issues like ziglang#20129 more obvious
I believe this is be fixed by changing line 2048 of Lines 2047 to 2055 in e54fcdb
.path = b.pathFromCwd(build_root_string), . #20132 might be redundant if this fix is used instead.
The source of the problem seems to be this: In the generated pub const packages = struct {
pub const @"1220b81f6ecfb3fd222f76cf9106fecfa6554ab07ec7fdc4124b9bb063ae2adf969d" = struct {
pub const build_root = "my-cache\\p\\1220b81f6ecfb3fd222f76cf9106fecfa6554ab07ec7fdc4124b9bb063ae2adf969d";
pub const deps: []const struct { []const u8, []const u8 } = &.{};
};
pub const @"1220cc5411d0624dd44d1eb476fe4285fb1a45fa17e5dcf1812dfe387b74404b2887" = struct {
pub const build_root = "C:\\tmp\\zig-bug-local-cache-dep\\pkg/freetype";
pub const build_zig = @import("1220cc5411d0624dd44d1eb476fe4285fb1a45fa17e5dcf1812dfe387b74404b2887");
pub const deps: []const struct { []const u8, []const u8 } = &.{
.{ "freetype", "1220b81f6ecfb3fd222f76cf9106fecfa6554ab07ec7fdc4124b9bb063ae2adf969d" },
};
};
};
pub const root_deps: []const struct { []const u8, []const u8 } = &.{
.{ "freetype", "1220cc5411d0624dd44d1eb476fe4285fb1a45fa17e5dcf1812dfe387b74404b2887" },
}; When instantiating a dependency, This will cause problems in build steps like |
That works too Going down the chain its
which just gets it from either a command line flag, env var or a default location |
Was fixed by a966eee (unintentionally?) |
Zig Version
0.13.0-dev.344+b2588de6c
Steps to Reproduce and Observed Behavior
Build a project with dependencies (what exactly is needed is unclear, but I managed to cut it down to a minimal example https://github.com/Jan200101/zig-bug-local-cache-dep) and a global cache directory being set to a local path (e.g.
zig build --global-cache-dir zig-cache
)This will result in the following error:
Expected Behavior
Everything works as expected
The text was updated successfully, but these errors were encountered: