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

Zig's std.os.getenv is linux-only and does not compile on windows. #25

Closed
sarahkittyy opened this issue Aug 22, 2023 · 0 comments · Fixed by #26
Closed

Zig's std.os.getenv is linux-only and does not compile on windows. #25

sarahkittyy opened this issue Aug 22, 2023 · 0 comments · Fixed by #26
Labels
bug Something isn't working

Comments

@sarahkittyy
Copy link
Contributor

Description

This program cannot compile on Windows because std.os.getenv is not cross-platform. It should be replaced with std.process.getEnvVarOwned.

How to Reproduce the Bug

  • Run zig build on windows.

Additional Context

D:\zig\lib\std\os.zig:1910:9: error: std.os.getenv is unavailable for Windows because environment string is in WTF-16 format. See std.process.getEnvVarOwned for cross-platform API or std.os.getenvW for Windows-specific API.
        @compileError("std.os.getenv is unavailable for Windows because environment string is in WTF-16 format. See std.process.getEnvVarOwned for cross-platform API or std.os.getenvW for Windows-specific API.");
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
referenced by:
    getOrInitIdentity: src\gossip\cmd.zig:19:28
    initSpy: src\gossip\cluster_info.zig:62:30
    remaining reference traces hidden; use '-freference-trace' to see all reference traces
@sarahkittyy sarahkittyy added the bug Something isn't working label Aug 22, 2023
@ultd ultd closed this as completed in #26 Aug 23, 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

Successfully merging a pull request may close this issue.

1 participant