aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-01-10 11:15:09 -0700
committerAndrew Kelley <andrew@ziglang.org>2023-01-11 15:39:49 -0800
commit876ab99f5c462e93296ef0b2f642ac2243acb31c (patch)
treeaeff0e4e284e35f4fea3222c852a015a1ced783f /src
parente0401498e928a539677f0f9eed843a0453bc8c33 (diff)
downloadzig-876ab99f5c462e93296ef0b2f642ac2243acb31c.tar.gz
zig-876ab99f5c462e93296ef0b2f642ac2243acb31c.zip
disable package manager code when bootstrapping
This makes building from source go faster and avoids tripping over unimplemented things in the C backend.
Diffstat (limited to 'src')
-rw-r--r--src/main.zig24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/main.zig b/src/main.zig
index 8741b4441c..d0052b518b 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -4083,17 +4083,19 @@ pub fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !voi
try thread_pool.init(gpa);
defer thread_pool.deinit();
- var http_client: std.http.Client = .{ .allocator = gpa };
- defer http_client.deinit();
- try http_client.rescanRootCertificates();
-
- try main_pkg.fetchAndAddDependencies(
- &thread_pool,
- &http_client,
- build_directory,
- global_cache_directory,
- local_cache_directory,
- );
+ if (!build_options.omit_pkg_fetching_code) {
+ var http_client: std.http.Client = .{ .allocator = gpa };
+ defer http_client.deinit();
+ try http_client.rescanRootCertificates();
+
+ try main_pkg.fetchAndAddDependencies(
+ &thread_pool,
+ &http_client,
+ build_directory,
+ global_cache_directory,
+ local_cache_directory,
+ );
+ }
const comp = Compilation.create(gpa, .{
.zig_lib_directory = zig_lib_directory,