Skip to content

add dependent modules regardless of whether a runner was specified #23626

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 21 additions & 22 deletions src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3038,8 +3038,8 @@ fn buildOutputType(
};

const root_mod = if (arg_mode == .zig_test) root_mod: {
const test_mod = if (test_runner_path) |test_runner| test_mod: {
const test_mod = try Package.Module.create(arena, .{
const test_mod = if (test_runner_path) |test_runner|
try Package.Module.create(arena, .{
.global_cache_directory = global_cache_directory,
.paths = .{
.root = .{
Expand All @@ -3055,27 +3055,26 @@ fn buildOutputType(
.parent = main_mod,
.builtin_mod = main_mod.getBuiltinDependency(),
.builtin_modules = null, // `builtin_mod` is specified
});
test_mod.deps = try main_mod.deps.clone(arena);
break :test_mod test_mod;
} else try Package.Module.create(arena, .{
.global_cache_directory = global_cache_directory,
.paths = .{
.root = .{
.root_dir = zig_lib_directory,
.sub_path = "compiler",
})
else
try Package.Module.create(arena, .{
.global_cache_directory = global_cache_directory,
.paths = .{
.root = .{
.root_dir = zig_lib_directory,
.sub_path = "compiler",
},
.root_src_path = "test_runner.zig",
},
.root_src_path = "test_runner.zig",
},
.fully_qualified_name = "root",
.cc_argv = &.{},
.inherited = .{},
.global = create_module.resolved_options,
.parent = main_mod,
.builtin_mod = main_mod.getBuiltinDependency(),
.builtin_modules = null, // `builtin_mod` is specified
});

.fully_qualified_name = "root",
.cc_argv = &.{},
.inherited = .{},
.global = create_module.resolved_options,
.parent = main_mod,
.builtin_mod = main_mod.getBuiltinDependency(),
.builtin_modules = null, // `builtin_mod` is specified
});
test_mod.deps = try main_mod.deps.clone(arena);
break :root_mod test_mod;
} else main_mod;

Expand Down