Skip to content

Commit bf0e5c7

Browse files
committed
chore: release brew bottles and formula from OSS repository (#419)
1 parent 3453896 commit bf0e5c7

37 files changed

+1903
-22
lines changed

.bazelrc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@ build --incompatible_strict_action_env
44

55
test --keep_going
66
test --test_output=errors
7-
test --@io_bazel_rules_go//go/config:race
7+
8+
# Don't try and auto detect the cc toolchain, as we use our own gcc toolchains.
9+
build --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
10+
build --incompatible_strict_action_env=true
11+
build --incompatible_enable_cc_toolchain_resolution

.github/workflows/default.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ jobs:
1313
test:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v3
17+
with:
18+
# Number of commits to fetch. 0 indicates all history for all branches and tags. This is
19+
# needed since if we don't fetch tags then the workspace status command fails to set
20+
# STABLE_BUILD_SCM_TAG which causes the //release/brew/tests:version_file_with_stamp_test
21+
# test to fail as it depends on that stamp value. See https://github.com/actions/checkout.
22+
fetch-depth: 0
1723
- name: Validate changed files
1824
if: github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'allow sdk change')
1925
run: ./.github/workflows/validate_changed_files.sh

BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ npm_link_all_packages(name = "node_modules")
1010
exports_files([
1111
".bazelversion",
1212
"LICENSE",
13+
"README.md",
1314
])
1415

