diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.zig | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main.zig b/src/main.zig index ba82efc294..007adb78ac 100644 --- a/src/main.zig +++ b/src/main.zig @@ -637,6 +637,10 @@ const Emit = union(enum) { }; fn optionalStringEnvVar(arena: Allocator, name: []const u8) !?[]const u8 { + // Env vars aren't used in the bootstrap stage. + if (build_options.only_c) { + return null; + } if (std.process.getEnvVarOwned(arena, name)) |value| { return value; } else |err| switch (err) { @@ -676,8 +680,8 @@ fn buildOutputType( var no_builtin = false; var watch = false; var debug_compile_errors = false; - var verbose_link = std.process.hasEnvVarConstant("ZIG_VERBOSE_LINK"); - var verbose_cc = std.process.hasEnvVarConstant("ZIG_VERBOSE_CC"); + var verbose_link = (builtin.os.tag != .wasi or builtin.link_libc) and std.process.hasEnvVarConstant("ZIG_VERBOSE_LINK"); + var verbose_cc = (builtin.os.tag != .wasi or builtin.link_libc) and std.process.hasEnvVarConstant("ZIG_VERBOSE_CC"); var verbose_air = false; var verbose_llvm_ir = false; var verbose_cimport = false; @@ -859,7 +863,8 @@ fn buildOutputType( // before arg parsing, check for the NO_COLOR environment variable // if it exists, default the color setting to .off // explicit --color arguments will still override this setting. - color = if (std.process.hasEnvVarConstant("NO_COLOR")) .off else .auto; + // Disable color on WASI per https://github.com/WebAssembly/WASI/issues/162 + color = if (builtin.os.tag == .wasi or std.process.hasEnvVarConstant("NO_COLOR")) .off else .auto; switch (arg_mode) { .build, .translate_c, .zig_test, .run => { |
