Skip to content

Commit 4800058

Browse files
committed
[build] 04-05-25 Build maintenance
- Compile using Xcode 16 (LLVM 19) on macOS - Clean up comments based on no longer using Dawn - Build simdutf using SSE4.2 to avoid having to include fallback code path, reducing code size. We already require SSE4.2 for zlib, so this won't break compatibility with any systems. - Clean up redundant Bazel arguments - Minor Bazel/include cleanup based on IWYU
1 parent 6830984 commit 4800058

File tree

14 files changed

+30
-33
lines changed

14 files changed

+30
-33
lines changed

.bazelrc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -241,14 +241,6 @@ build:macos --macos_minimum_os=13.5
241241
# information on the flag.
242242
build:macos --copt='-femit-dwarf-unwind=no-compact-unwind'
243243

244-
# Bazel doesn't allow setting flags only for a specific build mode like fastbuild, but somehow has
245-
# a flag that does this for ObjC to set "-O0 -DDEBUG=1". Worse yet, options set by this flag cannot
246-
# be overwritten on the command line, which confusingly makes enabling optimization there not have
247-
# an effect. On macOS we build some ObjC as part of Dawn, set this flag to an empty string so we
248-
# can set the right configuration flags.
249-
# TODO(soon): File a bazel issue for the flag so we can drop this.
250-
build:macos --experimental_objc_fastbuild_options=""
251-
252244
# Cross-Compilation
253245
# Only cross-compiling on macOS from Apple Silicon to x86_64 is supported – using apple_support
254246
# makes this much easier than on other platforms. We could define a configuration for cross-

.github/workflows/_bazel.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ jobs:
6969
git config --show-scope --show-origin core.symlinks
7070
git config --system core.longpaths true
7171
[System.IO.File]::WriteAllLines((Join-Path -Path $env:USERPROFILE -ChildPath '.bazelrc'), 'startup --output_user_root=\\\\?\\C:\\tmp')
72+
- name: Setup macOS
73+
if: inputs.os_name == 'macOS'
74+
run: |
75+
# Build using Xcode 16.3 (equivalent to Clang 19)
76+
sudo xcode-select -s "/Applications/Xcode_16.3.app"
7277
- name: Configure download mirrors
7378
shell: bash
7479
run: |

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ jobs:
128128
sudo ln -s -f $(brew --prefix lld)/bin/ld64.lld /usr/local/bin/ld64.lld
129129
# Enable lld identical code folding to significantly reduce binary size.
130130
echo "build:macos --config=macos_lld_icf" >> .bazelrc
131+
# Build using Xcode 16.3 (equivalent to Clang 19)
132+
sudo xcode-select -s "/Applications/Xcode_16.3.app"
131133
- name: Setup Windows
132134
if: runner.os == 'Windows'
133135
run: |

build/BUILD.simdutf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ cc_library(
22
name = "simdutf",
33
srcs = ["simdutf.cpp"],
44
hdrs = ["simdutf.h"],
5-
copts = ["-w"],
5+
copts = select({
6+
# Enable SSE4.2 extensions, this reduces code size as the fallback code path for pre-Westmere
7+
# CPUs is no longer needed.
8+
"@platforms//cpu:x86_64": ["-msse4.2"],
9+
"//conditions:default": [],
10+
}) + ["-Wno-unused-function"],
611
visibility = ["//visibility:public"],
712
)