1516
nogo(

CONTRIBUTING.md

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,61 @@ After this, you should be able to merge your changes without any conflicts in th
6868
undesirable complication. For now with CLI major releases as `5.x.x` the corresponding go module
6969
version should be `v1.5xx.x` with the patch version matching and the minor zero-padded to two digits.
7070
(e.g. `5.4.3` -> `v1.504.3`, `5.56.78` -> `v1.556.78`)
71-
72-
When the CLI major version is bumped to 6, this mapping will need to be updated.
71+
72+
When the CLI major version is bumped to 6, this mapping will need to be updated.
7373
7474
```
7575
git tag v1.5xx.x
7676
git push origin $!
7777
```
78+
79+
4. Update Homebrew Formula
80+
81+
Once the GitHub release is complete and Aspect CLI release artifacts are available for download,
82+
follow the [instructions](https://github.com/aspect-build/homebrew-aspect#updating-formulas-to-the-latest-release)
83+
in our [homebrew-aspect](https://github.com/aspect-build/homebrew-aspect) repository to update the
84+
Homebrew Formulas in the `aspect-build/aspect` tap.
85+
86+
## Test Homebrew Formula and Bottles
87+
88+
### Install and Configure `nginx`
89+
90+
Install `nginx`. On MacOS, run `brew install nginx`.
91+
92+
Change the `nginx` config so that it listens on part `8090`. By default, `nginx` will listen on
93+
`localhost:8080`.
94+
95+
- Find the location of your `nginx` config, run `nginx -t`.
96+
- Update the default server stanza to listen on `8090`. It should look like the following:
97+
98+
```
99+
server {
100+
listen 8090;
101+
server_name localhost;
102+
```
103+
104+
- Restart `nginx`. Run `brew services restart nginx`.
105+
106+
### Build, Stage, and Install Aspect CLI with Homebrew
107+
108+
To verify that the built Homebrew formula and bottles build and install properly,
109+
please run the following:
110+
111+
```sh
112+
$ bazel run //release:verify_homebrew_artifacts
113+
```
114+
115+
This will build the artifacts, copy the bottles to your local `nginx` webserver's
116+
serving directory, create an `aspect-build/aspect` tap, copy the formula to the
117+
tap, install the bottle for your system, and verify that the version from the
118+
CLI matches the expected version.
119+
120+
NOTE: This is not a test target, because it will copy files to various locations on your local
121+
machine. The default permissions for a test target do not allow this.
122+
123+
If you would like to perform the set up for this verification step without the assertions, you can
124+
run the following (with or without the `--stamp` flag):
125+
126+
```sh
127+
$ bazel run //release:stage_for_dev
128+
```

WORKSPACE

Lines changed: 92 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,56 @@ http_archive(
3737
],
3838
)
3939

40+
http_archive(
41+
name = "aspect_gcc_toolchain",
42+
sha256 = "3341394b1376fb96a87ac3ca01c582f7f18e7dc5e16e8cf40880a31dd7ac0e1e",
43+
strip_prefix = "gcc-toolchain-0.4.2",
44+
urls = ["https://github.com/aspect-build/gcc-toolchain/archive/refs/tags/0.4.2.tar.gz"],
45+
)
46+
47+
http_archive(
48+
name = "com_grail_bazel_toolchain",
49+
patch_args = ["-p1"],
50+
patches = ["//patches:com_grail_bazel_toolchain.patch"],
51+
sha256 = "b54aa3b00a64a3dea06d30f0ff423e91bcea43019c5ff1c319f726f1666c3ff2",
52+
strip_prefix = "bazel-toolchain-2f6e6adf93f4bf34d7bce7ad797f53c82d998ba8",
53+
urls = ["https://github.com/grailbio/bazel-toolchain/archive/2f6e6adf93f4bf34d7bce7ad797f53c82d998ba8.tar.gz"],
54+
)
55+
56+
_SYSROOT_BUILD_FILE = """
57+
filegroup(
58+
name = "sysroot",
59+
srcs = glob(["*/**"]),
60+
visibility = ["//visibility:public"],
61+
)
62+
"""
63+
64+
http_archive(
65+
name = "org_chromium_sysroot_linux_arm64",
66+
build_file_content = _SYSROOT_BUILD_FILE,
67+
sha256 = "e39b700d8858d18868544c8c84922f6adfa8419f3f42471b92024ba38eff7aca",
68+
urls = ["https://commondatastorage.googleapis.com/chrome-linux-sysroot/toolchain/2202c161310ffde63729f29d27fe7bb24a0bc540/debian_stretch_arm64_sysroot.tar.xz"],
69+
)
70+
71+
http_archive(
72+
name = "org_chromium_sysroot_linux_x86_64",
73+
build_file_content = _SYSROOT_BUILD_FILE,
74+
sha256 = "84656a6df544ecef62169cfe3ab6e41bb4346a62d3ba2a045dc5a0a2ecea94a3",
75+
urls = ["https://commondatastorage.googleapis.com/chrome-linux-sysroot/toolchain/2202c161310ffde63729f29d27fe7bb24a0bc540/debian_stretch_amd64_sysroot.tar.xz"],
76+
)
77+
4078
http_archive(
4179
name = "io_bazel_rules_go",
4280
patch_args = ["-p1"],
4381
patches = ["//patches:rules_go.patch"],
44-
sha256 = "16e9fca53ed6bd4ff4ad76facc9b7b651a89db1689a2877d6fd7b82aa824e366",
45-
urls = ["https://github.com/bazelbuild/rules_go/releases/download/v0.34.0/rules_go-v0.34.0.zip"],
82+
sha256 = "19ef30b21eae581177e0028f6f4b1f54c66467017be33d211ab6fc81da01ea4d",
83+
urls = ["https://github.com/bazelbuild/rules_go/releases/download/v0.38.0/rules_go-v0.38.0.zip"],
84+
)
85+
86+
http_archive(
87+
name = "rules_pkg",
88+
sha256 = "8c20f74bca25d2d442b327ae26768c02cf3c99e93fad0381f32be9aab1967675",
89+
urls = ["https://github.com/bazelbuild/rules_pkg/releases/download/0.8.1/rules_pkg-0.8.1.tar.gz"],
4690
)
4791

4892
load("@io_bazel_rules_go//extras:embed_data_deps.bzl", "go_embed_data_dependencies")
@@ -52,11 +96,7 @@ go_rules_dependencies()
5296

5397
go_embed_data_dependencies()
5498

55-
go_register_toolchains(
56-
# TODO: re-enable no-go once versions are synced with silo
57-
# nogo = "@//:nogo",
58-
version = "1.19.3",
59-
)
99+
go_register_toolchains(version = "1.20.1")
60100

61101
http_archive(
62102
name = "bazel_gazelle",
@@ -127,3 +167,48 @@ bats_dependencies()
127167
load("//integration_tests:bazel_binary.bzl", "bazel_binaries")
128168

129169
bazel_binaries()
170+
171+
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
172+
173+
bazel_skylib_workspace()
174+
175+
load("@com_grail_bazel_toolchain//toolchain:rules.bzl", "llvm_toolchain")
176+
177+
llvm_toolchain(
178+
name = "llvm_toolchain",
179+
llvm_version = "15.0.7",
180+
sha256 = {
181+
"darwin-arm64": "867c6afd41158c132ef05a8f1ddaecf476a26b91c85def8e124414f9a9ba188d",
182+
"darwin-x86_64": "d16b6d536364c5bec6583d12dd7e6cf841b9f508c4430d9ee886726bd9983f1c",
183+
},
184+
strip_prefix = {
185+
"darwin-arm64": "clang+llvm-15.0.7-arm64-apple-darwin22.0",
186+
"darwin-x86_64": "clang+llvm-15.0.7-x86_64-apple-darwin21.0",
187+
},
188+
sysroot = {
189+
"linux-aarch64": "@org_chromium_sysroot_linux_arm64//:sysroot",
190+
"linux-x86_64": "@org_chromium_sysroot_linux_x86_64//:sysroot",
191+
},
192+
urls = {
193+
"darwin-arm64": ["https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.7/clang+llvm-15.0.7-arm64-apple-darwin22.0.tar.xz"],
194+
"darwin-x86_64": ["https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.7/clang+llvm-15.0.7-x86_64-apple-darwin21.0.tar.xz"],
195+
},
196+
)
197+
198+
register_toolchains("//platforms/toolchains:llvm")
199+
200+
load("@aspect_gcc_toolchain//toolchain:repositories.bzl", "gcc_toolchain_dependencies")
201+
202+
gcc_toolchain_dependencies()
203+
204+
load("@aspect_gcc_toolchain//toolchain:defs.bzl", "ARCHS", "gcc_register_toolchain")
205+
206+
gcc_register_toolchain(
207+
name = "gcc_toolchain_aarch64",
208+
target_arch = ARCHS.aarch64,
209+
)
210+
211+
gcc_register_toolchain(
212+
name = "gcc_toolchain_x86_64",
213+
target_arch = ARCHS.x86_64,
214+
)

bazel/analysis/analysis_v2.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bazel/buildeventstream/build_event_stream.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bazel/command_line/command_line.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bazel/failure_details/failure_details.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bazel/flags/flags.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bazel/invocation_policy/invocation_policy.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bazel/options/option_filters.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bazel/query/build.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
diff --git a/toolchain/cc_toolchain_config.bzl b/toolchain/cc_toolchain_config.bzl
2+
index 8785a8e..5e84644 100644
3+
--- a/toolchain/cc_toolchain_config.bzl
4+
+++ b/toolchain/cc_toolchain_config.bzl
5+
@@ -60,6 +60,15 @@ def cc_toolchain_config(
6+
abi_version,
7+
abi_libc_version,
8+
) = {
9+
+ "darwin-arm64": (
10+
+ "clang-arm64-darwin",
11+
+ "arm64-apple-macosx",
12+
+ "darwin",
13+
+ "macosx",
14+
+ "clang",
15+
+ "darwin_arm64",
16+
+ "darwin_arm64",
17+
+ ),
18+
"darwin-x86_64": (
19+
"clang-x86_64-darwin",
20+
"x86_64-apple-macosx",
21+
diff --git a/toolchain/internal/common.bzl b/toolchain/internal/common.bzl
22+
index 7493c64..eefb7d3 100644
23+
--- a/toolchain/internal/common.bzl
24+
+++ b/toolchain/internal/common.bzl
25+
@@ -12,7 +12,12 @@
26+
# See the License for the specific language governing permissions and
27+
# limitations under the License.
28+
29+
-SUPPORTED_TARGETS = [("linux", "x86_64"), ("linux", "aarch64"), ("darwin", "x86_64")]
30+
+SUPPORTED_TARGETS = [
31+
+ ("darwin", "arm64"),
32+
+ ("darwin", "x86_64"),
33+
+ ("linux", "aarch64"),
34+
+ ("linux", "x86_64"),
35+
+]
36+
37+
host_tool_features = struct(
38+
SUPPORTS_ARG_FILE = "supports_arg_file",

pkg/plugin/sdk/v1alpha1/proto/plugin.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/plugin/sdk/v1alpha2/proto/plugin.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/plugin/sdk/v1alpha3/proto/plugin.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)