Skip to content

Commit 6c678b5

Browse files
authored
Merge branch 'main' into rfactor-changes
2 parents 9005621 + 7d7f0b4 commit 6c678b5

214 files changed

Lines changed: 6577 additions & 3732 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.clang-tidy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ Checks: >
7676
-cppcoreguidelines-owning-memory,
7777
-cppcoreguidelines-prefer-member-initializer,
7878
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
79+
-cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,
7980
-cppcoreguidelines-pro-bounds-constant-array-index,
8081
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
8182
-cppcoreguidelines-pro-type-const-cast,

.devcontainer/Dockerfile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
FROM ubuntu:24.04
2+
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
5+
RUN apt-get update && \
6+
ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime && \
7+
apt-get install -y tzdata && \
8+
apt-get install -y \
9+
build-essential \
10+
cmake \
11+
gdb \
12+
git \
13+
gnupg \
14+
libcurl4-openssl-dev \
15+
libedit-dev \
16+
libicu-dev \
17+
libjpeg-dev \
18+
libncurses-dev \
19+
libpng-dev \
20+
lsb-release \
21+
ninja-build \
22+
pkg-config \
23+
python3-dev \
24+
software-properties-common \
25+
wget \
26+
zlib1g-dev && \
27+
wget https://apt.llvm.org/llvm.sh && \
28+
chmod +x llvm.sh && \
29+
./llvm.sh 21 all && \
30+
apt-get install -y liblld-21-dev && \
31+
apt-get clean && \
32+
rm -rf llvm.sh /var/lib/apt/lists/* \

.devcontainer/devcontainer.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Default Ubuntu-based DevContainer Template.
2+
// For more customization options, see https://containers.dev/implementors/json_reference
3+
// Also note this file is "JSON with Comments" (JSONC).
4+
{
5+
"name": "Halide",
6+
"build": {
7+
"dockerfile": "Dockerfile"
8+
},
9+
"runArgs": [
10+
"--userns=keep-id",
11+
"--security-opt",
12+
"label=disable"
13+
],
14+
"customizations": {
15+
"jetbrains": {
16+
"backend": "CLion",
17+
"settings": {
18+
// IDE settings can be added via “Show context actions”|“Add currently modified settings from IDE”.
19+
// A complete list of supported settings is also available through auto-completion
20+
},
21+
"plugins": [
22+
// A set of plugin IDs.
23+
// Plugin ID can be found on the corresponding plugin’s page at https://plugins.jetbrains.com.
24+
]
25+
}
26+
},
27+
"features": {
28+
"ghcr.io/devcontainers/features/git": {},
29+
"ghcr.io/devcontainers/features/common-utils": {
30+
"installZsh": false
31+
}
32+
},
33+
// Comment out to connect as the root user.
34+
"remoteUser": "ubuntu",
35+
"containerUser": "root"
36+
}

.github/workflows/pip.yml

Lines changed: 71 additions & 146 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# Relevant GHA docs links:
2-
# https://docs.github.com/en/actions/using-jobs/running-jobs-in-a-container
3-
# https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#upgrading-a-workflow-that-accesses-ghcrio
4-
51
name: Build PyPI package
62

73
on:
@@ -12,17 +8,16 @@ on:
128

139
env:
1410
# TODO: detect this from repo somehow: https://github.com/halide/Halide/issues/8406
15-
LLVM_VERSION: 21.1.1
11+
LLVM_VERSION: 21.1.8
1612
FLATBUFFERS_VERSION: 23.5.26
17-
WABT_VERSION: 1.0.36
13+
WABT_VERSION: 1.0.39
1814

1915
concurrency:
2016
group: '${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
2117
cancel-in-progress: true
2218

2319
permissions:
2420
contents: read # to fetch code (actions/checkout)
25-
packages: read # to fetch packages (docker)
2621

2722
jobs:
2823
build-wheels:
@@ -37,23 +32,15 @@ jobs:
3732
platform_tag: manylinux_x86_64
3833
- os: windows-latest
3934
platform_tag: win_amd64
40-
- os: macos-13
35+
- os: macos-15-intel
4136
platform_tag: macosx_x86_64
42-
- os: macos-14
37+
- os: macos-15
4338
platform_tag: macosx_arm64
4439

4540
env:
4641
MACOSX_DEPLOYMENT_TARGET: 11
4742

4843
steps:
49-
- name: Login to GitHub Container Registry
50-
if: matrix.os == 'ubuntu-latest'
51-
uses: docker/login-action@v3
52-
with:
53-
registry: ghcr.io
54-
username: ${{ github.actor }}
55-
password: ${{ secrets.GITHUB_TOKEN }}
56-
5744
- uses: actions/checkout@v4
5845
with:
5946
fetch-depth: 0
@@ -62,135 +49,17 @@ jobs:
6249
- uses: ilammy/msvc-dev-cmd@v1
6350
- uses: lukka/get-cmake@v3.28.4
6451

65-
########################################################################
66-
# flatbuffers
67-
########################################################################
68-
69-
- name: Cache flatbuffers build folder
70-
if: matrix.os != 'ubuntu-latest'
71-
id: cache-flatbuffers
72-
uses: actions/cache@v4
73-
with:
74-
path: opt/flatbuffers
75-
key: flatbuffers-${{ env.FLATBUFFERS_VERSION }}-${{ matrix.platform_tag }}
76-
77-
- uses: actions/checkout@v4
78-
if: matrix.os != 'ubuntu-latest' && steps.cache-flatbuffers.outputs.cache-hit != 'true'
79-
with:
80-
path: flatbuffers-src
81-
repository: google/flatbuffers
82-
ref: v${{ env.FLATBUFFERS_VERSION }}
83-
84-
- name: Configure flatbuffers
85-
if: matrix.os != 'ubuntu-latest' && steps.cache-flatbuffers.outputs.cache-hit != 'true'
86-
run: >
87-
cmake -G Ninja -S flatbuffers-src -B flatbuffers-build
88-
"-DCMAKE_BUILD_TYPE=Release"
89-
"-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/opt/flatbuffers"
90-
"-DFLATBUFFERS_BUILD_TESTS=NO"
91-
92-
- name: Install flatbuffers
93-
if: matrix.os != 'ubuntu-latest' && steps.cache-flatbuffers.outputs.cache-hit != 'true'
94-
run: |
95-
cmake --build flatbuffers-build --target install
96-
cmake -E rm -rf flatbuffers-src flatbuffers-build
97-
98-
########################################################################
99-
# wabt
100-
########################################################################
101-
102-
- name: Cache wabt build folder
103-
if: matrix.os != 'ubuntu-latest' && matrix.os != 'windows-latest'
104-
id: cache-wabt
105-
uses: actions/cache@v4
106-
with:
107-
path: opt/wabt
108-
key: wabt-${{ env.WABT_VERSION }}-${{ matrix.platform_tag }}
109-
110-
- uses: actions/checkout@v4
111-
if: >
112-
matrix.os != 'ubuntu-latest' && matrix.os != 'windows-latest'
113-
&& steps.cache-wabt.outputs.cache-hit != 'true'
114-
with:
115-
submodules: 'true'
116-
path: wabt-src
117-
repository: WebAssembly/wabt
118-
ref: ${{ env.WABT_VERSION }}
119-
120-
- name: Configure wabt
121-
if: >
122-
matrix.os != 'ubuntu-latest' && matrix.os != 'windows-latest'
123-
&& steps.cache-wabt.outputs.cache-hit != 'true'
124-
run: >
125-
cmake -G Ninja -S wabt-src -B wabt-build
126-
"-DCMAKE_BUILD_TYPE=Release"
127-
"-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/opt/wabt"
128-
"-DWITH_EXCEPTIONS=ON"
129-
"-DBUILD_TESTS=OFF"
130-
"-DBUILD_TOOLS=OFF"
131-
"-DBUILD_LIBWASM=OFF"
132-
"-DUSE_INTERNAL_SHA256=ON"
133-
134-
- name: Install wabt
135-
if: >
136-
matrix.os != 'ubuntu-latest' && matrix.os != 'windows-latest'
137-
&& steps.cache-wabt.outputs.cache-hit != 'true'
138-
run: |
139-
cmake --build wabt-build --target install
140-
cmake -E rm -rf wabt-src wabt-build
141-
14252
########################################################################
14353
# LLVM
14454
########################################################################
14555

146-
- name: Cache LLVM build folder
147-
if: matrix.os != 'ubuntu-latest'
148-
id: cache-llvm
149-
uses: actions/cache@v4
150-
with:
151-
path: opt/llvm
152-
key: llvm-${{ env.LLVM_VERSION }}-${{ matrix.platform_tag }}
153-
154-
- uses: actions/checkout@v4
155-
if: matrix.os != 'ubuntu-latest' && steps.cache-llvm.outputs.cache-hit != 'true'
156-
with:
157-
path: llvm-src
158-
repository: llvm/llvm-project
159-
ref: llvmorg-${{ env.LLVM_VERSION }}
160-
161-
- name: Configure LLVM
162-
if: matrix.os != 'ubuntu-latest' && steps.cache-llvm.outputs.cache-hit != 'true'
163-
run: >
164-
cmake -G Ninja -S llvm-src/llvm -B llvm-build
165-
"-DCMAKE_BUILD_TYPE=Release"
166-
"-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/opt/llvm"
167-
"-DLLVM_ENABLE_ASSERTIONS=ON"
168-
"-DLLVM_ENABLE_BINDINGS=OFF"
169-
"-DLLVM_ENABLE_CURL=OFF"
170-
"-DLLVM_ENABLE_DIA_SDK=OFF"
171-
"-DLLVM_ENABLE_EH=ON"
172-
"-DLLVM_ENABLE_HTTPLIB=OFF"
173-
"-DLLVM_ENABLE_IDE=OFF"
174-
"-DLLVM_ENABLE_LIBEDIT=OFF"
175-
"-DLLVM_ENABLE_LIBXML2=OFF"
176-
"-DLLVM_ENABLE_OCAMLDOC=OFF"
177-
"-DLLVM_ENABLE_PROJECTS=clang;lld"
178-
"-DLLVM_ENABLE_RTTI=ON"
179-
"-DLLVM_ENABLE_RUNTIMES=compiler-rt"
180-
"-DLLVM_ENABLE_TERMINFO=OFF"
181-
"-DLLVM_ENABLE_WARNINGS=OFF"
182-
"-DLLVM_ENABLE_ZLIB=OFF"
183-
"-DLLVM_ENABLE_ZSTD=OFF"
184-
"-DLLVM_INCLUDE_BENCHMARKS=OFF"
185-
"-DLLVM_INCLUDE_EXAMPLES=OFF"
186-
"-DLLVM_INCLUDE_TESTS=OFF"
187-
"-DLLVM_TARGETS_TO_BUILD=WebAssembly;X86;AArch64;ARM;Hexagon;NVPTX;PowerPC;RISCV"
188-
18956
- name: Install LLVM
190-
if: matrix.os != 'ubuntu-latest' && steps.cache-llvm.outputs.cache-hit != 'true'
57+
if: matrix.os != 'ubuntu-latest'
58+
shell: bash
19159
run: |
192-
cmake --build llvm-build --target install
193-
cmake -E rm -rf llvm-src llvm-build
60+
pip install "halide-llvm==${{ env.LLVM_VERSION }}" \
61+
--extra-index-url https://pypi.halide-lang.org/simple/
62+
echo "Halide_LLVM_ROOT=$(halide-llvm --prefix)" >> "$GITHUB_ENV"
19463
19564
########################################################################
19665
# Wheels
@@ -199,12 +68,66 @@ jobs:
19968
#- uses: mxschmitt/action-tmate@v3
20069

20170
- name: Build wheels
202-
uses: pypa/cibuildwheel@v2.20.0
71+
uses: pypa/cibuildwheel@v3.3.1
20372
env:
20473
CIBW_BUILD: "cp3*-${{ matrix.platform_tag }}"
205-
CIBW_SKIP: "cp3{5,6,7,8}*"
206-
# Suppress the git version tag (necessary for TestPyPI)
207-
CIBW_ENVIRONMENT: >
74+
CIBW_SKIP: "cp3{5,6,7,8,9}* cp314t-*"
75+
CIBW_BEFORE_ALL_LINUX: >
76+
/opt/python/cp312-cp312/bin/pip install cmake ninja
77+
"halide-llvm==${{ env.LLVM_VERSION }}"
78+
--extra-index-url https://pypi.halide-lang.org/simple/ &&
79+
export PATH="/opt/python/cp312-cp312/bin:$PATH" &&
80+
mkdir -p {project}/opt &&
81+
ln -s $(halide-llvm --prefix) {project}/opt/llvm &&
82+
git clone --depth=1 -b v${{ env.FLATBUFFERS_VERSION }}
83+
https://github.com/google/flatbuffers /tmp/fb-src &&
84+
cmake -G Ninja -S /tmp/fb-src -B /tmp/fb-build
85+
-DCMAKE_BUILD_TYPE=Release
86+
-DCMAKE_INSTALL_PREFIX={project}/opt/flatbuffers
87+
-DFLATBUFFERS_BUILD_TESTS=NO &&
88+
cmake --build /tmp/fb-build --target install &&
89+
git clone --depth=1 --recurse-submodules -b ${{ env.WABT_VERSION }}
90+
https://github.com/WebAssembly/wabt /tmp/wabt-src &&
91+
cmake -G Ninja -S /tmp/wabt-src -B /tmp/wabt-build
92+
-DCMAKE_BUILD_TYPE=Release
93+
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
94+
-DCMAKE_INSTALL_PREFIX={project}/opt/wabt
95+
-DWITH_EXCEPTIONS=ON
96+
-DBUILD_TESTS=OFF
97+
-DBUILD_TOOLS=OFF
98+
-DBUILD_LIBWASM=OFF
99+
-DUSE_INTERNAL_SHA256=ON &&
100+
cmake --build /tmp/wabt-build --target install
101+
CIBW_BEFORE_ALL_MACOS: >
102+
git clone --depth=1 -b v${{ env.FLATBUFFERS_VERSION }}
103+
https://github.com/google/flatbuffers /tmp/fb-src &&
104+
cmake -G Ninja -S /tmp/fb-src -B /tmp/fb-build
105+
-DCMAKE_BUILD_TYPE=Release
106+
-DCMAKE_INSTALL_PREFIX={project}/opt/flatbuffers
107+
-DFLATBUFFERS_BUILD_TESTS=NO &&
108+
cmake --build /tmp/fb-build --target install &&
109+
git clone --depth=1 --recurse-submodules -b ${{ env.WABT_VERSION }}
110+
https://github.com/WebAssembly/wabt /tmp/wabt-src &&
111+
cmake -G Ninja -S /tmp/wabt-src -B /tmp/wabt-build
112+
-DCMAKE_BUILD_TYPE=Release
113+
-DCMAKE_INSTALL_PREFIX={project}/opt/wabt
114+
-DWITH_EXCEPTIONS=ON
115+
-DBUILD_TESTS=OFF
116+
-DBUILD_TOOLS=OFF
117+
-DBUILD_LIBWASM=OFF
118+
-DUSE_INTERNAL_SHA256=ON &&
119+
cmake --build /tmp/wabt-build --target install
120+
CIBW_BEFORE_ALL_WINDOWS: >
121+
git clone --depth=1 -b v${{ env.FLATBUFFERS_VERSION }}
122+
https://github.com/google/flatbuffers %TEMP%\fb-src &&
123+
cmake -G Ninja -S %TEMP%\fb-src -B %TEMP%\fb-build
124+
-DCMAKE_BUILD_TYPE=Release
125+
-DCMAKE_INSTALL_PREFIX={project}/opt/flatbuffers
126+
-DFLATBUFFERS_BUILD_TESTS=NO &&
127+
cmake --build %TEMP%\fb-build --target install
128+
CIBW_ENVIRONMENT_LINUX: >
129+
Halide_LLVM_ROOT=/project/opt/llvm
130+
CMAKE_PREFIX_PATH=/project/opt
208131
SETUPTOOLS_SCM_OVERRIDES_FOR_HALIDE='{local_scheme="no-local-version"}'
209132
CIBW_ENVIRONMENT_MACOS: >
210133
CMAKE_PREFIX_PATH='${{ github.workspace }}/opt'
@@ -214,7 +137,7 @@ jobs:
214137
CMAKE_GENERATOR=Ninja
215138
CMAKE_PREFIX_PATH='${{ github.workspace }}\opt'
216139
SETUPTOOLS_SCM_OVERRIDES_FOR_HALIDE='{local_scheme="no-local-version"}'
217-
CIBW_MANYLINUX_X86_64_IMAGE: "ghcr.io/halide/manylinux_2_28_x86_64-llvm:${{ env.LLVM_VERSION }}"
140+
CIBW_BEFORE_TEST_LINUX: pip install cmake ninja
218141
CIBW_TEST_COMMAND: >
219142
cmake -G Ninja -S {project}/python_bindings/apps -B build -DCMAKE_BUILD_TYPE=Release &&
220143
cmake --build build &&
@@ -246,7 +169,9 @@ jobs:
246169
- uses: pypa/gh-action-pypi-publish@release/v1
247170
if: github.event_name == 'push' && github.ref_name == 'main'
248171
with:
249-
repository-url: https://test.pypi.org/legacy/
172+
user: upload
173+
password: ${{ secrets.HALIDE_PYPI_PASSWORD }}
174+
repository-url: https://pypi.halide-lang.org/
250175

251176
- uses: pypa/gh-action-pypi-publish@release/v1
252177
if: github.event_name == 'release' && github.event.action == 'published'

0 commit comments

Comments
 (0)