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