Skip to content

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

Description

@andrewrk

Extracted from #14647.

if (err==error.InvalidExeorerr==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.
constexe=switch (self.argv.items[0]) {
.artifact=>|exe|exe,
else=>break :interpret,
};
switch (exe.kind) {
.exe, .@"test"=> {},
else=>break :interpret,
}
constneed_cross_glibc=exe.target.isGnuLibC() andexe.is_linking_libc;
switch (b.host.getExternalExecutor(exe.target_info, .{
.qemu_fixes_dl=need_cross_glibcandb.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.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