remove deprecated --mod CLI now that a zig1.wasm update happened

This commit is contained in:
Andrew Kelley 2024-07-22 17:54:30 -07:00
parent f2bf6c1b11
commit 80269c1f53
5 changed files with 19 additions and 35 deletions

View File

@ -865,9 +865,9 @@ set(BUILD_ZIG2_ARGS
-target "${ZIG_HOST_TARGET_TRIPLE}"
--dep "build_options"
--dep "aro"
--mod "root" "src/main.zig"
--mod "build_options" "${ZIG_CONFIG_ZIG_OUT}"
--mod "aro" "lib/compiler/aro/aro.zig"
"-Mroot=src/main.zig"
"-Mbuild_options=${ZIG_CONFIG_ZIG_OUT}"
"-Maro=lib/compiler/aro/aro.zig"
)
add_custom_command(
@ -885,8 +885,8 @@ set(BUILD_COMPILER_RT_ARGS
-femit-bin="${ZIG_COMPILER_RT_C_SOURCE}"
-target "${ZIG_HOST_TARGET_TRIPLE}"
--dep "build_options"
--mod "root" "lib/compiler_rt.zig"
--mod "build_options" "${ZIG_CONFIG_ZIG_OUT}"
"-Mroot=lib/compiler_rt.zig"
"-Mbuild_options=${ZIG_CONFIG_ZIG_OUT}"
)
add_custom_command(

View File

@ -156,9 +156,9 @@ int main(int argc, char **argv) {
"-target", host_triple,
"--dep", "build_options",
"--dep", "aro",
"--mod", "root", "src/main.zig",
"--mod", "build_options", "config.zig",
"--mod", "aro", "lib/compiler/aro/aro.zig",
"-Mroot=src/main.zig",
"-Mbuild_options=config.zig",
"-Maro=lib/compiler/aro/aro.zig",
NULL,
};
print_and_run(child_argv);
@ -171,8 +171,8 @@ int main(int argc, char **argv) {
"--name", "compiler_rt", "-femit-bin=compiler_rt.c",
"-target", host_triple,
"--dep", "build_options",
"--mod", "root", "lib/compiler_rt.zig",
"--mod", "build_options", "config.zig",
"-Mroot=lib/compiler_rt.zig",
"-Mbuild_options=config.zig",
NULL,
};
print_and_run(child_argv);

View File

@ -90,8 +90,8 @@ CheckLastExitCode
-femit-bin="compiler_rt-x86_64-windows-msvc.c" `
--dep build_options `
-target x86_64-windows-msvc `
--mod root ..\lib\compiler_rt.zig `
--mod build_options config.zig
-Mroot="..\lib\compiler_rt.zig" `
-Mbuild_options="config.zig"
CheckLastExitCode
Import-Module "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"

View File

@ -89,8 +89,8 @@ CheckLastExitCode
-femit-bin="compiler_rt-x86_64-windows-msvc.c" `
--dep build_options `
-target x86_64-windows-msvc `
--mod root ..\lib\compiler_rt.zig `
--mod build_options config.zig
-Mroot="..\lib\compiler_rt.zig" `
-Mbuild_options="config.zig"
CheckLastExitCode
Import-Module "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"

View File

@ -945,17 +945,17 @@ fn buildOutputType(
// null means replace with the test executable binary
var test_exec_args: std.ArrayListUnmanaged(?[]const u8) = .{};
// These get set by CLI flags and then snapshotted when a `--mod` flag is
// These get set by CLI flags and then snapshotted when a `-M` flag is
// encountered.
var mod_opts: Package.Module.CreateOptions.Inherited = .{};
// These get appended to by CLI flags and then slurped when a `--mod` flag
// These get appended to by CLI flags and then slurped when a `-M` flag
// is encountered.
var cssan: ClangSearchSanitizer = .{};
var cc_argv: std.ArrayListUnmanaged([]const u8) = .{};
var deps: std.ArrayListUnmanaged(CliModule.Dep) = .{};
// Contains every module specified via --mod. The dependencies are added
// Contains every module specified via -M. The dependencies are added
// after argument parsing is completed. We use a StringArrayHashMap to make
// error output consistent. "root" is special.
var create_module: CreateModule = .{
@ -1081,22 +1081,6 @@ fn buildOutputType(
.key = key,
.value = value,
});
} else if (mem.eql(u8, arg, "--mod")) {
// deprecated, kept around until the next zig1.wasm update
try handleModArg(
arena,
args_iter.nextOrFatal(),
args_iter.nextOrFatal(),
&create_module,
&mod_opts,
&cc_argv,
&target_arch_os_abi,
&target_mcpu,
&deps,
&c_source_files_owner_index,
&rc_source_files_owner_index,
&cssan,
);
} else if (mem.startsWith(u8, arg, "-M")) {
var it = mem.splitScalar(u8, arg["-M".len..], '=');
const mod_name = it.next().?;
@ -2649,7 +2633,7 @@ fn buildOutputType(
const unresolved_src_path = b: {
if (root_src_file) |src_path| {
if (create_module.modules.count() != 0) {
fatal("main module provided both by '--mod {s} {}{s}' and by positional argument '{s}'", .{
fatal("main module provided both by '-M{s}={}{s}' and by positional argument '{s}'", .{
create_module.modules.keys()[0],
create_module.modules.values()[0].paths.root,
create_module.modules.values()[0].paths.root_src_path,
@ -3409,7 +3393,7 @@ fn buildOutputType(
.native_system_include_paths = create_module.native_system_include_paths,
// Any leftover C compilation args (such as -I) apply globally rather
// than to any particular module. This feature can greatly reduce CLI
// noise when --search-prefix and --mod are combined.
// noise when --search-prefix and -M are combined.
.global_cc_argv = try cc_argv.toOwnedSlice(arena),
.file_system_inputs = &file_system_inputs,
.debug_compiler_runtime_libs = debug_compiler_runtime_libs,