One of zig's principles as a toolchain is to reduce dependencies on global state of the system, so that collaborators on wildly different systems can have a seamless experience working with each other.
To that end, this code should be deleted:
|
if (!options.ignore_include_env_var) { |
|
const INCLUDE = std.process.getEnvVarOwned(allocator, "INCLUDE") catch ""; |
|
defer allocator.free(INCLUDE); |
|
|
|
// TODO: Should this be platform-specific? How does windres/llvm-rc handle this (if at all)? |
|
var it = std.mem.tokenize(u8, INCLUDE, ";"); |
|
while (it.next()) |search_path| { |
|
var dir = openSearchPathDir(options.cwd, search_path) catch continue; |
|
errdefer dir.close(); |
|
try search_dirs.append(.{ .dir = dir, .path = try allocator.dupe(u8, search_path) }); |
|
} |
|
} |
All include paths that are intended to be observed by resinator should be provided explicitly by the user, and explicitly for resinator and no other files, and it should be per invocation rather than global.
I noticed this when enhancing zig env to tattle on what environment variables are possibly observed by the compiler, and it's unfortunate that INCLUDE is in this list.
cc @squeek502
One of zig's principles as a toolchain is to reduce dependencies on global state of the system, so that collaborators on wildly different systems can have a seamless experience working with each other.
To that end, this code should be deleted:
zig/src/resinator/compile.zig
Lines 112 to 123 in 7a9500f
All include paths that are intended to be observed by resinator should be provided explicitly by the user, and explicitly for resinator and no other files, and it should be per invocation rather than global.
I noticed this when enhancing
zig envto tattle on what environment variables are possibly observed by the compiler, and it's unfortunate thatINCLUDEis in this list.cc @squeek502