Skip to content
Open
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
6 changes: 0 additions & 6 deletions .github/install_cibuildwheel_deps.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
#!/usr/bin/env bash

# Install clang and lld (container only has gcc by default)
# Pin to clang 20 — some HEIR deps don't yet support clang 21+
# (cf. https://github.com/google/heir/issues/2675).
CLANG_VERSION=20
yum install -y "clang-${CLANG_VERSION}*" "lld-${CLANG_VERSION}*"

# Install bazel
if ! bazel version; then
arch=$(uname -m)
Expand Down
23 changes: 0 additions & 23 deletions .github/install_clang_version.sh

This file was deleted.

20 changes: 6 additions & 14 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,21 @@ jobs:
- name: Check out repository code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

- name: Install dependencies
run: |
./.github/install_clang_version.sh 19

- name: Cache bazel build artifacts
uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2
with:
path: |
~/.cache/bazel
key: ${{ runner.os }}-clang19-${{ hashFiles('.bazelversion', '.bazelrc', 'MODULE.bazel') }}-${{ hashFiles('bazel/extensions.bzl') }}
key: ${{ runner.os }}-${{ hashFiles('.bazelversion', '.bazelrc', 'MODULE.bazel') }}-${{ hashFiles('bazel/extensions.bzl') }}
restore-keys: |
${{ runner.os }}-clang19-${{ hashFiles('.bazelversion', '.bazelrc', 'MODULE.bazel') }}-${{ hashFiles('bazel/extensions.bzl') }}
${{ runner.os }}-clang19-${{ hashFiles('.bazelversion', '.bazelrc', 'MODULE.bazel') }}-
${{ runner.os }}-${{ hashFiles('.bazelversion', '.bazelrc', 'MODULE.bazel') }}-${{ hashFiles('bazel/extensions.bzl') }}
${{ runner.os }}-${{ hashFiles('.bazelversion', '.bazelrc', 'MODULE.bazel') }}-

- name: Confirm bazel is using the right C compiler
run: |
# Pure debugging bazel stuff: ensure the compiler installed is the
# one used by bazel. Note that the path to the C compiler is part of
# the cache, so if the compiler changes but the cache does not, it
# will try to use the old compiler path.
which -a clang | xargs ls -al
ls -al /etc/alternatives/clang
bazel cquery --output=starlark --starlark:expr="str(providers(target))" @bazel_tools//tools/cpp:current_cc_toolchain | sed 's/,/\n/g' | grep -C 5 clang
# Pure debugging bazel stuff: the compiler used should come from the
# hermetic clang toolchain managed by bazel.
bazel cquery --output=starlark --starlark:expr="str(providers(target))" @rules_cc//cc:current_cc_toolchain | sed 's/,/\n/g' | grep -C 5 clang

- name: "Run `bazel build`"
run: |
Expand Down
17 changes: 3 additions & 14 deletions .github/workflows/build_and_test_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,10 @@ jobs:
with:
path: |
~/.cache/bazel
key: ${{ runner.os }}-clang19-${{ hashFiles('.bazelversion', '.bazelrc', 'MODULE.bazel') }}-${{ hashFiles('bazel/extensions.bzl') }}
key: ${{ runner.os }}-${{ hashFiles('.bazelversion', '.bazelrc', 'MODULE.bazel') }}-${{ hashFiles('bazel/extensions.bzl') }}
restore-keys: |
${{ runner.os }}-clang19-${{ hashFiles('.bazelversion', '.bazelrc', 'MODULE.bazel') }}-${{ hashFiles('bazel/extensions.bzl') }}
${{ runner.os }}-clang19-${{ hashFiles('.bazelversion', '.bazelrc', 'MODULE.bazel') }}-

- name: Install rust
run: brew install rust

- name: Install OpenMP
run: brew install libomp

- name: Set OpenMP environment variables
run: |
echo "LDFLAGS=-L$(brew --prefix libomp)/lib" >> "$GITHUB_ENV"
echo "CPPFLAGS=-I$(brew --prefix libomp)/include" >> "$GITHUB_ENV"
${{ runner.os }}-${{ hashFiles('.bazelversion', '.bazelrc', 'MODULE.bazel') }}-${{ hashFiles('bazel/extensions.bzl') }}
${{ runner.os }}-${{ hashFiles('.bazelversion', '.bazelrc', 'MODULE.bazel') }}-

- name: Bazel debug info
run: |
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/build_options_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ jobs:
- name: Check out repository code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

- name: Install dependencies
run: |
./.github/install_clang_version.sh 19

- name: "Run `bazel build`"
run: |
bazel build --incompatible_strict_action_env -c ${{ matrix.compilation_mode }} \
Expand Down
32 changes: 0 additions & 32 deletions .github/workflows/clang_matrix.yml

This file was deleted.

9 changes: 0 additions & 9 deletions .github/workflows/docker-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,6 @@ jobs:
--tag heir:dev-ci \
.

- name: Smoke test clang availability
run: |
docker run \
--rm \
--platform linux/amd64 \
--user heiruser \
heir:dev-ci \
bash -lc 'clang --version'

- name: Build and test with Bazel inside container
run: |
docker run \
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,15 @@ jobs:
with:
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod

- name: Install dependencies
run: |
./.github/install_clang_version.sh 19

