authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-04-02 23:36:01+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-04-02 23:58:52+02:00
log55ee88f9c0cf2c03f05cce6cbb887dc60c8b418b
treeb4d1c22473a3b5f0a03d8bfb5143678c23d72ad1
parent1b62a22268117340ee7a17f019df01cd39ec1421
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.zig.system: Fix wine executable name in getExternalExecutor().

I'm not actually aware of any distro where the name is wine64, so just use wine in all cases. As part of this, I also fixed the architecture checks to match reality. Closes #23411.

1 files changed, 11 insertions(+), 13 deletions(-)

lib/std/zig/system.zig+11-13
......@@ -128,19 +128,17 @@ pub fn getExternalExecutor(
128128 switch (candidate.os.tag) {
129129 .windows => {
130130 if (options.allow_wine) {
131 // x86_64 wine does not support emulating aarch64-windows and
132 // vice versa.
133 if (candidate.cpu.arch != builtin.cpu.arch and
134 !(candidate.cpu.arch == .thumb and builtin.cpu.arch == .aarch64) and
135 !(candidate.cpu.arch == .x86 and builtin.cpu.arch == .x86_64))
136 {
137 return bad_result;
138 }
139 switch (candidate.ptrBitWidth()) {
140 32 => return Executor{ .wine = "wine" },
141 64 => return Executor{ .wine = "wine64" },
142 else => return bad_result,
143 }
131 const wine_supported = switch (candidate.cpu.arch) {
132 .thumb => switch (host.cpu.arch) {
133 .arm, .thumb, .aarch64 => true,
134 else => false,
135 },
136 .aarch64 => host.cpu.arch == .aarch64,
137 .x86 => host.cpu.arch.isX86(),
138 .x86_64 => host.cpu.arch == .x86_64,
139 else => false,
140 };
141 return if (wine_supported) Executor{ .wine = "wine" } else bad_result;
144142 }
145143 return bad_result;
146144 },