mirror of
https://github.com/ziglang/zig.git
synced 2025-12-27 16:43:07 +00:00
CLI: use dummy http client when bootstrapping
Prevents unnecessary depedency on networking when bootstrapping zig.
This commit is contained in:
parent
18091b4406
commit
3dad7312b2
12
src/main.zig
12
src/main.zig
@ -5379,7 +5379,16 @@ pub fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !voi
|
||||
try thread_pool.init(.{ .allocator = gpa });
|
||||
defer thread_pool.deinit();
|
||||
|
||||
var http_client: std.http.Client = .{ .allocator = gpa };
|
||||
// Dummy http client that is not actually used when only_core_functionality is enabled.
|
||||
// Prevents bootstrap from depending on a bunch of unnecessary stuff.
|
||||
const HttpClient = if (build_options.only_core_functionality) struct {
|
||||
allocator: Allocator,
|
||||
fn deinit(self: *@This()) void {
|
||||
_ = self;
|
||||
}
|
||||
} else std.http.Client;
|
||||
|
||||
var http_client: HttpClient = .{ .allocator = gpa };
|
||||
defer http_client.deinit();
|
||||
|
||||
var unlazy_set: Package.Fetch.JobQueue.UnlazySet = .{};
|
||||
@ -5656,6 +5665,7 @@ pub fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !voi
|
||||
if (code == 2) process.exit(2);
|
||||
|
||||
if (code == 3) {
|
||||
if (build_options.only_core_functionality) process.exit(3);
|
||||
// Indicates the configure phase failed due to missing lazy
|
||||
// dependencies and stdout contains the hashes of the ones
|
||||
// that are missing.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user