Skip to content

RunStep: learn target information from the binary on disk rather than knowledge of the target ahead of time #14949

@andrewrk

Description

@andrewrk

Extracted from #14647.

if (err == error.InvalidExe or err == error.FileNotFound) interpret: {
// TODO: learn the target from the binary directly rather than from
// relying on it being a CompileStep. This will make this logic
// work even for the edge case that the binary was produced by a
// third party.
const exe = switch (self.argv.items[0]) {
.artifact => |exe| exe,
else => break :interpret,
};
switch (exe.kind) {
.exe, .@"test" => {},
else => break :interpret,
}
const need_cross_glibc = exe.target.isGnuLibC() and exe.is_linking_libc;
switch (b.host.getExternalExecutor(exe.target_info, .{
.qemu_fixes_dl = need_cross_glibc and b.glibc_runtimes_dir != null,
.link_libc = exe.is_linking_libc,
})) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementSolving this issue will likely involve adding new logic or components to the codebase.proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.zig build systemstd.Build, the build runner, `zig build` subcommand, package management

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions