Skip to content

Commit 7314c02

Browse files
committed
Merge branch 'master' into prism
2 parents cd74d16 + 70e3533 commit 7314c02

File tree

206 files changed

+4270
-1036
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+4270
-1036
lines changed

.bazelrc

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ build:dbg-linux --config=dbg --platforms=@//tools/platforms:linux_x86_64
9191
build:release-common --define release=true
9292
build:release-common --compilation_mode=opt
9393
build:release-common --config=backtracesymbols
94-
build:release-common --config=static-libs
9594
build:release-common --config=versioned
9695

9796
build:release-debug-common --config=forcedebug
@@ -111,9 +110,11 @@ build:untyped-blame --copt=-DTRACK_UNTYPED_BLAME_MODE
111110
# harden: mark relocation sections read-only
112111
build:release-linux --linkopt=-Wl,-z,relro,-z,now
113112
build:release-linux --config=lto-linux --config=release-common
113+
build:release-linux --config=static-libs
114114
# Separate config for aarch64, so x86_64 can be differently optimized
115115
build:release-linux-aarch64 --linkopt=-Wl,-z,relro,-z,now
116116
build:release-linux-aarch64 --config=lto-linux --config=release-common
117+
build:release-linux-aarch64 --config=static-libs
117118

118119
# It would be nice to move this back to release-common, but there is a build
119120
# failure when using clang 15 on macOS to build GNU make via rules_foreign_cc:
@@ -136,7 +137,15 @@ build:release-linux --copt=-march=sandybridge
136137
build:release-sanitized-linux --copt=-march=sandybridge
137138
build:release-linux-aarch64 --copt=-march=armv8.1a
138139

139-
build:release-mac --config=release-common --platforms=@//tools/platforms:darwin_x86_64
140+
build:release-mac --config=release-common --config=shared-libs
141+
142+
build:cross-to-darwin-x86_64 --platforms=@//tools/platforms:darwin_x86_64
143+
build:cross-to-darwin-x86_64 --extra_toolchains=@llvm_toolchain_15_0_7//:cc-toolchain-x86_64-darwin
144+
build:cross-to-darwin-x86_64 --copt=-stdlib=libc++ --linkopt=-lc++
145+
146+
build:cross-to-darwin-arm64 --platforms=@//tools/platforms:darwin_arm64
147+
build:cross-to-darwin-arm64 --extra_toolchains=@llvm_toolchain_15_0_7//:cc-toolchain-aarch64-darwin
148+
build:cross-to-darwin-arm64 --copt=-stdlib=libc++ --linkopt=-lc++
140149

141150
build:release-debug-linux --config=release-linux
142151
build:release-debug-linux --config=release-debug-common
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
c2b5f82dcc1561d25bc05c734a7cc7a5ff58d4e69185f3d6d21b51ddb53b488b
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
455589bbaedf26e7bdb949288f777492ba1c53d67fd8329bfe066fb988df0e5c
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
5afe973cadc036496cac66f1414ca9be36881423f576db363d83afc9084c0c2f
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
c0161a346b9c0d00e6eb3d3e8f9c4dece32f6292520248c5ab2e3527265601c1

.buildkite/build-static-release.sh

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,27 @@ echo will run with $CONFIG_OPTS
3030

3131
./bazel build //main:sorbet --strip=always $CONFIG_OPTS
3232

33+
if [ "$kernel_name" != "darwin" ]; then
34+
cp bazel-bin/main/sorbet sorbet_bin
35+
else
36+
cp bazel-bin/main/sorbet "sorbet.$platform"
37+
38+
# TODO(jez) building on arm64 is not tested (no arm64 mac buildkite instances)
39+
case "$processor_name" in
40+
x86_64) cross_target=darwin-arm64 ;;
41+
arm64) cross_target=darwin-x86_64 ;;
42+
esac
43+
44+
./bazel build //main:sorbet --strip=always "$CONFIG_OPTS" --config="cross-to-$cross_target"
45+
cp bazel-bin/main/sorbet "sorbet.$cross_target"
46+
47+
# TODO(jez) We might be able to replace this with `apple_universal_binary`?
48+
# https://github.com/bazelbuild/rules_apple/blob/35a2fb854a47745deb035d3443008aa15a2c2b85/doc/rules-apple.md#apple_universal_binary
49+
lipo -create -output sorbet_bin sorbet.darwin-*
50+
fi
51+
3352
mkdir gems/sorbet-static/libexec/
34-
cp bazel-bin/main/sorbet gems/sorbet-static/libexec/
53+
cp sorbet_bin gems/sorbet-static/libexec/sorbet
3554

