-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
breakingImplementing this issue could cause existing code to no longer compile or have different behavior.Implementing this issue could cause existing code to no longer compile or have different behavior.contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.zig build systemstd.Build, the build runner, `zig build` subcommand, package managementstd.Build, the build runner, `zig build` subcommand, package management
Milestone
Description
Extracted from #14647.
zig/lib/std/Build/CompileStep.zig
Lines 55 to 64 in 68c7261
emit_analysis: EmitOption = .default, | |
emit_asm: EmitOption = .default, | |
emit_bin: EmitOption = .default, | |
emit_docs: EmitOption = .default, | |
emit_implib: EmitOption = .default, | |
emit_llvm_bc: EmitOption = .default, | |
emit_llvm_ir: EmitOption = .default, | |
// Lots of things depend on emit_h having a consistent path, | |
// so it is not an EmitOption for now. | |
emit_h: bool = false, |
zig/lib/std/Build/CompileStep.zig
Lines 295 to 309 in 68c7261
pub const EmitOption = union(enum) { | |
default: void, | |
no_emit: void, | |
emit: void, | |
emit_to: []const u8, | |
fn getArg(self: @This(), b: *std.Build, arg_name: []const u8) ?[]const u8 { | |
return switch (self) { | |
.no_emit => b.fmt("-fno-{s}", .{arg_name}), | |
.default => null, | |
.emit => b.fmt("-f{s}", .{arg_name}), | |
.emit_to => |path| b.fmt("-f{s}={s}", .{ arg_name, path }), | |
}; | |
} | |
}; |
All of these, including emit_h
, will no longer have the option to specify an output path, same as #14951. Instead, the two choices will be null, or providing a FileSource to interact with the rest of the build system. The zig compiler itself will only ever see -femit-foo or -fno-emit-foo. It will always put the artifact in the cache directory, and the build script must rely on other steps that interact with FileSource to do anything with the artifacts.
Metadata
Metadata
Assignees
Labels
breakingImplementing this issue could cause existing code to no longer compile or have different behavior.Implementing this issue could cause existing code to no longer compile or have different behavior.contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.zig build systemstd.Build, the build runner, `zig build` subcommand, package managementstd.Build, the build runner, `zig build` subcommand, package management