- name: Cache bazel build artifacts
uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2
with:
path: |
~/.cache/bazel
key: ${{ runner.os }}-clang19-${{ hashFiles('.bazelversion', '.bazelrc', 'MODULE.bazel') }}-${{ hashFiles('bazel/extensions.bzl') }}
key: ${{ runner.os }}-${{ hashFiles('.bazelversion', '.bazelrc', 'MODULE.bazel') }}-${{ hashFiles('bazel/extensions.bzl') }}
restore-keys: |
${{ runner.os }}-clang19-${{ hashFiles('.bazelversion', '.bazelrc', 'MODULE.bazel') }}-${{ hashFiles('bazel/extensions.bzl') }}
${{ runner.os }}-clang19-${{ hashFiles('.bazelversion', '.bazelrc', 'MODULE.bazel') }}-
${{ runner.os }}-${{ hashFiles('.bazelversion', '.bazelrc', 'MODULE.bazel') }}-${{ hashFiles('bazel/extensions.bzl') }}
${{ runner.os }}-${{ hashFiles('.bazelversion', '.bazelrc', 'MODULE.bazel') }}-

# This requires building mlir-tblgen, but may not require a full llvm build
# as a result. It results in the files being added to their respective
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ jobs:
- name: Check out repository code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

- name: Install dependencies
run: |
./.github/install_clang_version.sh 19

- name: "Run `bazel build`"
run: |
bazel build -c opt //tools:all
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ jobs:
id: date
run: echo "date=$(date +'%Y.%m.%d')" >> "$GITHUB_OUTPUT"

- name: Install dependencies
run: |
./.github/install_clang_version.sh 19

- name: "Run `bazel build`"
run: |
bazel build -c opt //tools:all
Expand Down
45 changes: 18 additions & 27 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
module(name = "heir")

bazel_dep(name = "bazel_skylib", version = "1.9.0")
bazel_dep(name = "rules_cc", version = "0.2.18")

# This must come before apple_support cf. https://github.com/bazelbuild/bazel/issues/25728
bazel_dep(name = "rules_cc", version = "0.2.13")
# hermetic LLVM toolchain (for C++ compiler and linker)
bazel_dep(name = "llvm", version = "0.7.8")

# Apple compilation support.
# Note this requires full xcode, not just commandline tools
#
# Tested with:
#
# $ /usr/bin/xcodebuild -version
# Xcode 16.2
# Build version 16C5032a
bazel_dep(name = "apple_support", version = "1.24.1", repo_name = "build_bazel_apple_support")
bazel_dep(name = "rules_apple", version = "3.20.1")
register_toolchains("@llvm//:all")

# Gazelle puglin for BUILD file autogeneration
bazel_dep(name = "gazelle", version = "0.47.0")
Expand All @@ -24,9 +16,9 @@ bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.8.2", dev_dependenc
# provides the `license` rule, which is required because llvm's gentbl_rule
# implicitly depends upon the target '//:license'. How bizarre.
bazel_dep(name = "rules_license", version = "1.0.0")
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "platforms", version = "1.1.0")
bazel_dep(name = "rules_go", version = "0.53.0")
bazel_dep(name = "rules_python", version = "1.5.1")
bazel_dep(name = "rules_python", version = "1.7.0")
bazel_dep(name = "googletest", version = "1.17.0")
bazel_dep(name = "fuzztest", version = "20250805.0")
bazel_dep(name = "google_benchmark", version = "1.9.1")
Expand All @@ -38,22 +30,21 @@ bazel_dep(name = "re2", version = "2025-08-12")
bazel_dep(name = "isl", version = "0.27")
bazel_dep(name = "pocketfft", version = "0.0.2")
bazel_dep(name = "openfhe", version = "1.4.2.bcr.1")
bazel_dep(name = "abc", version = "0.0.0-20250903-yosyshq.bcr.1")
bazel_dep(name = "abc", version = "0.64-yosyshq.bcr.1")
bazel_dep(name = "yosys", version = "0.57.bcr.2")

# Yosys pulls in bison@3.8.2 from BCR, but its hand-rolled config breaks with newer macOS SDK versions.
# Therefore, we pull in this updated BCR version which uses @rules_cc_autoconf instead of the hand-rolled config.
single_version_override(
module_name = "bison",
version = "3.8.2.bcr.2",
)
# yosys deps needing newer versions for bazel compatibility
bazel_dep(name = "bison", version = "3.8.2.bcr.5")
bazel_dep(name = "m4", version = "1.4.21.bcr.1")
bazel_dep(name = "libffi", version = "3.4.7.bcr.4")

# Yosys also pulls in libffi@3.4.7.bcr.3, but that version does not work on aarch64 linux.
# Therefore, we pull in this updated BCR version which specifically adds support for aarch64 linux.
single_version_override(
module_name = "libffi",
version = "3.4.7.bcr.4",
)
# Clang 21 compatibility
# Cf. https://github.com/bazelbuild/bazel-central-registry/pull/7989
bazel_dep(name = "gawk", version = "5.3.2.bcr.7")

# Clang 21 compatibility
# Cf. https://github.com/bazelbuild/bazel-central-registry/pull/7915
bazel_dep(name = "sed", version = "4.9.bcr.5")

# LLVM dependency uses module extensions because none of these are in the BCR
llvm_extensions = use_extension("//bazel:extensions.bzl", "llvm_deps")
Expand Down
Loading