3655
rbenv install --skip-existing
3756

@@ -110,5 +129,15 @@ if [[ "$platform" == "linux-x86_64" ]]; then
110129
mv gems/sorbet/sorbet*.gem _out_/gems/
111130
fi
112131

113-
mkdir -p _out_/$platform
114-
cp bazel-bin/main/sorbet _out_/$platform/
132+
if [ "$kernel_name" = "darwin" ]; then
133+
mkdir -p _out_/darwin-universal
134+
mv sorbet_bin _out_/darwin-universal/sorbet
135+
136+
for plat in {darwin-x86_64,darwin-arm64}; do
137+
mkdir -p "_out_/$plat"
138+
mv "sorbet.$plat" "_out_/$plat/sorbet"
139+
done
140+
else
141+
mkdir -p "_out_/$platform"
142+
mv sorbet_bin "_out_/$platform/sorbet"
143+
fi

.buildkite/pipeline.yaml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ steps:
77

88
# Basic Phase - Run super fast things and things that commonly catch bugs
99
- label: ":linux: linters.sh"
10-
command: .buildkite/linters.sh
10+
command: '.buildkite/linters.sh < /dev/null'
1111
<<: &elastic
1212
agents:
1313
os: linux
@@ -29,7 +29,7 @@ steps:
2929
- "/usr/local/var/bazelcache:/usr/local/var/bazelcache"
3030

3131
- label: ":mac: test-static-sanitized.sh (master only)"
32-
command: .buildkite/test-static-sanitized.sh
32+
command: '.buildkite/test-static-sanitized.sh < /dev/null'
3333
branches: "master"
3434
artifact_paths: _out_/profile.json
3535
agents:
@@ -40,35 +40,35 @@ steps:
4040
automatic: true
4141

4242
- label: ":linux: test-static-sanitized.sh"
43-
command: .buildkite/test-static-sanitized.sh
43+
command: '.buildkite/test-static-sanitized.sh < /dev/null'
4444
artifact_paths: _out_/profile.json
4545
<<: *elastic
4646

4747
- label: ":linux: test-rbi-gen.sh"
48-
command: .buildkite/test-rbi-gen.sh
48+
command: '.buildkite/test-rbi-gen.sh < /dev/null'
4949
artifact_paths:
5050
- _out_/profile.json
5151
<<: *elastic
5252

5353
- label: ":linux: test-vscode-extension.sh"
54-
command: '.buildkite/test-vscode-extension.sh'
54+
command: '.buildkite/test-vscode-extension.sh < /dev/null'
5555
<<: *elastic
5656

5757
- wait: ~
5858

5959
# Build Phase - Build all our artifacts
6060
- label: ":linux: build-website.sh"
61-
command: .buildkite/build-website.sh
61+
command: '.buildkite/build-website.sh < /dev/null'
6262
artifact_paths: _out_/**/*
6363
<<: *elastic
6464

6565
- label: ":linux: build-sorbet-runtime.sh"
66-
command: .buildkite/build-sorbet-runtime.sh
66+
command: '.buildkite/build-sorbet-runtime.sh < /dev/null'
6767
artifact_paths: _out_/**/*
6868
<<: *elastic
6969

7070
- label: ":mac: build-static-release.sh (master only)"
71-
command: .buildkite/build-static-release.sh
71+
command: '.buildkite/build-static-release.sh < /dev/null'
7272
branches: master
7373
artifact_paths: _out_/**/*
7474
agents:
@@ -79,37 +79,37 @@ steps:
7979
automatic: true
8080

8181
- label: ":linux: build-static-release.sh"
82-
command: .buildkite/build-static-release.sh
82+
command: '.buildkite/build-static-release.sh < /dev/null'
8383
artifact_paths: _out_/**/*
8484
<<: *elastic
8585

