Skip to content

Commit 6b995d4

Browse files
committed
Ensure that dmlab2d can still build wheels
- Pin version numbers in WORKSPACE to July 2023 versions (the time the wheels were built). - Fix bazel-version to 7.4.1 to avoid migrating to MODULE.bzl - stop supporting deprecated macos-12 - support new macos-14 (amd64)
1 parent 0947443 commit 6b995d4

File tree

4 files changed

+69
-45
lines changed

4 files changed

+69
-45
lines changed

.github/workflows/make_wheel.yml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,33 +32,37 @@ jobs:
3232
prerelease: false
3333

3434
build-wheel:
35-
name: Build-wheel ${{ matrix.cfg.name }} for Python ${{ matrix.py.version }}
35+
name: Build-wheel ${{ matrix.cfg.name }} for Python ${{ matrix.python-version }}
3636

3737
runs-on: ${{ matrix.cfg.os }}
3838

3939
needs: create-release
4040

4141
strategy:
42+
fail-fast: false
4243
matrix:
4344
cfg:
4445
- { name: 'ManyLinux 2.35 LLVM+libstdc++', os: 'ubuntu-22.04', cc: clang, cxx: clang++, config: --linkopt=-fuse-ld=lld }
4546
- { name: 'ManyLinux 2.31 LLVM+libstdc++', os: 'ubuntu-20.04', cc: clang, cxx: clang++, config: --linkopt=-fuse-ld=lld }
46-
- { name: 'MacOS 11 x86_64 LLVM+libc++', os: 'macos-11', cc: clang, cxx: clang++, config: --config=libc++ --config=macos }
47-
- { name: 'MacOS 12 x86_64 LLVM+libc++', os: 'macos-12', cc: clang, cxx: clang++, config: --config=libc++ --config=macos }
4847
- { name: 'MacOS 13 x86_64 LLVM+libc++', os: 'macos-13', cc: clang, cxx: clang++, config: --config=libc++ --config=macos }
49-
- { name: 'MacOS 12 ARM64 LLVM+libc++', os: 'macos-12', cc: clang, cxx: clang++,
50-
config: --config=libc++ --config=macos_arm64 --repo_env=PY_PLATFORM_OVERRIDE=macosx_12_0_arm64 }
5148
- { name: 'MacOS 13 ARM64 LLVM+libc++', os: 'macos-13', cc: clang, cxx: clang++,
5249
config: --config=libc++ --config=macos_arm64 --repo_env=PY_PLATFORM_OVERRIDE=macosx_13_0_arm64 }
50+
- { name: 'MacOS 14 ARM64 LLVM+libc++', os: 'macos-14', cc: clang, cxx: clang++,
51+
config: --config=libc++ --config=macos_arm64 --repo_env=PY_PLATFORM_OVERRIDE=macosx_14_0_arm64 }
5352
python-version:
5453
- '3.8'
5554
- '3.9'
5655
- '3.10'
5756
- '3.11'
57+
- '3.12'
58+
- '3.13'
59+
bazel-version:
60+
- '7.4.1'
5861

5962
env:
6063
CC: ${{ matrix.cfg.cc }}
6164
CXX: ${{ matrix.cfg.cxx }}
65+
USE_BAZEL_VERSION: ${{ matrix.bazel-version }}
6266
WHEEL_NAME: ''
6367

6468
steps:
@@ -69,7 +73,12 @@ jobs:
6973
python-version: ${{ matrix.python-version }}
7074

7175
- name: Install Python Dependencies
72-
run: pip3 install --upgrade pip packaging check-wheel-contents
76+
run: |
77+
pip3 install --upgrade setuptools packaging
78+
which python3
79+
python3 --version
80+
pip3 list
81+
bazel --version
7382
7483
- name: Build for Python ${{ matrix.python-version }}
7584
run: bazel --bazelrc=.bazelrc build --compilation_mode=opt --dynamic_mode=off --config=luajit ${{ matrix.cfg.config }} //dmlab2d:dmlab2d_wheel
@@ -81,10 +90,12 @@ jobs:
8190
echo WHEEL_NAME="${WHEEL_NAME}" >> "${GITHUB_ENV}"
8291
8392
- name: Check wheel contents
84-
run: check-wheel-contents bazel-bin/dmlab2d/${{ env.WHEEL_NAME }}
93+
run: |
94+
pip3 install check-wheel-contents
95+
check-wheel-contents bazel-bin/dmlab2d/${{ env.WHEEL_NAME }}
8596
86-
- name: Test wheel
87-
if: (!contains(env.WHEEL_NAME, 'arm64'))
97+
- name: Test wheel ${{ env.WHEEL_NAME }}
98+
if: matrix.cfg.os != 'macos-13' && matrix.cfg.config != 'macos_arm64'
8899
run: |
89100
pip install bazel-bin/dmlab2d/${{ env.WHEEL_NAME }}
90101
python -I - <<'____HERE'

.github/workflows/precommit.yml

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,69 +16,82 @@ concurrency:
1616

1717
jobs:
1818
build-and-test:
19-
name: Build+test ${{ matrix.name }}
19+
name: Build+test ${{ matrix.cfg.name }}
2020

21-
runs-on: ${{ matrix.os }}
21+
runs-on: ${{ matrix.cfg.os }}
2222

2323
timeout-minutes: 30
2424

2525
strategy:
26-
fail-fast: ${{ github.event_name != 'workflow_dispatch' }}
26+
fail-fast: false
2727
matrix:
28-
include:
28+
cfg:
2929
- { name: 'Linux GCC', os: 'ubuntu-22.04', cc: gcc-12, cxx: g++-12, config: }
3030
- { name: 'Linux LLVM+libstdc++', os: 'ubuntu-22.04', cc: clang, cxx: clang++, config: --linkopt=-fuse-ld=lld }
3131
- { name: 'Linux LLVM+libc++', os: 'ubuntu-22.04', cc: clang, cxx: clang++, config: --config=libc++ --linkopt=-fuse-ld=lld }
32-
- { name: 'MacOS 12 x86_64 LLVM+libc++', os: 'macos-12', cc: clang, cxx: clang++, config: --config=libc++ --config=macos }
3332
- { name: 'MacOS 13 x86_64 LLVM+libc++', os: 'macos-13', cc: clang, cxx: clang++, config: --config=libc++ --config=macos }
34-
- { name: 'MacOS 12 ARM64 LLVM+libc++', os: 'macos-12', cc: clang, cxx: clang++, config: --config=libc++ --config=macos_arm64 }
3533
- { name: 'MacOS 13 ARM64 LLVM+libc++', os: 'macos-13', cc: clang, cxx: clang++, config: --config=libc++ --config=macos_arm64 }
34+
- { name: 'MacOS 14 ARM64 LLVM+libc++', os: 'macos-14', cc: clang, cxx: clang++, config: --config=libc++ --config=macos_arm64 }
35+
bazel-version:
36+
- '7.4.1'
37+
python-version:
38+
- '3.10'
3639

3740
env:
38-
CC: ${{ matrix.cc }}
39-
CXX: ${{ matrix.cxx }}
41+
CC: ${{ matrix.cfg.cc }}
42+
CXX: ${{ matrix.cfg.cxx }}
43+
USE_BAZEL_VERSION: ${{ matrix.bazel-version }}
4044

4145
steps:
4246
- uses: actions/checkout@v3
4347

4448
- name: install infrastructure (Linux)
45-
if: matrix.os == 'ubuntu-22.04'
49+
if: startsWith( matrix.cfg.os, 'ubuntu-' )
4650
run: |
47-
sudo apt-get install python3-dev python3-numpy python3-packaging
4851
sudo ln -s /usr/lib/llvm-10/include/c++/v1 /usr/include/c++/v1
4952
50-
- name: install infrastructure (MacOS)
51-
if: matrix.os == 'macos-12' || matrix.os == 'macos-13'
52-
run: sudo -H pip3 install numpy packaging
53+
- name: Set up Python ${{ matrix.python-version }}
54+
id: setup-python
55+
uses: actions/setup-python@v3
56+
with:
57+
python-version: ${{ matrix.python-version }}
58+
59+
- name: Install Python dependencies
60+
run: |
61+
pip3 install numpy packaging
62+
which python3
63+
python3 --version
64+
pip3 list
65+
bazel --version
5366
5467
- name: build-lua5.1
5568
run: |
5669
bazel --bazelrc=.bazelrc build --config=lua5_1 ${{ matrix.config }} //...
5770
- name: test-lua5.1
58-
if: (!contains(matrix.config, 'arm64'))
71+
if: matrix.cfg.os != 'macos-13' && matrix.cfg.config != 'macos_arm64'
5972
run: |
6073
bazel --bazelrc=.bazelrc test --config=lua5_1 ${{ matrix.config }} --test_output=errors //...
6174
6275
- name: build-lua5.2
6376
run: |
6477
bazel --bazelrc=.bazelrc build --config=lua5_2 ${{ matrix.config }} //...
6578
- name: test-lua5.2
66-
if: (!contains(matrix.config, 'arm64'))
79+
if: matrix.cfg.os != 'macos-13' && matrix.cfg.config != 'macos_arm64'
6780
run: |
6881
bazel --bazelrc=.bazelrc test --config=lua5_2 ${{ matrix.config }} --test_output=errors //...
6982
7083
- name: build-luajit
7184
run: |
7285
bazel --bazelrc=.bazelrc build --config=luajit ${{ matrix.config }} //...
7386
- name: test-luajit
74-
if: (!contains(matrix.config, 'arm64'))
87+
if: matrix.cfg.os != 'macos-13' && matrix.cfg.config != 'macos_arm64'
7588
run: |
7689
bazel --bazelrc=.bazelrc test --config=luajit ${{ matrix.config }} --test_output=errors //...
7790
7891
- name: build-luajit-internal_unwind
7992
run: |
8093
bazel --bazelrc=.bazelrc build --config=luajit ${{ matrix.config }} --copt=-fno-asynchronous-unwind-tables --luajit_external_unwinder=False //...
8194
- name: test-luajit-internal_unwind
82-
if: (!contains(matrix.config, 'arm64'))
95+
if: matrix.cfg.os != 'macos-13' && matrix.cfg.config != 'macos_arm64'
8396
run: |
8497
bazel --bazelrc=.bazelrc test --config=luajit ${{ matrix.config }} --copt=-fno-asynchronous-unwind-tables --luajit_external_unwinder=False --test_output=errors //...

WORKSPACE

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,44 +5,44 @@ load("@//:python_system.bzl", "python_repo")
55

66
http_archive(
77
name = "com_google_googletest",
8-
strip_prefix = "googletest-main",
9-
urls = ["https://github.com/google/googletest/archive/main.zip"],
8+
strip_prefix = "googletest-1.13.0",
9+
urls = ["https://github.com/google/googletest/archive/refs/tags/v1.13.0.zip"],
1010
)
1111

1212
http_archive(
1313
name = "com_google_benchmark",
14-
strip_prefix = "benchmark-main",
15-
urls = ["https://github.com/google/benchmark/archive/main.zip"],
14+
strip_prefix = "benchmark-1.8.2",
15+
urls = ["https://github.com/google/benchmark/archive/refs/tags/v1.8.2.zip"],
1616
)
1717

1818
http_archive(
1919
name = "rules_cc",
20-
strip_prefix = "rules_cc-main",
21-
urls = ["https://github.com/bazelbuild/rules_cc/archive/main.zip"],
20+
strip_prefix = "rules_cc-0.0.8",
21+
urls = ["https://github.com/bazelbuild/rules_cc/archive/refs/tags/0.0.8.zip"],
2222
)
2323

2424
http_archive(
2525
name = "rules_python",
26-
strip_prefix = "rules_python-main",
27-
url = "https://github.com/bazelbuild/rules_python/archive/main.zip",
26+
strip_prefix = "rules_python-0.24.0",
27+
url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/0.24.0.zip",
2828
)
2929

3030
http_archive(
3131
name = "bazel_skylib",
32-
strip_prefix = "bazel-skylib-main",
33-
urls = ["https://github.com/bazelbuild/bazel-skylib/archive/main.zip"],
32+
strip_prefix = "bazel-skylib-1.4.2",
33+
urls = ["https://github.com/bazelbuild/bazel-skylib/archive/refs/tags/1.4.2.zip"],
3434
)
3535

3636
http_archive(
3737
name = "com_google_absl",
38-
strip_prefix = "abseil-cpp-master",
39-
urls = ["https://github.com/abseil/abseil-cpp/archive/master.zip"],
38+
strip_prefix = "abseil-cpp-20230125.3",
39+
urls = ["https://github.com/abseil/abseil-cpp/archive/refs/tags/20230125.3.zip"],
4040
)
4141

4242
http_archive(
4343
name = "com_google_absl_py",
44-
strip_prefix = "abseil-py-main",
45-
urls = ["https://github.com/abseil/abseil-py/archive/main.zip"],
44+
strip_prefix = "abseil-py-1.4.0",
45+
urls = ["https://github.com/abseil/abseil-py/archive/refs/tags/v1.4.0.zip"],
4646
)
4747

4848
http_archive(
@@ -118,15 +118,15 @@ http_archive(
118118
http_archive(
119119
name = "tree_archive",
120120
build_file = "@//bazel:tree.BUILD",
121-
strip_prefix = "tree-master",
122-
urls = ["https://github.com/deepmind/tree/archive/master.zip"],
121+
strip_prefix = "tree-0.1.8",
122+
urls = ["https://github.com/google-deepmind/tree/archive/refs/tags/0.1.8.zip"],
123123
)
124124

125125
http_archive(
126126
name = "pybind11_archive",
127127
build_file = "@//bazel:pybind11.BUILD",
128-
strip_prefix = "pybind11-master",
129-
urls = ["https://github.com/pybind/pybind11/archive/master.zip"],
128+
strip_prefix = "pybind11-2.11.1",
129+
urls = ["https://github.com/pybind/pybind11/archive/refs/tags/v2.11.1.zip"],
130130
)
131131

132132
http_archive(

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function install_dmlab2d() {
8181
exit 1
8282
;;
8383
esac
84-
C=clang CXX=clang++ bazel --bazelrc=.bazelrc build \
84+
USE_BAZEL_VERSION=7.4.1 C=clang CXX=clang++ bazel --bazelrc=.bazelrc build \
8585
--compilation_mode=opt \
8686
--dynamic_mode=off \
8787
--config=luajit \

0 commit comments

Comments
 (0)