authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-07-22 17:54:30-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-07-26 05:07:18-07:00
log80269c1f5384d6f11cd5bab981d23297b6b8cf0b
tree82db31ae75d0824829e4af82fb4c6518033fc23e
parentf2bf6c1b11702179329a4693cea429d550f519e1

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


5 files changed, 19 insertions(+), 35 deletions(-)

CMakeLists.txt+5-5
...@@ -865,9 +865,9 @@ set(BUILD_ZIG2_ARGS...@@ -865,9 +865,9 @@ set(BUILD_ZIG2_ARGS
865 -target "${ZIG_HOST_TARGET_TRIPLE}"865 -target "${ZIG_HOST_TARGET_TRIPLE}"
866 --dep "build_options"866 --dep "build_options"
867 --dep "aro"867 --dep "aro"
868 --mod "root" "src/main.zig"868 "-Mroot=src/main.zig"
869 --mod "build_options" "${ZIG_CONFIG_ZIG_OUT}"869 "-Mbuild_options=${ZIG_CONFIG_ZIG_OUT}"
870 --mod "aro" "lib/compiler/aro/aro.zig"870 "-Maro=lib/compiler/aro/aro.zig"
871)871)
872872
873add_custom_command(873add_custom_command(
...@@ -885,8 +885,8 @@ set(BUILD_COMPILER_RT_ARGS...@@ -885,8 +885,8 @@ set(BUILD_COMPILER_RT_ARGS
885 -femit-bin="${ZIG_COMPILER_RT_C_SOURCE}"885 -femit-bin="${ZIG_COMPILER_RT_C_SOURCE}"
886 -target "${ZIG_HOST_TARGET_TRIPLE}"886 -target "${ZIG_HOST_TARGET_TRIPLE}"
887 --dep "build_options"887 --dep "build_options"
888 --mod "root" "lib/compiler_rt.zig"888 "-Mroot=lib/compiler_rt.zig"
889 --mod "build_options" "${ZIG_CONFIG_ZIG_OUT}"889 "-Mbuild_options=${ZIG_CONFIG_ZIG_OUT}"
890)890)
891891
892add_custom_command(892add_custom_command(
bootstrap.c+5-5
...@@ -156,9 +156,9 @@ int main(int argc, char **argv) {...@@ -156,9 +156,9 @@ int main(int argc, char **argv) {
156 "-target", host_triple,156 "-target", host_triple,
157 "--dep", "build_options",157 "--dep", "build_options",
158 "--dep", "aro",158 "--dep", "aro",
159 "--mod", "root", "src/main.zig",159 "-Mroot=src/main.zig",
160 "--mod", "build_options", "config.zig",160 "-Mbuild_options=config.zig",
161 "--mod", "aro", "lib/compiler/aro/aro.zig",161 "-Maro=lib/compiler/aro/aro.zig",
162 NULL,162 NULL,
163 };163 };
164 print_and_run(child_argv);164 print_and_run(child_argv);
...@@ -171,8 +171,8 @@ int main(int argc, char **argv) {...@@ -171,8 +171,8 @@ int main(int argc, char **argv) {
171 "--name", "compiler_rt", "-femit-bin=compiler_rt.c",171 "--name", "compiler_rt", "-femit-bin=compiler_rt.c",
172 "-target", host_triple,172 "-target", host_triple,
173 "--dep", "build_options",173 "--dep", "build_options",
174 "--mod", "root", "lib/compiler_rt.zig",174 "-Mroot=lib/compiler_rt.zig",
175 "--mod", "build_options", "config.zig",175 "-Mbuild_options=config.zig",
176 NULL,176 NULL,
177 };177 };
178 print_and_run(child_argv);178 print_and_run(child_argv);
ci/x86_64-windows-debug.ps1+2-2
...@@ -90,8 +90,8 @@ CheckLastExitCode...@@ -90,8 +90,8 @@ CheckLastExitCode
90 -femit-bin="compiler_rt-x86_64-windows-msvc.c" `90 -femit-bin="compiler_rt-x86_64-windows-msvc.c" `
91 --dep build_options `91 --dep build_options `
92 -target x86_64-windows-msvc `92 -target x86_64-windows-msvc `
93 --mod root ..\lib\compiler_rt.zig `93 -Mroot="..\lib\compiler_rt.zig" `
94 --mod build_options config.zig94 -Mbuild_options="config.zig"
95CheckLastExitCode95CheckLastExitCode
9696
97Import-Module "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"97Import-Module "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
ci/x86_64-windows-release.ps1+2-2
...@@ -89,8 +89,8 @@ CheckLastExitCode...@@ -89,8 +89,8 @@ CheckLastExitCode
89 -femit-bin="compiler_rt-x86_64-windows-msvc.c" `89 -femit-bin="compiler_rt-x86_64-windows-msvc.c" `
90 --dep build_options `90 --dep build_options `
91 -target x86_64-windows-msvc `91 -target x86_64-windows-msvc `
92 --mod root ..\lib\compiler_rt.zig `92 -Mroot="..\lib\compiler_rt.zig" `
93 --mod build_options config.zig93 -Mbuild_options="config.zig"
94CheckLastExitCode94CheckLastExitCode
9595
96Import-Module "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"96Import-Module "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
src/main.zig+5-21
...@@ -945,17 +945,17 @@ fn buildOutputType(...@@ -945,17 +945,17 @@ fn buildOutputType(
945 // null means replace with the test executable binary945 // null means replace with the test executable binary
946 var test_exec_args: std.ArrayListUnmanaged(?[]const u8) = .{};946 var test_exec_args: std.ArrayListUnmanaged(?[]const u8) = .{};
947947
948 // These get set by CLI flags and then snapshotted when a `--mod` flag is948 // These get set by CLI flags and then snapshotted when a `-M` flag is
949 // encountered.949 // encountered.
950 var mod_opts: Package.Module.CreateOptions.Inherited = .{};950 var mod_opts: Package.Module.CreateOptions.Inherited = .{};
951951
952 // These get appended to by CLI flags and then slurped when a `--mod` flag952 // These get appended to by CLI flags and then slurped when a `-M` flag
953 // is encountered.953 // is encountered.
954 var cssan: ClangSearchSanitizer = .{};954 var cssan: ClangSearchSanitizer = .{};
955 var cc_argv: std.ArrayListUnmanaged([]const u8) = .{};955 var cc_argv: std.ArrayListUnmanaged([]const u8) = .{};
956 var deps: std.ArrayListUnmanaged(CliModule.Dep) = .{};956 var deps: std.ArrayListUnmanaged(CliModule.Dep) = .{};
957957
958 // Contains every module specified via --mod. The dependencies are added958 // Contains every module specified via -M. The dependencies are added
959 // after argument parsing is completed. We use a StringArrayHashMap to make959 // after argument parsing is completed. We use a StringArrayHashMap to make
960 // error output consistent. "root" is special.960 // error output consistent. "root" is special.
961 var create_module: CreateModule = .{961 var create_module: CreateModule = .{
...@@ -1081,22 +1081,6 @@ fn buildOutputType(...@@ -1081,22 +1081,6 @@ fn buildOutputType(
1081 .key = key,1081 .key = key,
1082 .value = value,1082 .value = value,
1083 });1083 });
1084 } else if (mem.eql(u8, arg, "--mod")) {
1085 // deprecated, kept around until the next zig1.wasm update
1086 try handleModArg(
1087 arena,
1088 args_iter.nextOrFatal(),
1089 args_iter.nextOrFatal(),
1090 &create_module,
1091 &mod_opts,
1092 &cc_argv,
1093 &target_arch_os_abi,
1094 &target_mcpu,
1095 &deps,
1096 &c_source_files_owner_index,
1097 &rc_source_files_owner_index,
1098 &cssan,
1099 );
1100 } else if (mem.startsWith(u8, arg, "-M")) {1084 } else if (mem.startsWith(u8, arg, "-M")) {
1101 var it = mem.splitScalar(u8, arg["-M".len..], '=');1085 var it = mem.splitScalar(u8, arg["-M".len..], '=');
1102 const mod_name = it.next().?;1086 const mod_name = it.next().?;
...@@ -2649,7 +2633,7 @@ fn buildOutputType(...@@ -2649,7 +2633,7 @@ fn buildOutputType(
2649 const unresolved_src_path = b: {2633 const unresolved_src_path = b: {
2650 if (root_src_file) |src_path| {2634 if (root_src_file) |src_path| {
2651 if (create_module.modules.count() != 0) {2635 if (create_module.modules.count() != 0) {
2652 fatal("main module provided both by '--mod {s} {}{s}' and by positional argument '{s}'", .{2636 fatal("main module provided both by '-M{s}={}{s}' and by positional argument '{s}'", .{
2653 create_module.modules.keys()[0],2637 create_module.modules.keys()[0],
2654 create_module.modules.values()[0].paths.root,2638 create_module.modules.values()[0].paths.root,
2655 create_module.modules.values()[0].paths.root_src_path,2639 create_module.modules.values()[0].paths.root_src_path,
...@@ -3409,7 +3393,7 @@ fn buildOutputType(...@@ -3409,7 +3393,7 @@ fn buildOutputType(
3409 .native_system_include_paths = create_module.native_system_include_paths,3393 .native_system_include_paths = create_module.native_system_include_paths,
3410 // Any leftover C compilation args (such as -I) apply globally rather3394 // Any leftover C compilation args (such as -I) apply globally rather
3411 // than to any particular module. This feature can greatly reduce CLI3395 // than to any particular module. This feature can greatly reduce CLI
3412 // noise when --search-prefix and --mod are combined.3396 // noise when --search-prefix and -M are combined.
3413 .global_cc_argv = try cc_argv.toOwnedSlice(arena),3397 .global_cc_argv = try cc_argv.toOwnedSlice(arena),
3414 .file_system_inputs = &file_system_inputs,3398 .file_system_inputs = &file_system_inputs,
3415 .debug_compiler_runtime_libs = debug_compiler_runtime_libs,3399 .debug_compiler_runtime_libs = debug_compiler_runtime_libs,