8686
- label: ":linux: (arm64) build-static-release.sh"
87-
command: .buildkite/build-static-release.sh
87+
command: '.buildkite/build-static-release.sh < /dev/null'
8888
artifact_paths: _out_/**/*
8989
<<: *elastic
9090
agents:
9191
os: linux
9292
queue: elastic-arm64
9393

9494
- label: ":linux: build-sorbet-static-and-runtime.sh"
95-
command: .buildkite/build-sorbet-static-and-runtime.sh
95+
command: '.buildkite/build-sorbet-static-and-runtime.sh < /dev/null'
9696
artifact_paths: _out_/**/*
9797
<<: *elastic
9898

9999
- label: ":linux: build-emscripten.sh"
100-
command: .buildkite/build-emscripten.sh
100+
command: '.buildkite/build-emscripten.sh < /dev/null'
101101
artifact_paths: _out_/**/*
102102
<<: *elastic
103103

104104
- label: ":linux: build-vscode-extension.sh"
105-
command: .buildkite/build-vscode-extension.sh
105+
command: '.buildkite/build-vscode-extension.sh < /dev/null'
106106
artifact_paths: _out_/**/*
107107
<<: *elastic
108108

109109
- wait: ~
110110

111111
- label: ":linux: build-static-release-java.sh (master only)"
112-
command: .buildkite/build-static-release-java.sh
112+
command: '.buildkite/build-static-release-java.sh < /dev/null'
113113
# this needs to be run when both linux & mac build-static-release
114114
# are done. at the moment, mac is only done on master branch
115115
branches: master
@@ -120,17 +120,17 @@ steps:
120120

121121
# Deploy Phase - Send the artifacts to the world
122122
- label: ":linux: publish.sh"
123-
command: .buildkite/publish.sh
123+
command: '.buildkite/publish.sh'
124124
agents:
125125
os: linux
126126
- wait: ~
127127

128128
# Success Phase - Allow the PR to be merged
129129
- label: "All tests and builds succeeded"
130-
command: .buildkite/all-succeeded.sh
130+
command: '.buildkite/all-succeeded.sh'
131131

132132
- label: ":linux: publish-ruby-gems.sh (non-blocking)"
133-
command: .buildkite/publish-ruby-gems.sh
133+
command: '.buildkite/publish-ruby-gems.sh < /dev/null'
134134
artifact_paths: _out_/corrupt/**/*
135135
<<: *elastic
136136

WORKSPACE

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ llvm_toolchain(
4242
"https://github.com/sorbet/llvm-project/releases/download/llvmorg-{llvm_version}/{basename}",
4343
],
4444
llvm_version = "15.0.7",
45+
# The sysroots are needed for cross-compiling
46+
sysroot = {
47+
"": "",
48+
"darwin-x86_64": "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk",
49+
"darwin-aarch64": "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk",
50+
},
4551
)
4652

4753
load("@llvm_toolchain_15_0_7//:toolchains.bzl", "llvm_register_toolchains")
@@ -104,13 +110,3 @@ bazel_skylib_workspace()
104110
load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies")
105111

106112
aspect_bazel_lib_dependencies()
107-
108-
BAZEL_INSTALLER_VERSION_LINUX_X86_64_SHA = "c0161a346b9c0d00e6eb3d3e8f9c4dece32f6292520248c5ab2e3527265601c1"
109-
110-
# Bazel for linux-arm64 doesn't have an installer at the moment.
111-
# We have a workaround in `./bazel` to download the binary directly.
112-
BAZEL_INSTALLER_VERSION_LINUX_ARM64_SHA = "5afe973cadc036496cac66f1414ca9be36881423f576db363d83afc9084c0c2f"
113-
114-
BAZEL_INSTALLER_VERSION_DARWIN_X86_64_SHA = "455589bbaedf26e7bdb949288f777492ba1c53d67fd8329bfe066fb988df0e5c"
115-
116-
BAZEL_INSTALLER_VERSION_DARWIN_ARM64_SHA = "c2b5f82dcc1561d25bc05c734a7cc7a5ff58d4e69185f3d6d21b51ddb53b488b"

0 commit comments

Comments
 (0)