Skip to content

Commit 1fd2a04

Browse files
authored
fix readlink opts for macOS (#19)
Change-Id: I215cf0f99db6677fd4514facd33e7ea0b5674fed
1 parent b647388 commit 1fd2a04

File tree

6 files changed

+34
-27
lines changed

6 files changed

+34
-27
lines changed

.github/workflows/check.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ on:
1010

1111
jobs:
1212
check-format:
13-
runs-on: ubuntu-latest
1413
strategy:
1514
fail-fast: false
1615
matrix:
16+
os:
17+
- ubuntu-latest
18+
- macos-latest
1719
include:
1820
- example: default
1921
errors: 3
@@ -23,11 +25,12 @@ jobs:
2325
errors: 1
2426
- example: format-ignore
2527
errors: 0
28+
runs-on: ${{ matrix.os }}
2629
steps:
2730
- uses: actions/checkout@v4
2831
- shell: bash
2932
run: |
30-
set -x
33+
set -euxo pipefail
3134
3235
cd example/${{ matrix.example }}
3336
@@ -86,12 +89,16 @@ jobs:
8689
8790
bazel build --config=clang-format-fix
8891
92+
# https://emmer.dev/blog/skippable-github-status-checks-aren-t-really-required/
93+
# https://github.com/marketplace/actions/alls-green
8994
all:
9095
runs-on: ubuntu-latest
91-
if: ${{ github.base_ref == 'main' }}
96+
if: always()
9297
needs:
9398
- check-format
9499
- fix-format
95100
- bazel-version
96101
steps:
97-
- run: true
102+
- uses: re-actors/alls-green@release/v1
103+
with:
104+
jobs: ${{ toJSON(needs) }}

defs.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ set -euo pipefail
2929
# although newer versions of clang-format (e.g. 18.1.4) *do* appear to work
3030
# with symlinks
3131
#
32-
{binary} -style=file:{config} {format_options} $(readlink --canonicalize {infile})
32+
{binary} -style=file:{config} {format_options} $(readlink -f {infile})
3333
3434
touch {outfile}
3535
""".format(

example/format-binary/.bazelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
common --enable_bzlmod=false
22

3-
build:clang-format-base --@bazel_clang_format//:binary=@llvm14//:clang-format
3+
build:clang-format-base --@bazel_clang_format//:binary=@llvm18//:clang-format
44
build:clang-format-base --output_groups=report
55
build:clang-format-base --keep_going
66

example/format-binary/WORKSPACE.bazel

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,30 @@ local_repository(
55

66
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
77

8-
BAZEL_TOOLCHAIN_COMMIT = "66f938c956d247d01997ecfc84725f165ceaf1ed"
8+
TOOLCHAINS_LLVM_COMMIT = "b1a6c86b42ee2373574d0e6862d9d9d5405c3146"
99

1010
http_archive(
11-
name = "com_grail_bazel_toolchain",
12-
integrity = "sha256-Gf4ow1hoJKbokzIAiGXv9PskwCR63o9ryKN+CLsaemw=",
11+
name = "toolchains_llvm",
12+
integrity = "sha256-hdEfwQEvZaPD/gp6A9iDSIxxKOBYrn+ttFYjAHfFby8=",
1313
strip_prefix = "bazel-toolchain-{commit}".format(
14-
commit = BAZEL_TOOLCHAIN_COMMIT,
14+
commit = TOOLCHAINS_LLVM_COMMIT,
1515
),
1616
url = "https://github.com/oliverlee/bazel-toolchain/archive/{commit}.tar.gz".format(
17-
commit = BAZEL_TOOLCHAIN_COMMIT,
17+
commit = TOOLCHAINS_LLVM_COMMIT,
1818
),
1919
)
2020

21-
load("@com_grail_bazel_toolchain//toolchain:deps.bzl", "bazel_toolchain_dependencies")
21+
load("@toolchains_llvm//toolchain:deps.bzl", "bazel_toolchain_dependencies")
2222

2323
bazel_toolchain_dependencies()
2424

25-
load("@com_grail_bazel_toolchain//toolchain:rules.bzl", "llvm_toolchain")
25+
load("@toolchains_llvm//toolchain:rules.bzl", "llvm_toolchain")
2626

2727
llvm_toolchain(
28-
name = "llvm14",
29-
llvm_version = "14.0.0",
28+
name = "llvm18",
29+
llvm_version = "18.1.8",
3030
)
3131

32-
load("@llvm14//:toolchains.bzl", "llvm_register_toolchains")
32+
load("@llvm18//:toolchains.bzl", "llvm_register_toolchains")
3333

3434
llvm_register_toolchains()

example/format-ignore/.bazelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
common --enable_bzlmod=false
22

3-
build:clang-format-base --@bazel_clang_format//:binary=@llvm14//:clang-format
3+
build:clang-format-base --@bazel_clang_format//:binary=@llvm18//:clang-format
44
build:clang-format-base --@bazel_clang_format//:ignore=//:clang-format-ignore
55
build:clang-format-base --output_groups=report
66
build:clang-format-base --keep_going

example/format-ignore/WORKSPACE.bazel

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,30 @@ local_repository(
55

66
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
77

8-
BAZEL_TOOLCHAIN_COMMIT = "66f938c956d247d01997ecfc84725f165ceaf1ed"
8+
TOOLCHAINS_LLVM_COMMIT = "b1a6c86b42ee2373574d0e6862d9d9d5405c3146"
99

1010
http_archive(
11-
name = "com_grail_bazel_toolchain",
12-
integrity = "sha256-Gf4ow1hoJKbokzIAiGXv9PskwCR63o9ryKN+CLsaemw=",
11+
name = "toolchains_llvm",
12+
integrity = "sha256-hdEfwQEvZaPD/gp6A9iDSIxxKOBYrn+ttFYjAHfFby8=",
1313
strip_prefix = "bazel-toolchain-{commit}".format(
14-
commit = BAZEL_TOOLCHAIN_COMMIT,
14+
commit = TOOLCHAINS_LLVM_COMMIT,
1515
),
1616
url = "https://github.com/oliverlee/bazel-toolchain/archive/{commit}.tar.gz".format(
17-
commit = BAZEL_TOOLCHAIN_COMMIT,
17+
commit = TOOLCHAINS_LLVM_COMMIT,
1818
),
1919
)
2020

21-
load("@com_grail_bazel_toolchain//toolchain:deps.bzl", "bazel_toolchain_dependencies")
21+
load("@toolchains_llvm//toolchain:deps.bzl", "bazel_toolchain_dependencies")
2222

2323
bazel_toolchain_dependencies()
2424

25-
load("@com_grail_bazel_toolchain//toolchain:rules.bzl", "llvm_toolchain")
25+
load("@toolchains_llvm//toolchain:rules.bzl", "llvm_toolchain")
2626

2727
llvm_toolchain(
28-
name = "llvm14",
29-
llvm_version = "14.0.0",
28+
name = "llvm18",
29+
llvm_version = "18.1.8",
3030
)
3131

32-
load("@llvm14//:toolchains.bzl", "llvm_register_toolchains")
32+
load("@llvm18//:toolchains.bzl", "llvm_register_toolchains")
3333

3434
llvm_register_toolchains()

0 commit comments

Comments
 (0)