Skip to content
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

Compile Error for Local Dependencies on Windows #80

Open
brodeuralexis opened this issue Sep 2, 2022 · 1 comment
Open

Compile Error for Local Dependencies on Windows #80

brodeuralexis opened this issue Sep 2, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@brodeuralexis
Copy link

deps.zig fails to compile with a message like so:

$ zig build run-simple
C:\Users\Alexis Brodeur\Projects\github.com\brodeuralexis\webgpu\deps.zig:67:129: error: invalid escape character: 's'
        .pkg = Pkg{ .name = "webgpu-backend-dummy", .source = .{ .path = dirs._5lfigtl33bkz ++ "/./modules/webgpu-backend-dummy\src/backend.zig" }, .dependencies = null },      

Both of these snippets of code make it so deps.zig generated on Windows does not compile if local dependencies are used:

if (d.type == .local) dd.main = try std.fs.path.join(options.alloc, &.{ d.main, save.main });

This uses the primary separator, which is \ on Windows.

zigmod/src/cmd/fetch.zig

Lines 287 to 293 in 6a2d664

try w.print(
\\ .pkg = Pkg{{ .name = "{s}", .source = .{{ .path = dirs._{s} ++ "/{s}" }}, .dependencies =
, .{
mod.name,
mod.short_id(),
mod.main,
});

This does not escape special characters.

@brodeuralexis
Copy link
Author

Found a workaround.

From:

dependencies:
  - src: local package-name package-path

To:

dependencies:
  - src: local package-name package-path/

Note the / at the end of the package path.

@nektro nektro added the bug Something isn't working label Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants