authorgravatar for luuk@degram.devLuuk de Gram <luuk@degram.dev> 2022-10-19 08:36:14+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2022-10-19 08:36:14+02:00
log7d6596e979df799782b77ce3fed722b792509388
tree3f930a1e6f13c9d3dd6fea4ff096b1a8eda7d3c9
parent1952dd6437a73e3de211b649924a55fcb6e030be
parentc0fe135ff3ec09c71103f382cdca60506b557e57
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #13218 from Luukdegram/fix-emulatable-step

std: CheckObject - correctly depend on its own step when creating an EmulatableRunStep

8 files changed, 3 insertions(+), 11 deletions(-)

lib/std/build/CheckObjectStep.zig+3-1
......@@ -45,7 +45,9 @@ pub fn runAndCompare(self: *CheckObjectStep) *EmulatableRunStep {
4545 assert(dependencies_len > 0);
4646 const exe_step = self.step.dependencies.items[dependencies_len - 1];
4747 const exe = exe_step.cast(std.build.LibExeObjStep).?;
48 return EmulatableRunStep.create(self.builder, "EmulatableRun", exe);
48 const emulatable_step = EmulatableRunStep.create(self.builder, "EmulatableRun", exe);
49 emulatable_step.step.dependOn(&self.step);
50 return emulatable_step;
4951}
5052
5153/// There two types of actions currently suported:
test/link/macho/dead_strip/build.zig-2
......@@ -16,7 +16,6 @@ pub fn build(b: *Builder) void {
1616 const check = exe.checkObject(.macho);
1717 check.checkInSymtab();
1818 check.checkNext("{*} (__TEXT,__text) external _iAmUnused");
19 test_step.dependOn(&check.step);
2019
2120 const run_cmd = check.runAndCompare();
2221 run_cmd.expectStdOutEqual("Hello!\n");
......@@ -31,7 +30,6 @@ pub fn build(b: *Builder) void {
3130 const check = exe.checkObject(.macho);
3231 check.checkInSymtab();
3332 check.checkNotPresent("{*} (__TEXT,__text) external _iAmUnused");
34 test_step.dependOn(&check.step);
3533
3634 const run_cmd = check.runAndCompare();
3735 run_cmd.expectStdOutEqual("Hello!\n");
test/link/macho/dylib/build.zig-2
......@@ -40,8 +40,6 @@ pub fn build(b: *Builder) void {
4040 check_exe.checkNext("current version 10000");
4141 check_exe.checkNext("compatibility version 10000");
4242
43 test_step.dependOn(&check_exe.step);
44
4543 check_exe.checkStart("cmd RPATH");
4644 check_exe.checkNext(std.fmt.allocPrint(b.allocator, "path {s}", .{b.pathFromRoot("zig-out/lib")}) catch unreachable);
4745
test/link/macho/entry/build.zig-1
......@@ -26,7 +26,6 @@ pub fn build(b: *Builder) void {
2626 check_exe.checkNext("{n_value} (__TEXT,__text) external _non_main");
2727
2828 check_exe.checkComputeCompare("vmaddr entryoff +", .{ .op = .eq, .value = .{ .variable = "n_value" } });
29 test_step.dependOn(&check_exe.step);
3029
3130 const run = check_exe.runAndCompare();
3231 run.expectStdOutEqual("42");
test/link/macho/needed_library/build.zig-1
......@@ -31,7 +31,6 @@ pub fn build(b: *Builder) void {
3131 const check = exe.checkObject(.macho);
3232 check.checkStart("cmd LOAD_DYLIB");
3333 check.checkNext("name @rpath/liba.dylib");
34 test_step.dependOn(&check.step);
3534
3635 const run_cmd = check.runAndCompare();
3736 test_step.dependOn(&run_cmd.step);
test/link/macho/search_strategy/build.zig-1
......@@ -17,7 +17,6 @@ pub fn build(b: *Builder) void {
1717 const check = exe.checkObject(.macho);
1818 check.checkStart("cmd LOAD_DYLIB");
1919 check.checkNext("name @rpath/liba.dylib");
20 test_step.dependOn(&check.step);
2120
2221 const run = check.runAndCompare();
2322 run.cwd = b.pathFromRoot(".");
test/link/macho/stack_size/build.zig-1
......@@ -18,7 +18,6 @@ pub fn build(b: *Builder) void {
1818 const check_exe = exe.checkObject(.macho);
1919 check_exe.checkStart("cmd MAIN");
2020 check_exe.checkNext("stacksize 100000000");
21 test_step.dependOn(&check_exe.step);
2221
2322 const run = check_exe.runAndCompare();
2423 test_step.dependOn(&run.step);
test/link/macho/weak_library/build.zig-2
......@@ -33,8 +33,6 @@ pub fn build(b: *Builder) void {
3333 check.checkNext("(undefined) weak external _a (from liba)");
3434 check.checkNext("(undefined) weak external _asStr (from liba)");
3535
36 test_step.dependOn(&check.step);
37
3836 const run_cmd = check.runAndCompare();
3937 run_cmd.expectStdOutEqual("42 42");
4038 test_step.dependOn(&run_cmd.step);