diff --git a/.bazelrc b/.bazelrc index 60ea03462e3..dd8ff17070a 100644 --- a/.bazelrc +++ b/.bazelrc @@ -241,14 +241,6 @@ build:macos --macos_minimum_os=13.5 # information on the flag. build:macos --copt='-femit-dwarf-unwind=no-compact-unwind' -# Bazel doesn't allow setting flags only for a specific build mode like fastbuild, but somehow has -# a flag that does this for ObjC to set "-O0 -DDEBUG=1". Worse yet, options set by this flag cannot -# be overwritten on the command line, which confusingly makes enabling optimization there not have -# an effect. On macOS we build some ObjC as part of Dawn, set this flag to an empty string so we -# can set the right configuration flags. -# TODO(soon): File a bazel issue for the flag so we can drop this. -build:macos --experimental_objc_fastbuild_options="" - # Cross-Compilation # Only cross-compiling on macOS from Apple Silicon to x86_64 is supported – using apple_support # makes this much easier than on other platforms. We could define a configuration for cross- diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5930df4b5a9..b36fa5757a7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -124,6 +124,7 @@ jobs: run: | # Install lld and link it to /usr/local/bin. We overwrite any existing link, which may # exist from an older pre-installed LLVM version on the runner image. + brew update brew install lld sudo ln -s -f $(brew --prefix lld)/bin/ld64.lld /usr/local/bin/ld64.lld # Enable lld identical code folding to significantly reduce binary size. diff --git a/build/BUILD.simdutf b/build/BUILD.simdutf index 0241f06ee02..3901a291c4f 100644 --- a/build/BUILD.simdutf +++ b/build/BUILD.simdutf @@ -2,6 +2,11 @@ cc_library( name = "simdutf", srcs = ["simdutf.cpp"], hdrs = ["simdutf.h"], - copts = ["-w"], + copts = select({ + # Enable SSE4.2 extensions, this reduces code size as the fallback code path for pre-Westmere + # CPUs is no longer needed. + "@platforms//cpu:x86_64": ["-msse4.2"], + "//conditions:default": [], + }) + ["-Wno-unused-function"], visibility = ["//visibility:public"], ) diff --git a/build/deps/build_deps.jsonc b/build/deps/build_deps.jsonc index bfb839012dd..e6755ed80cf 100644 --- a/build/deps/build_deps.jsonc +++ b/build/deps/build_deps.jsonc @@ -23,7 +23,9 @@ "file_regex": "^rules_python-.*\\.tar\\.gz$" }, { - // Needed for objc_library starting with bazel 7, used to build dawn on macOS + // Previously used to allow building dawn on macOS – while the build should succeed with the + // default Linux toolchain configuration from rules_cc apple_support is still more tailored to + // macOS. "name": "build_bazel_apple_support", "type": "github_release", "owner": "bazelbuild", diff --git a/src/cloudflare/BUILD.bazel b/src/cloudflare/BUILD.bazel index 26fcf2a314a..138cc12cc2f 100644 --- a/src/cloudflare/BUILD.bazel +++ b/src/cloudflare/BUILD.bazel @@ -7,16 +7,12 @@ wd_ts_bundle( internal_modules = glob( [ "internal/*.ts", - "internal/*.js", ], - allow_empty = True, ), modules = glob( [ "*.ts", - "*.js", ], - allow_empty = True, ), schema_id = "0xbcc8f57c63814006", tsconfig_json = "tsconfig.json", diff --git a/src/rust/dns/BUILD.bazel b/src/rust/dns/BUILD.bazel index 0489a4814a6..427568b21e3 100644 --- a/src/rust/dns/BUILD.bazel +++ b/src/rust/dns/BUILD.bazel @@ -2,9 +2,7 @@ load("//:build/wd_rust_crate.bzl", "wd_rust_crate") wd_rust_crate( name = "dns", - cxx_bridge_deps = [], cxx_bridge_src = "lib.rs", - test_deps = [], visibility = ["//visibility:public"], deps = [ "//src/rust/cxx-integration", diff --git a/src/rust/net/BUILD.bazel b/src/rust/net/BUILD.bazel index 6af5eb38dcb..e41d5277d21 100644 --- a/src/rust/net/BUILD.bazel +++ b/src/rust/net/BUILD.bazel @@ -2,9 +2,7 @@ load("//:build/wd_rust_crate.bzl", "wd_rust_crate") wd_rust_crate( name = "net", - cxx_bridge_deps = [], cxx_bridge_src = "lib.rs", - test_deps = [], visibility = ["//visibility:public"], deps = [ "//src/rust/cxx-integration", diff --git a/src/workerd/api/node/BUILD.bazel b/src/workerd/api/node/BUILD.bazel index ab1d829b2ad..02cd7a4ae98 100644 --- a/src/workerd/api/node/BUILD.bazel +++ b/src/workerd/api/node/BUILD.bazel @@ -9,28 +9,26 @@ wd_cc_library( "crypto.c++", "crypto-keys.c++", "diagnostics-channel.c++", - "dns.c++", "timers.c++", + "util.c++", "zlib-util.c++", ], hdrs = [ "crypto.h", "diagnostics-channel.h", - "dns.h", "node.h", "timers.h", + "util.h", "zlib-util.h", ], implementation_deps = [ - "//src/rust/cxx-integration", - "//src/rust/dns", - "//src/workerd/io", "@capnp-cpp//src/kj/compat:kj-gzip", ], visibility = ["//visibility:public"], deps = [ ":node-core", "//src/node", + "//src/workerd/io", "@capnp-cpp//src/kj/compat:kj-brotli", "@ncrypto", ], @@ -42,30 +40,32 @@ wd_cc_library( srcs = [ "async-hooks.c++", "buffer.c++", + "dns.c++", "i18n.c++", "module.c++", "url.c++", - "util.c++", ], hdrs = [ "async-hooks.h", "buffer.h", "buffer-string-search.h", + "dns.h", "i18n.h", "module.h", "url.h", - "util.h", ], implementation_deps = [ + "//src/rust/cxx-integration", + "//src/rust/dns", + "//src/rust/net", "@ada-url", "@nbytes", "@simdutf", ], visibility = ["//visibility:public"], deps = [ - "//src/rust/cxx-integration", - "//src/rust/net", - "//src/workerd/io", + # Do not add the io target here – this target is intended for code that does not depend on + # it, move files to the main node target if needed. "//src/workerd/io:compatibility-date_capnp", "//src/workerd/jsg", "//src/workerd/util:mimetype", diff --git a/src/workerd/api/node/module.c++ b/src/workerd/api/node/module.c++ index dfedc885162..efb4f158249 100644 --- a/src/workerd/api/node/module.c++ +++ b/src/workerd/api/node/module.c++ @@ -3,7 +3,6 @@ // https://opensource.org/licenses/Apache-2.0 #include "module.h" -#include #include namespace workerd::api::node { diff --git a/src/workerd/api/node/node.h b/src/workerd/api/node/node.h index 66500b8341e..d3338bbddba 100644 --- a/src/workerd/api/node/node.h +++ b/src/workerd/api/node/node.h @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/workerd/util/BUILD.bazel b/src/workerd/util/BUILD.bazel index 39a4200acf1..a0bc74bcf98 100644 --- a/src/workerd/util/BUILD.bazel +++ b/src/workerd/util/BUILD.bazel @@ -136,12 +136,12 @@ wd_cc_library( "sqlite-metadata.h", ], implementation_deps = [ + "//src/workerd/jsg:exception", "@sqlite3", ], visibility = ["//visibility:public"], deps = [ ":sentry", - "//src/workerd/jsg:exception", "@capnp-cpp//src/kj:kj-async", ], ) diff --git a/src/workerd/util/sqlite-kv.c++ b/src/workerd/util/sqlite-kv.c++ index 5ce80b53986..8bb552a0372 100644 --- a/src/workerd/util/sqlite-kv.c++ +++ b/src/workerd/util/sqlite-kv.c++ @@ -4,6 +4,8 @@ #include "sqlite-kv.h" +#include + #include namespace workerd { diff --git a/src/workerd/util/sqlite-kv.h b/src/workerd/util/sqlite-kv.h index 697d00489d6..4cbd30c13cd 100644 --- a/src/workerd/util/sqlite-kv.h +++ b/src/workerd/util/sqlite-kv.h @@ -6,8 +6,6 @@ #include "sqlite.h" -#include - namespace workerd { // Small class which is used to customize certain aspects of the underlying sql operations