| ... | ... | @@ -125,40 +125,33 @@ pub fn getExternalExecutor( |
| 125 | 125 | }; |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | if (options.allow_wasmtime and candidate.cpu.arch.isWasm()) { |
| 129 | return Executor{ .wasmtime = "wasmtime" }; |
| 130 | } |
| 131 | |
| 128 | 132 | switch (candidate.os.tag) { |
| 129 | 133 | .windows => { |
| 130 | 134 | 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 | | } |
| 144 | | } |
| 145 | | return bad_result; |
| 146 | | }, |
| 147 | | .wasi => { |
| 148 | | if (options.allow_wasmtime) { |
| 149 | | switch (candidate.ptrBitWidth()) { |
| 150 | | 32 => return Executor{ .wasmtime = "wasmtime" }, |
| 151 | | else => return bad_result, |
| 152 | | } |
| 135 | const wine_supported = switch (candidate.cpu.arch) { |
| 136 | .thumb => switch (host.cpu.arch) { |
| 137 | .arm, .thumb, .aarch64 => true, |
| 138 | else => false, |
| 139 | }, |
| 140 | .aarch64 => host.cpu.arch == .aarch64, |
| 141 | .x86 => host.cpu.arch.isX86(), |
| 142 | .x86_64 => host.cpu.arch == .x86_64, |
| 143 | else => false, |
| 144 | }; |
| 145 | return if (wine_supported) Executor{ .wine = "wine" } else bad_result; |
| 153 | 146 | } |
| 154 | 147 | return bad_result; |
| 155 | 148 | }, |
| 156 | | .macos => { |
| 149 | .driverkit, .macos => { |
| 157 | 150 | if (options.allow_darling) { |
| 158 | 151 | // This check can be loosened once darling adds a QEMU-based emulation |
| 159 | 152 | // layer for non-host architectures: |
| 160 | 153 | // https://github.com/darlinghq/darling/issues/863 |
| 161 | | if (candidate.cpu.arch != builtin.cpu.arch) { |
| 154 | if (candidate.cpu.arch != host.cpu.arch) { |
| 162 | 155 | return bad_result; |
| 163 | 156 | } |
| 164 | 157 | return Executor{ .darling = "darling" }; |