authorgravatar for quae@daurnimator.comdaurnimator <quae@daurnimator.com> 2021-01-02 04:13:08+11:00
committergravatar for quae@daurnimator.comdaurnimator <quae@daurnimator.com> 2021-01-02 04:13:08+11:00
logaa631cfd1f614a08b2fba2de22b46f8ad212894a
treeaec40251834c2667528234bc77d200f972c880a2
parentb3c9dfc9cc843c2bf9e2c3490334092ea4d9d5a7
signaturelock-open Commit is signed but in an unrecognized format.

Build errors should be followed by two newlines


1 files changed, 21 insertions(+), 17 deletions(-)

lib/std/build.zig+21-17
......@@ -471,32 +471,32 @@ pub const Builder = struct {
471471 } else if (mem.eql(u8, s, "false")) {
472472 return false;
473473 } else {
474 warn("Expected -D{} to be a boolean, but received '{}'\n", .{ name, s });
474 warn("Expected -D{} to be a boolean, but received '{}'\n\n", .{ name, s });
475475 self.markInvalidUserInput();
476476 return null;
477477 }
478478 },
479479 .List => {
480 warn("Expected -D{} to be a boolean, but received a list.\n", .{name});
480 warn("Expected -D{} to be a boolean, but received a list.\n\n", .{name});
481481 self.markInvalidUserInput();
482482 return null;
483483 },
484484 },
485485 .Int => switch (entry.value.value) {
486486 .Flag => {
487 warn("Expected -D{} to be an integer, but received a boolean.\n", .{name});
487 warn("Expected -D{} to be an integer, but received a boolean.\n\n", .{name});
488488 self.markInvalidUserInput();
489489 return null;
490490 },
491491 .Scalar => |s| {
492492 const n = std.fmt.parseInt(T, s, 10) catch |err| switch (err) {
493493 error.Overflow => {
494 warn("-D{} value {} cannot fit into type {}.\n", .{ name, s, @typeName(T) });
494 warn("-D{} value {} cannot fit into type {}.\n\n", .{ name, s, @typeName(T) });
495495 self.markInvalidUserInput();
496496 return null;
497497 },
498498 else => {
499 warn("Expected -D{} to be an integer of type {}.\n", .{ name, @typeName(T) });
499 warn("Expected -D{} to be an integer of type {}.\n\n", .{ name, @typeName(T) });
500500 self.markInvalidUserInput();
501501 return null;
502502 },
......@@ -504,34 +504,34 @@ pub const Builder = struct {
504504 return n;
505505 },
506506 .List => {
507 warn("Expected -D{} to be an integer, but received a list.\n", .{name});
507 warn("Expected -D{} to be an integer, but received a list.\n\n", .{name});
508508 self.markInvalidUserInput();
509509 return null;
510510 },
511511 },
512512 .Float => switch (entry.value.value) {
513513 .Flag => {
514 warn("Expected -D{} to be a float, but received a boolean.\n", .{name});
514 warn("Expected -D{} to be a float, but received a boolean.\n\n", .{name});
515515 self.markInvalidUserInput();
516516 return null;
517517 },
518518 .Scalar => |s| {
519519 const n = std.fmt.parseFloat(T, s) catch |err| {
520 warn("Expected -D{} to be a float of type {}.\n", .{ name, @typeName(T) });
520 warn("Expected -D{} to be a float of type {}.\n\n", .{ name, @typeName(T) });
521521 self.markInvalidUserInput();
522522 return null;
523523 };
524524 return n;
525525 },
526526 .List => {
527 warn("Expected -D{} to be a float, but received a list.\n", .{name});
527 warn("Expected -D{} to be a float, but received a list.\n\n", .{name});
528528 self.markInvalidUserInput();
529529 return null;
530530 },
531531 },
532532 .Enum => switch (entry.value.value) {
533533 .Flag => {
534 warn("Expected -D{} to be a string, but received a boolean.\n", .{name});
534 warn("Expected -D{} to be a string, but received a boolean.\n\n", .{name});
535535 self.markInvalidUserInput();
536536 return null;
537537 },
......@@ -539,25 +539,25 @@ pub const Builder = struct {
539539 if (std.meta.stringToEnum(T, s)) |enum_lit| {
540540 return enum_lit;
541541 } else {
542 warn("Expected -D{} to be of type {}.\n", .{ name, @typeName(T) });
542 warn("Expected -D{} to be of type {}.\n\n", .{ name, @typeName(T) });
543543 self.markInvalidUserInput();
544544 return null;
545545 }
546546 },
547547 .List => {
548 warn("Expected -D{} to be a string, but received a list.\n", .{name});
548 warn("Expected -D{} to be a string, but received a list.\n\n", .{name});
549549 self.markInvalidUserInput();
550550 return null;
551551 },
552552 },
553553 .String => switch (entry.value.value) {
554554 .Flag => {
555 warn("Expected -D{} to be a string, but received a boolean.\n", .{name});
555 warn("Expected -D{} to be a string, but received a boolean.\n\n", .{name});
556556 self.markInvalidUserInput();
557557 return null;
558558 },
559559 .List => {
560 warn("Expected -D{} to be a string, but received a list.\n", .{name});
560 warn("Expected -D{} to be a string, but received a list.\n\n", .{name});
561561 self.markInvalidUserInput();
562562 return null;
563563 },
......@@ -565,7 +565,7 @@ pub const Builder = struct {
565565 },
566566 .List => switch (entry.value.value) {
567567 .Flag => {
568 warn("Expected -D{} to be a list, but received a boolean.\n", .{name});
568 warn("Expected -D{} to be a list, but received a boolean.\n\n", .{name});
569569 self.markInvalidUserInput();
570570 return null;
571571 },
......@@ -615,7 +615,7 @@ pub const Builder = struct {
615615 else if (!release_fast and !release_safe and !release_small)
616616 builtin.Mode.Debug
617617 else x: {
618 warn("Multiple release modes (of -Drelease-safe, -Drelease-fast and -Drelease-small)", .{});
618 warn("Multiple release modes (of -Drelease-safe, -Drelease-fast and -Drelease-small)\n\n", .{});
619619 self.markInvalidUserInput();
620620 break :x builtin.Mode.Debug;
621621 };
......@@ -653,6 +653,7 @@ pub const Builder = struct {
653653 for (diags.arch.?.allCpuModels()) |cpu| {
654654 warn(" {}\n", .{cpu.name});
655655 }
656 warn("\n", .{});
656657 self.markInvalidUserInput();
657658 return args.default_target;
658659 },
......@@ -668,6 +669,7 @@ pub const Builder = struct {
668669 for (diags.arch.?.allFeaturesList()) |feature| {
669670 warn(" {}: {}\n", .{ feature.name, feature.description });
670671 }
672 warn("\n", .{});
671673 self.markInvalidUserInput();
672674 return args.default_target;
673675 },
......@@ -680,11 +682,12 @@ pub const Builder = struct {
680682 inline for (std.meta.fields(std.Target.Os.Tag)) |field| {
681683 warn(" {}\n", .{field.name});
682684 }
685 warn("\n", .{});
683686 self.markInvalidUserInput();
684687 return args.default_target;
685688 },
686689 else => |e| {
687 warn("Unable to parse target '{}': {}\n", .{ triple, @errorName(e) });
690 warn("Unable to parse target '{}': {}\n\n", .{ triple, @errorName(e) });
688691 self.markInvalidUserInput();
689692 return args.default_target;
690693 },
......@@ -707,6 +710,7 @@ pub const Builder = struct {
707710 const t_triple = t.zigTriple(self.allocator) catch unreachable;
708711 warn(" {}\n", .{t_triple});
709712 }
713 warn("\n", .{});
710714 self.markInvalidUserInput();
711715 return args.default_target;
712716 }