| ... | ... | @@ -281,12 +281,8 @@ pub fn mainArgs(gpa: Allocator, arena: Allocator, args: []const []const u8) !voi |
| 281 | 281 | mem.eql(u8, cmd, "ar")) |
| 282 | 282 | { |
| 283 | 283 | return process.exit(try llvmArMain(arena, args)); |
| 284 | | } else if (mem.eql(u8, cmd, "cc")) { |
| 285 | | return buildOutputType(gpa, arena, args, .cc); |
| 286 | | } else if (mem.eql(u8, cmd, "c++")) { |
| 287 | | return buildOutputType(gpa, arena, args, .cpp); |
| 288 | | } else if (mem.eql(u8, cmd, "translate-c")) { |
| 289 | | return buildOutputType(gpa, arena, args, .translate_c); |
| 284 | } else if (mem.eql(u8, cmd, "build")) { |
| 285 | return cmdBuild(gpa, arena, cmd_args); |
| 290 | 286 | } else if (mem.eql(u8, cmd, "clang") or |
| 291 | 287 | mem.eql(u8, cmd, "-cc1") or mem.eql(u8, cmd, "-cc1as")) |
| 292 | 288 | { |
| ... | ... | @@ -296,8 +292,14 @@ pub fn mainArgs(gpa: Allocator, arena: Allocator, args: []const []const u8) !voi |
| 296 | 292 | mem.eql(u8, cmd, "wasm-ld")) |
| 297 | 293 | { |
| 298 | 294 | return process.exit(try lldMain(arena, args, true)); |
| 299 | | } else if (mem.eql(u8, cmd, "build")) { |
| 300 | | return cmdBuild(gpa, arena, cmd_args); |
| 295 | } else if (build_options.only_core_functionality) { |
| 296 | @panic("only a few subcommands are supported in a zig2.c build"); |
| 297 | } else if (mem.eql(u8, cmd, "cc")) { |
| 298 | return buildOutputType(gpa, arena, args, .cc); |
| 299 | } else if (mem.eql(u8, cmd, "c++")) { |
| 300 | return buildOutputType(gpa, arena, args, .cpp); |
| 301 | } else if (mem.eql(u8, cmd, "translate-c")) { |
| 302 | return buildOutputType(gpa, arena, args, .translate_c); |
| 301 | 303 | } else if (mem.eql(u8, cmd, "fmt")) { |
| 302 | 304 | return cmdFmt(gpa, arena, cmd_args); |
| 303 | 305 | } else if (mem.eql(u8, cmd, "objcopy")) { |
| ... | ... | @@ -678,7 +680,7 @@ const ArgMode = union(enum) { |
| 678 | 680 | |
| 679 | 681 | /// Avoid dragging networking into zig2.c because it adds dependencies on some |
| 680 | 682 | /// linker symbols that are annoying to satisfy while bootstrapping. |
| 681 | | const Ip4Address = if (build_options.omit_pkg_fetching_code) void else std.net.Ip4Address; |
| 683 | const Ip4Address = if (build_options.only_core_functionality) void else std.net.Ip4Address; |
| 682 | 684 | |
| 683 | 685 | const Listen = union(enum) { |
| 684 | 686 | none, |
| ... | ... | @@ -1177,7 +1179,7 @@ fn buildOutputType( |
| 1177 | 1179 | if (mem.eql(u8, next_arg, "-")) { |
| 1178 | 1180 | listen = .stdio; |
| 1179 | 1181 | } else { |
| 1180 | | if (build_options.omit_pkg_fetching_code) unreachable; |
| 1182 | if (build_options.only_core_functionality) unreachable; |
| 1181 | 1183 | // example: --listen 127.0.0.1:9000 |
| 1182 | 1184 | var it = std.mem.split(u8, next_arg, ":"); |
| 1183 | 1185 | const host = it.next().?; |
| ... | ... | @@ -3266,7 +3268,7 @@ fn buildOutputType( |
| 3266 | 3268 | return cleanExit(); |
| 3267 | 3269 | }, |
| 3268 | 3270 | .ip4 => |ip4_addr| { |
| 3269 | | if (build_options.omit_pkg_fetching_code) unreachable; |
| 3271 | if (build_options.only_core_functionality) unreachable; |
| 3270 | 3272 | |
| 3271 | 3273 | var server = std.net.StreamServer.init(.{ |
| 3272 | 3274 | .reuse_address = true, |
| ... | ... | @@ -4413,7 +4415,7 @@ pub fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !voi |
| 4413 | 4415 | .root_src_directory = build_directory, |
| 4414 | 4416 | .root_src_path = build_zig_basename, |
| 4415 | 4417 | }; |
| 4416 | | if (!build_options.omit_pkg_fetching_code) { |
| 4418 | if (!build_options.only_core_functionality) { |
| 4417 | 4419 | var http_client: std.http.Client = .{ .allocator = gpa }; |
| 4418 | 4420 | defer http_client.deinit(); |
| 4419 | 4421 | |