diff options
author | 2021-12-17 16:59:49 -0800 | |
---|---|---|
committer | 2021-12-17 16:59:49 -0800 | |
commit | 0e39174c481adeeb000fe021fa49616906fd9cd8 (patch) | |
tree | 43a4f585ad9f30aa235a35a1a5bc0cd3fbf3e081 | |
parent | 40401a6ed2b303ff2932486c6c79c1cbe658586a (diff) | |
download | bun-0e39174c481adeeb000fe021fa49616906fd9cd8.tar.gz bun-0e39174c481adeeb000fe021fa49616906fd9cd8.tar.zst bun-0e39174c481adeeb000fe021fa49616906fd9cd8.zip |
Update the misctools bins
-rw-r--r-- | Makefile | 56 | ||||
-rw-r--r-- | misctools/fetch.zig | 10 | ||||
m--------- | src/deps/boringssl | 0 | ||||
-rw-r--r-- | src/fallback.version | 2 | ||||
-rw-r--r-- | src/hop/hop.zig | 1 | ||||
-rw-r--r-- | src/runtime.version | 2 |
6 files changed, 40 insertions, 31 deletions
@@ -53,10 +53,8 @@ LIBICONV_PATH ?= $(BREW_PREFIX_PATH)/opt/libiconv/lib/libiconv.a OPENSSL_LINUX_DIR = $(DEPS_DIR)/openssl/openssl-OpenSSL_1_1_1l -LIBCRYPTO_PREFIX_DIR = $(BREW_PREFIX_PATH)/opt/openssl@1.1 ifeq ($(OS_NAME),linux) -LIBCRYPTO_STATIC_LIB = LIBICONV_PATH = $(DEPS_DIR)/libiconv.a endif @@ -238,10 +236,24 @@ libarchive: cp ./.libs/libarchive.a $(DEPS_DIR)/libarchive.a; tgz: - $(ZIG) build-exe -Drelease-fast --main-pkg-path $(shell pwd) ./misctools/tgz.zig $(DEPS_DIR)/zlib/libz.a $(DEPS_DIR)/libarchive.a $(LIBICONV_PATH) -lc + $(ZIG) build tgz-obj -Drelease-fast + $(CXX) $(PACKAGE_DIR)/tgz.o -g -o ./misctools/tgz $(DEFAULT_LINKER_FLAGS) -lc \ + src/deps/zlib/libz.a \ + src/deps/libarchive.a \ + src/deps/libssl.a \ + src/deps/libcrypto.boring.a \ + src/deps/picohttpparser.o + rm -rf $(PACKAGE_DIR)/tgz.o tgz-debug: - $(ZIG) build-exe --main-pkg-path $(shell pwd) ./misctools/tgz.zig $(DEPS_DIR)/zlib/libz.a $(DEPS_DIR)/libarchive.a $(LIBICONV_PATH) -lc + $(ZIG) build tgz-obj + $(CXX) $(DEBUG_PACKAGE_DIR)/tgz.o -g -o ./misctools/tgz $(DEFAULT_LINKER_FLAGS) -lc \ + src/deps/zlib/libz.a \ + src/deps/libarchive.a \ + src/deps/libssl.a \ + src/deps/libcrypto.boring.a \ + src/deps/picohttpparser.o + rm -rf $(DEBUG_PACKAGE_DIR)/tgz.o vendor: require init-submodules vendor-without-check @@ -257,7 +269,6 @@ require: @which glibtoolize > /dev/null || (echo -e "ERROR: libtool is required. Install on mac with:\n\n brew install libtool"; exit 1) @which ninja > /dev/null || (echo -e "ERROR: Ninja is required. Install on mac with:\n\n brew install ninja"; exit 1) @stat $(LIBICONV_PATH) >/dev/null 2>&1 || (echo -e "ERROR: libiconv is required. Please run:\n\n brew install libiconv"; exit 1) - @stat $(LIBCRYPTO_STATIC_LIB) >/dev/null 2>&1 || (echo -e "ERROR: OpenSSL 1.1 is required. Please run:\n\n brew install openssl@1.1"; exit 1) @echo "You have the dependencies installed! Woo" init-submodules: @@ -311,25 +322,24 @@ generate-install-script: @esbuild --log-level=error --define:BUN_VERSION="\"$(PACKAGE_JSON_VERSION)\"" --define:process.env.NODE_ENV="\"production\"" --platform=node --format=cjs $(PACKAGES_REALPATH)/bun/install.ts > $(PACKAGES_REALPATH)/bun/install.js fetch: - cd misctools; $(ZIG) build-obj -Drelease-fast ./fetch.zig -fcompiler-rt -lc --main-pkg-path ../ $(BORINGSSL_PACKAGE) --pkg-begin io ../$(IO_FILE) --pkg-end - $(CXX) ./misctools/fetch.o -g -O3 -o ./misctools/fetch $(DEFAULT_LINKER_FLAGS) -lc \ - src/deps/mimalloc/libmimalloc.a \ + $(ZIG) build -Drelease-fast fetch-obj + $(CXX) $(PACKAGE_DIR)/fetch.o -g -O3 -o ./misctools/fetch $(DEFAULT_LINKER_FLAGS) -lc \ src/deps/zlib/libz.a \ src/deps/libarchive.a \ - src/deps/libcrypto.boring.a \ src/deps/libssl.a \ + src/deps/libcrypto.boring.a \ src/deps/picohttpparser.o - + rm -rf $(PACKAGE_DIR)/fetch.o + fetch-debug: - cd misctools; $(ZIG) build-obj ./fetch.zig -fcompiler-rt -lc --main-pkg-path ../ $(BORINGSSL_PACKAGE) --pkg-begin io ../$(IO_FILE) --pkg-end - $(CXX) ./misctools/fetch.o -g -o ./misctools/fetch $(DEFAULT_LINKER_FLAGS) -lc \ - src/deps/mimalloc/libmimalloc.a \ + $(ZIG) build fetch-obj + $(CXX) $(DEBUG_PACKAGE_DIR)/fetch.o -g -O3 -o ./misctools/fetch $(DEFAULT_LINKER_FLAGS) -lc \ src/deps/zlib/libz.a \ src/deps/libarchive.a \ - src/deps/libcrypto.boring.a \ src/deps/libssl.a \ + src/deps/libcrypto.boring.a \ src/deps/picohttpparser.o - + rm -rf $(DEBUG_PACKAGE_DIR)/fetch.o httpbench-debug: @@ -340,26 +350,25 @@ httpbench-debug: src/deps/libssl.a \ src/deps/libcrypto.boring.a \ src/deps/picohttpparser.o \ - $(LIBCRYPTO_STATIC_LIB) + rm -rf $(DEBUG_PACKAGE_DIR)/httpbench.o httpbench-release: - cd misctools; $(ZIG) build-obj -Drelease-fast ./http_bench.zig -fcompiler-rt -lc --main-pkg-path ../ --pkg-begin io ../$(IO_FILE) --pkg-end $(BORINGSSL_PACKAGE) - $(CXX) ./misctools/http_bench.o -O3 -g -o ./misctools/http_bench $(DEFAULT_LINKER_FLAGS) -lc \ - src/deps/mimalloc/libmimalloc.a \ + $(ZIG) build -Drelease-fast httpbench-obj + $(CXX) $(PACKAGE_DIR)/httpbench.o -g -O3 -o ./misctools/http_bench $(DEFAULT_LINKER_FLAGS) -lc \ src/deps/zlib/libz.a \ src/deps/libarchive.a \ src/deps/libssl.a \ src/deps/libcrypto.boring.a \ - src/deps/picohttpparser.o \ - $(LIBCRYPTO_STATIC_LIB) + src/deps/picohttpparser.o + rm -rf $(PACKAGE_DIR)/httpbench.o bun-codesign-debug: bun-codesign-release-local: ifeq ($(OS_NAME),darwin) -s2n: s2n-mac + # Hardened runtime will not work with debugging @@ -575,7 +584,7 @@ clean: clean-bindings rm src/deps/*.a src/deps/*.o (cd src/deps/mimalloc && make clean) || echo ""; (cd src/deps/libarchive && make clean) || echo ""; - (cd src/deps/s2n-tls && make clean) || echo ""; + (cd src/deps/boringssl && make clean) || echo ""; (cd src/deps/picohttp && make clean) || echo ""; (cd src/deps/zlib && make clean) || echo ""; @@ -744,7 +753,6 @@ build-unit: -lc -lc++ \ --cache-dir /tmp/zig-cache-bun-$(testname)-$(basename $(lastword $(testfilter))) \ -fallow-shlib-undefined \ - -L$(LIBCRYPTO_PREFIX_DIR)/lib \ $(ARCHIVE_FILES) $(ICU_FLAGS) && \ cp zig-out/bin/$(testname) $(testbinpath) diff --git a/misctools/fetch.zig b/misctools/fetch.zig index ac78f745c..776ac3950 100644 --- a/misctools/fetch.zig +++ b/misctools/fetch.zig @@ -2,15 +2,14 @@ const std = @import("std"); usingnamespace @import("../src/global.zig"); const clap = @import("../src/deps/zig-clap/clap.zig"); -const HTTPClient = @import("../src/http/http_client_async.zig"); const URL = @import("../src/query_string_map.zig").URL; const Headers = @import("../src/javascript/jsc/webcore/response.zig").Headers; const Method = @import("../src/http/method.zig").Method; const ColonListType = @import("../src/cli/colon_list_type.zig").ColonListType; const HeadersTuple = ColonListType(string, noop_resolver); const path_handler = @import("../src/resolver/resolve_path.zig"); -const NetworkThread = @import("../src/http/network_thread.zig"); -const HTTP = @import("../src/http/http_client_async.zig"); +const NetworkThread = @import("network_thread"); +const HTTP = @import("http"); fn noop_resolver(in: string) !string { return in; } @@ -195,9 +194,12 @@ pub fn main() anyerror!void { ), }; ctx.http.callback = HTTP.HTTPChannelContext.callback; - ctx.http.schedule(default_allocator); + var batch = NetworkThread.Batch{}; + ctx.http.schedule(default_allocator, &batch); ctx.http.client.verbose = args.verbose; + ctx.http.verbose = args.verbose; + NetworkThread.global.pool.schedule(batch); while (true) { while (channel.tryReadItem() catch null) |http| { diff --git a/src/deps/boringssl b/src/deps/boringssl -Subproject 4f1fae3043f22d3a2a0c7fcd7d0244cd91b60bd +Subproject b3ed071ecc4efb77afd0a025ea1078da19578bf diff --git a/src/fallback.version b/src/fallback.version index 74aeaab27..23bd52db7 100644 --- a/src/fallback.version +++ b/src/fallback.version @@ -1 +1 @@ -2bbe5942da63d2ba
\ No newline at end of file +796022f759787f0a
\ No newline at end of file diff --git a/src/hop/hop.zig b/src/hop/hop.zig index 0c5439d1d..7d257c3d7 100644 --- a/src/hop/hop.zig +++ b/src/hop/hop.zig @@ -5,7 +5,6 @@ const Hop = Schema.Hop; const string = []const u8; - pub fn cmpStringsAsc(ctx: void, a: string, b: string) bool { return std.mem.order(u8, a, b) == .lt; } diff --git a/src/runtime.version b/src/runtime.version index ac5eaa983..1bb8f5e5f 100644 --- a/src/runtime.version +++ b/src/runtime.version @@ -1 +1 @@ -6634fea9dc3eb4e6
\ No newline at end of file +e43302007fc3716f
\ No newline at end of file |