Skip to content

Zig 0.16-dev build error: root source file struct 'process' has no member named 'getEnvVarOwned' #100

Description

@figuerom16

It looks like zig 0.16 changed std.process.getEnvVarOwned to std.process.Environ.getAlloc but that might change before release also.

zig build
zig-pkg/zgui-0.6.0-dev--L6sZCJKbgBZGCzVMcwD0bNGmpK6yO-UoIESHX5JiRet/build.zig:330:40: error: root source file struct 'process' has no member named 'getEnvVarOwned'
            const sdk_env = std.process.getEnvVarOwned(b.allocator, "VULKAN_SDK") catch |err| switch (err) {
                            ~~~~~~~~~~~^~~~~~~~~~~~~~~
/home/<user>/zig/lib/std/process.zig:1:1: note: struct declared here
const builtin = @import("builtin");
^~~~~
referenced by:
    runBuild__anon_142466: /home/<user>/zig/lib/std/Build.zig:2261:33
    dependencyInner__anon_135283: /home/<user>/zig/lib/std/Build.zig:2242:29
    9 reference(s) hidden; use '-freference-trace=11' to see all references

build.zig:

const std = @import("std");

pub fn build(b: *std.Build) void {
    const target = b.standardTargetOptions(.{});
    const optimize = b.standardOptimizeOption(.{});

    const exe = b.addExecutable(.{
        .name = "zlitequack",
        .root_module = b.createModule(.{
            .root_source_file = b.path("src/root.zig"),
            .target = target,
            .optimize = optimize,
        }),
    });

    const zgui = b.dependency("zgui", .{
        .shared = false,
        .with_implot = true,
    });
    exe.root_module.addImport("zgui", zgui.module("root"));
    exe.root_module.linkLibrary(zgui.artifact("imgui"));

    const zglfw = b.dependency("zglfw", .{});
    exe.root_module.addImport("zglfw", zglfw.module("root"));
    exe.root_module.linkLibrary(zglfw.artifact("glfw"));

    const zpool = b.dependency("zpool", .{});
    exe.root_module.addImport("zpool", zpool.module("root"));

    const zgpu = b.dependency("zgpu", .{});
    exe.root_module.addImport("zgpu", zgpu.module("root"));
    exe.root_module.linkLibrary(zgpu.artifact("zdawn"));

    b.installArtifact(exe);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions