diff --git a/.github/workflows/make_wheel.yml b/.github/workflows/make_wheel.yml index 412365c..4c618b4 100644 --- a/.github/workflows/make_wheel.yml +++ b/.github/workflows/make_wheel.yml @@ -32,7 +32,7 @@ jobs: prerelease: false build-wheel: - name: Build-wheel ${{ matrix.cfg.name }} for Python ${{ matrix.py.version }} + name: Build-wheel ${{ matrix.cfg.name }} for Python ${{ matrix.python-version }} runs-on: ${{ matrix.cfg.os }} @@ -41,20 +41,21 @@ jobs: strategy: matrix: cfg: + # - { name: 'ManyLinux 2.31 LLVM+libstdc++', os: 'ubuntu-20.04', cc: clang, cxx: clang++, config: --linkopt=-fuse-ld=lld } - { name: 'ManyLinux 2.35 LLVM+libstdc++', os: 'ubuntu-22.04', cc: clang, cxx: clang++, config: --linkopt=-fuse-ld=lld } - - { name: 'ManyLinux 2.31 LLVM+libstdc++', os: 'ubuntu-20.04', cc: clang, cxx: clang++, config: --linkopt=-fuse-ld=lld } - - { name: 'MacOS 11 x86_64 LLVM+libc++', os: 'macos-11', cc: clang, cxx: clang++, config: --config=libc++ --config=macos } - - { name: 'MacOS 12 x86_64 LLVM+libc++', os: 'macos-12', cc: clang, cxx: clang++, config: --config=libc++ --config=macos } - - { name: 'MacOS 13 x86_64 LLVM+libc++', os: 'macos-13', cc: clang, cxx: clang++, config: --config=libc++ --config=macos } - - { name: 'MacOS 12 ARM64 LLVM+libc++', os: 'macos-12', cc: clang, cxx: clang++, - config: --config=libc++ --config=macos_arm64 --repo_env=PY_PLATFORM_OVERRIDE=macosx_12_0_arm64 } - - { name: 'MacOS 13 ARM64 LLVM+libc++', os: 'macos-13', cc: clang, cxx: clang++, - config: --config=libc++ --config=macos_arm64 --repo_env=PY_PLATFORM_OVERRIDE=macosx_13_0_arm64 } + # - { name: 'ManyLinux ???? LLVM+libstdc++', os: 'ubuntu-24.04', cc: clang, cxx: clang++, config: --linkopt=-fuse-ld=lld } + # - { name: 'MacOS 13 x86_64 LLVM+libc++', os: 'macos-13', cc: clang, cxx: clang++, config: --config=libc++ --config=macos } + # - { name: 'MacOS 14 x86_64 LLVM+libc++', os: 'macos-14', cc: clang, cxx: clang++, config: --config=libc++ --config=macos } + # - { name: 'MacOS 13 ARM64 LLVM+libc++', os: 'macos-13', cc: clang, cxx: clang++, + # config: --config=libc++ --config=macos_arm64 --repo_env=PY_PLATFORM_OVERRIDE=macosx_13_0_arm64 } + # - { name: 'MacOS 14 ARM64 LLVM+libc++', os: 'macos-14', cc: clang, cxx: clang++, + # config: --config=libc++ --config=macos_arm64 --repo_env=PY_PLATFORM_OVERRIDE=macosx_14_0_arm64 } python-version: - - '3.8' - - '3.9' + # - '3.9' - '3.10' - - '3.11' + # - '3.11' + # - '3.12' + # - '3.13' env: CC: ${{ matrix.cfg.cc }} @@ -69,10 +70,14 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install Python Dependencies - run: pip3 install --upgrade pip packaging check-wheel-contents + run: | + pip3 install --upgrade pip packaging check-wheel-contents setuptools + pip list - name: Build for Python ${{ matrix.python-version }} - run: bazel --bazelrc=.bazelrc build --compilation_mode=opt --dynamic_mode=off --config=luajit ${{ matrix.cfg.config }} //dmlab2d:dmlab2d_wheel + run: | + bazel --version + bazel --bazelrc=.bazelrc build --noenable_bzlmod --compilation_mode=opt --dynamic_mode=off --config=luajit ${{ matrix.cfg.config }} //dmlab2d:dmlab2d_wheel - name: Get built wheel name working-directory: bazel-bin/dmlab2d diff --git a/WORKSPACE b/WORKSPACE index 52749bf..bd73388 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -17,8 +17,9 @@ http_archive( http_archive( name = "rules_cc", - strip_prefix = "rules_cc-main", - urls = ["https://github.com/bazelbuild/rules_cc/archive/main.zip"], + urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.17/rules_cc-0.0.17.tar.gz"], + sha256 = "abc605dd850f813bb37004b77db20106a19311a96b2da1c92b789da529d28fe1", + strip_prefix = "rules_cc-0.0.17", ) http_archive( diff --git a/bazel/eigen.BUILD b/bazel/eigen.BUILD index 8ce28ac..26affb2 100644 --- a/bazel/eigen.BUILD +++ b/bazel/eigen.BUILD @@ -2,6 +2,8 @@ # Eigen is a C++ template library for linear algebra: vectors, # matrices, and related algorithms. +load("@rules_cc//cc:defs.bzl", "cc_library") + licenses([ # Note: Eigen is an MPL2 library that includes GPL v3 and LGPL v2.1+ code. # We've taken special care to not reference any restricted code. diff --git a/bazel/lua5_1.BUILD b/bazel/lua5_1.BUILD index 0b048f2..80aecd4 100644 --- a/bazel/lua5_1.BUILD +++ b/bazel/lua5_1.BUILD @@ -1,6 +1,8 @@ # Description: # Build rule for Lua 5.1. +load("@rules_cc//cc:defs.bzl", "cc_library") + cc_library( name = "lua5_1", srcs = glob( diff --git a/bazel/lua5_2.BUILD b/bazel/lua5_2.BUILD index 79cb11d..814dec3 100644 --- a/bazel/lua5_2.BUILD +++ b/bazel/lua5_2.BUILD @@ -1,6 +1,8 @@ # Description: # Build rule for Lua 5.2. +load("@rules_cc//cc:defs.bzl", "cc_library") + cc_library( name = "lua5_2", srcs = glob( diff --git a/bazel/luajit.BUILD b/bazel/luajit.BUILD index af20a3b..72930a4 100644 --- a/bazel/luajit.BUILD +++ b/bazel/luajit.BUILD @@ -2,6 +2,7 @@ # Build rule for LuaJit. load("@bazel_skylib//rules:common_settings.bzl", "bool_flag", "string_flag") +load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library") string_flag( name = "target_arch", diff --git a/bazel/png.BUILD b/bazel/png.BUILD index 24671d7..c97c2aa 100644 --- a/bazel/png.BUILD +++ b/bazel/png.BUILD @@ -1,6 +1,8 @@ # Description: # libpng is the official PNG reference library. +load("@rules_cc//cc:defs.bzl", "cc_library") + licenses(["notice"]) # BSD/MIT-like license genrule( diff --git a/bazel/pybind11.BUILD b/bazel/pybind11.BUILD index 9f71912..953407e 100644 --- a/bazel/pybind11.BUILD +++ b/bazel/pybind11.BUILD @@ -1,6 +1,8 @@ # Description: # Build rule for pybind11 2.2.4. +load("@rules_cc//cc:defs.bzl", "cc_library") + cc_library( name = "pybind11", hdrs = glob( diff --git a/bazel/tree.BUILD b/bazel/tree.BUILD index 195e3da..7f0d4f0 100644 --- a/bazel/tree.BUILD +++ b/bazel/tree.BUILD @@ -3,6 +3,8 @@ # The tree package used to support Bazel, but no longer does so. # This BUILD file is adapted from the last official version. +load("@rules_cc//cc:defs.bzl", "cc_library") + cc_binary( name = "tree/_tree.so", srcs = [ diff --git a/bazel/zlib.BUILD b/bazel/zlib.BUILD index 4c443df..935d9fa 100644 --- a/bazel/zlib.BUILD +++ b/bazel/zlib.BUILD @@ -1,3 +1,5 @@ +load("@rules_cc//cc:defs.bzl", "cc_library") + package(default_visibility = ["//visibility:public"]) licenses(["notice"]) # BSD/MIT-like license (for zlib) diff --git a/build_defs.bzl b/build_defs.bzl index 0e309b8..beb376a 100644 --- a/build_defs.bzl +++ b/build_defs.bzl @@ -16,6 +16,8 @@ """A BUILD rule for Python extensions that are defined via pybind11.""" load("@bazel_skylib//lib:collections.bzl", "collections") +load("@rules_cc//cc:defs.bzl", "cc_binary") +load("@rules_python//python:defs.bzl", "py_binary", "py_library") def pybind_extension( name, @@ -64,7 +66,7 @@ def pybind_extension( kwargs["visibility"] = visibility shared_lib_name = module_name + ".so" - native.cc_binary( + cc_binary( name = shared_lib_name, deps = collections.uniq(deps + pybind11_deps), copts = collections.uniq(copts + pybind11_copts), @@ -75,7 +77,7 @@ def pybind_extension( **cc_kwargs ) - return native.py_library( + return py_library( name = name, data = data + [module_name + ".so"], tags = tags, @@ -83,7 +85,7 @@ def pybind_extension( ) def pytype_strict_library(name, **kwargs): - native.py_library(name = name, **kwargs) + py_library(name = name, **kwargs) def pytype_strict_binary(name, **kwargs): - native.py_binary(name = name, **kwargs) + py_binary(name = name, **kwargs) diff --git a/python_system.bzl b/python_system.bzl index b3ebbe3..a6c55c4 100644 --- a/python_system.bzl +++ b/python_system.bzl @@ -18,6 +18,7 @@ _BUILD_FILE = '''# Description: # Build rule for Python. +load("@rules_cc//cc:defs.bzl", "cc_library") load("@rules_python//python:defs.bzl", "py_runtime_pair") exports_files(["defs.bzl"])