Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,18 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest] # TODO[AH] Support MacOS: [ubuntu-latest, macos-latest]
os: [ubuntu-latest, macos-latest]
bazelversion: ${{ fromJSON(needs.matrix-prep-bazelversion.outputs.bazelversions) }}
folder:
- "."
- "e2e/workspace"
target: ["//..."]
include:
- os: ubuntu-latest # TODO[AH] Support MacOS: macos-latest
- os: ubuntu-latest
bazelversion: ${{ fromJSON(needs.matrix-prep-bazelversion.outputs.bazelversions)[0] }}
folder: "."
target: "//zig/tests/integration_tests"
- os: macos-latest
bazelversion: ${{ fromJSON(needs.matrix-prep-bazelversion.outputs.bazelversions)[0] }}
folder: "."
target: "//zig/tests/integration_tests"
Expand Down
8 changes: 7 additions & 1 deletion zig/private/toolchains_repo.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,18 @@ with only the toolchain attribute pointing into the platform-specific repositori
# Add more platforms as needed to mirror all the binaries
# published by the upstream project.
PLATFORMS = {
"x86_64-linux": struct(
"linux-x86_64": struct(
compatible_with = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
],
),
"macos-x86_64": struct(
compatible_with = [
"@platforms//os:macos",
"@platforms//cpu:x86_64",
],
),
}

def _toolchains_repo_impl(repository_ctx):
Expand Down
5 changes: 4 additions & 1 deletion zig/private/versions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ TODO[AH]: generate this file from https://ziglang.org/download/index.json"""

# The integrity hashes can be computed with
# shasum -b -a 384 [downloaded file] | awk '{ print $1 }' | xxd -r -p | base64
# Or using the sha256 hashes from ziglang.org converted with Python:
# "sha256-" + base64.b64encode(bytes.fromhex("SHA256")).decode()
TOOL_VERSIONS = {
"0.10.1": {
"x86_64-linux": "sha256-Zpnw5ykwgbQkKPMsnZyYOFQJS9Ff7lSJ8SxM9FGMw4A=",
"linux-x86_64": "sha256-Zpnw5ykwgbQkKPMsnZyYOFQJS9Ff7lSJ8SxM9FGMw4A=",
"macos-x86_64": "sha256-Akg1ULidKjBwwu0AM1f9bmowWXB7juP7wMZ/g8qJhDc=",
},
}
12 changes: 9 additions & 3 deletions zig/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,18 @@ _ATTRS = {

def _zig_repo_impl(repository_ctx):
# TODO[AH] read URLs from https://ziglang.org/download/index.json
url = "https://ziglang.org/download/0.10.1/zig-linux-x86_64-0.10.1.tar.xz"
strip_prefix = "zig-linux-x86_64-0.10.1"
basename = "zig-{}-{}".format(
repository_ctx.attr.platform,
repository_ctx.attr.zig_version,
)
url = "https://ziglang.org/download/{}/{}.tar.xz".format(
repository_ctx.attr.zig_version,
basename,
)
repository_ctx.download_and_extract(
url = url,
integrity = TOOL_VERSIONS[repository_ctx.attr.zig_version][repository_ctx.attr.platform],
stripPrefix = strip_prefix,
stripPrefix = basename,
)

# TODO[AH] compiler and lib files
Expand Down