| ... | ... | @@ -110,7 +110,7 @@ pub fn main() !void { |
| 110 | 110 | "--cache-dir", |
| 111 | 111 | ".local-cache", |
| 112 | 112 | "--global-cache-dir", |
| 113 | | ".global_cache", |
| 113 | ".global-cache", |
| 114 | 114 | "--listen=-", |
| 115 | 115 | }); |
| 116 | 116 | if (opt_resolved_lib_dir) |resolved_lib_dir| { |
| ... | ... | @@ -373,7 +373,7 @@ const Eval = struct { |
| 373 | 373 | }; |
| 374 | 374 | |
| 375 | 375 | var argv_buf: [2][]const u8 = undefined; |
| 376 | | const argv: []const []const u8, const ignore_stderr: bool = switch (std.zig.system.getExternalExecutor( |
| 376 | const argv: []const []const u8, const is_foreign: bool = switch (std.zig.system.getExternalExecutor( |
| 377 | 377 | eval.host, |
| 378 | 378 | &eval.target.resolved, |
| 379 | 379 | .{ .link_libc = eval.target.backend == .cbe }, |
| ... | ... | @@ -395,8 +395,6 @@ const Eval = struct { |
| 395 | 395 | .qemu, .wine, .wasmtime, .darling => |executor_cmd| argv: { |
| 396 | 396 | argv_buf[0] = executor_cmd; |
| 397 | 397 | argv_buf[1] = binary_path; |
| 398 | | // Some executors (looking at you, Wine) like throwing some stderr in, just for fun. |
| 399 | | // Therefore, we'll ignore stderr when using a foreign executor. |
| 400 | 398 | break :argv .{ argv_buf[0..2], true }; |
| 401 | 399 | }, |
| 402 | 400 | }; |
| ... | ... | @@ -410,15 +408,31 @@ const Eval = struct { |
| 410 | 408 | .cwd_dir = eval.tmp_dir, |
| 411 | 409 | .cwd = eval.tmp_dir_path, |
| 412 | 410 | }) catch |err| { |
| 411 | if (is_foreign) { |
| 412 | // Chances are the foreign executor isn't available. Skip this evaluation. |
| 413 | if (eval.allow_stderr) { |
| 414 | std.log.warn("update '{s}': skipping execution of '{s}' via executor for foreign target '{s}': {s}", .{ |
| 415 | update.name, |
| 416 | binary_path, |
| 417 | try eval.target.resolved.zigTriple(eval.arena), |
| 418 | @errorName(err), |
| 419 | }); |
| 420 | } |
| 421 | return; |
| 422 | } |
| 413 | 423 | eval.fatal("update '{s}': failed to run the generated executable '{s}': {s}", .{ |
| 414 | 424 | update.name, binary_path, @errorName(err), |
| 415 | 425 | }); |
| 416 | 426 | }; |
| 417 | | if (!ignore_stderr and result.stderr.len != 0) { |
| 427 | |
| 428 | // Some executors (looking at you, Wine) like throwing some stderr in, just for fun. |
| 429 | // Therefore, we'll ignore stderr when using a foreign executor. |
| 430 | if (!is_foreign and result.stderr.len != 0) { |
| 418 | 431 | std.log.err("update '{s}': generated executable '{s}' had unexpected stderr:\n{s}", .{ |
| 419 | 432 | update.name, binary_path, result.stderr, |
| 420 | 433 | }); |
| 421 | 434 | } |
| 435 | |
| 422 | 436 | switch (result.term) { |
| 423 | 437 | .Exited => |code| switch (update.outcome) { |
| 424 | 438 | .unknown, .compile_errors => unreachable, |
| ... | ... | @@ -438,7 +452,8 @@ const Eval = struct { |
| 438 | 452 | }); |
| 439 | 453 | }, |
| 440 | 454 | } |
| 441 | | if (!ignore_stderr and result.stderr.len != 0) std.process.exit(1); |
| 455 | |
| 456 | if (!is_foreign and result.stderr.len != 0) std.process.exit(1); |
| 442 | 457 | } |
| 443 | 458 | |
| 444 | 459 | fn requestUpdate(eval: *Eval) !void { |
| ... | ... | @@ -594,7 +609,7 @@ const Case = struct { |
| 594 | 609 | if (std.mem.startsWith(u8, line, "#")) { |
| 595 | 610 | var line_it = std.mem.splitScalar(u8, line, '='); |
| 596 | 611 | const key = line_it.first()[1..]; |
| 597 | | const val = line_it.rest(); |
| 612 | const val = std.mem.trimRight(u8, line_it.rest(), "\r"); // windows moment |
| 598 | 613 | if (val.len == 0) { |
| 599 | 614 | fatal("line {d}: missing value", .{line_n}); |
| 600 | 615 | } else if (std.mem.eql(u8, key, "target")) { |