build/deps/build_deps.jsonc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
"file_regex": "^rules_python-.*\\.tar\\.gz$"
2424
},
2525
{
26-
// Needed for objc_library starting with bazel 7, used to build dawn on macOS
26+
// Previously used to allow building dawn on macOS – while the build should succeed with the
27+
// default Linux toolchain configuration from rules_cc apple_support is still more tailored to
28+
// macOS.
2729
"name": "build_bazel_apple_support",
2830
"type": "github_release",
2931
"owner": "bazelbuild",

src/cloudflare/BUILD.bazel

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,12 @@ wd_ts_bundle(
77
internal_modules = glob(
88
[
99
"internal/*.ts",
10-
"internal/*.js",
1110
],
12-
allow_empty = True,
1311
),
1412
modules = glob(
1513
[
1614
"*.ts",
17-
"*.js",
1815
],
19-
allow_empty = True,
2016
),
2117
schema_id = "0xbcc8f57c63814006",
2218
tsconfig_json = "tsconfig.json",

src/rust/dns/BUILD.bazel

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ load("//:build/wd_rust_crate.bzl", "wd_rust_crate")
22

33
wd_rust_crate(
44
name = "dns",
5-
cxx_bridge_deps = [],
65
cxx_bridge_src = "lib.rs",
7-
test_deps = [],
86
visibility = ["//visibility:public"],
97
deps = [
108
"//src/rust/cxx-integration",

src/rust/net/BUILD.bazel

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ load("//:build/wd_rust_crate.bzl", "wd_rust_crate")
22

33
wd_rust_crate(
44
name = "net",
5-
cxx_bridge_deps = [],
65
cxx_bridge_src = "lib.rs",
7-
test_deps = [],
86
visibility = ["//visibility:public"],
97
deps = [
108
"//src/rust/cxx-integration",

src/workerd/api/node/BUILD.bazel

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,26 @@ wd_cc_library(
99
"crypto.c++",
1010
"crypto-keys.c++",
1111
"diagnostics-channel.c++",
12-
"dns.c++",
1312
"timers.c++",
13+
"util.c++",
1414
"zlib-util.c++",
1515
],
1616
hdrs = [
1717
"crypto.h",
1818
"diagnostics-channel.h",
19-
"dns.h",
2019
"node.h",
2120
"timers.h",
21+
"util.h",
2222
"zlib-util.h",
2323
],
2424
implementation_deps = [
25-
"//src/rust/cxx-integration",
26-
"//src/rust/dns",
27-
"//src/workerd/io",
2825
"@capnp-cpp//src/kj/compat:kj-gzip",
2926
],
3027
visibility = ["//visibility:public"],
3128
deps = [
3229
":node-core",
3330
"//src/node",
31+
"//src/workerd/io",
3432
"@capnp-cpp//src/kj/compat:kj-brotli",
3533
"@ncrypto",
3634
],
@@ -42,30 +40,32 @@ wd_cc_library(
4240
srcs = [
4341
"async-hooks.c++",
4442
"buffer.c++",
43+
"dns.c++",
4544
"i18n.c++",
4645
"module.c++",
4746
"url.c++",
48-
"util.c++",
4947
],
5048
hdrs = [
5149
"async-hooks.h",
5250
"buffer.h",
5351
"buffer-string-search.h",
52+
"dns.h",
5453
"i18n.h",
5554
"module.h",
5655
"url.h",
57-
"util.h",
5856
],
5957
implementation_deps = [
58+
"//src/rust/cxx-integration",
59+
"//src/rust/dns",
60+
"//src/rust/net",
6061
"@ada-url",
6162
"@nbytes",
6263
"@simdutf",
6364
],
6465
visibility = ["//visibility:public"],
6566
deps = [
66-
"//src/rust/cxx-integration",
67-
"//src/rust/net",
68-
"//src/workerd/io",
67+
# Do not add the io target here – this target is intended for code that does not depend on
68+
# it, move files to the main node target if needed.
6969
"//src/workerd/io:compatibility-date_capnp",
7070
"//src/workerd/jsg",
7171
"//src/workerd/util:mimetype",

src/workerd/api/node/module.c++

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// https://opensource.org/licenses/Apache-2.0
44
#include "module.h"
55

6-
#include <workerd/io/features.h>
76
#include <workerd/jsg/url.h>
87

98
namespace workerd::api::node {

0 commit comments

Comments
 (0)