Skip to content

Commit d1f70e0

Browse files
authored
Merge pull request #3092 from tomjakubowski/linux-aarch64
Build arm64/aarch64 Linux wheels
2 parents f84c227 + cbfe4ec commit d1f70e0

File tree

8 files changed

+127
-18
lines changed

8 files changed

+127
-18
lines changed

.github/actions/install-deps/action.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,11 @@ runs:
5454
remove-haskell: "true"
5555
remove-codeql: "true"
5656

57+
# Sticking to 3.29 because of:
5758
# https://github.com/open-telemetry/opentelemetry-cpp/issues/2998
5859
- name: Setup cmake
59-
uses: jwlawson/actions-setup-cmake@v2
60+
# uses: jwlawson/actions-setup-cmake@v2
61+
uses: tomjakubowski/actions-setup-cmake@v0-aarch64-test4
6062
with:
6163
cmake-version: "3.29.6"
6264

.github/workflows/build.yaml

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,6 @@ jobs:
9797
- name: Lint
9898
run: pnpm run lint --nightly
9999

100-
# - name: Docs Build
101-
# run: pnpm run docs
102-
103100
- uses: actions/upload-artifact@v4
104101
with:
105102
name: perspective-metadata
@@ -188,6 +185,7 @@ jobs:
188185
matrix:
189186
os:
190187
- ubuntu-22.04
188+
- ubuntu-22.04-arm
191189
- macos-14
192190
- windows-2022
193191
arch:
@@ -201,26 +199,40 @@ jobs:
201199
arch: x86_64
202200
python-version: 3.9
203201
container: pagmo2/manylinux228_x86_64_with_deps
202+
- os: ubuntu-22.04-arm
203+
arch: aarch64
204+
python-version: 3.9
205+
container: pagmo2/manylinux228_aarch64_with_deps
204206
is-release:
205207
- ${{ startsWith(github.ref, 'refs/tags/v') || github.ref_name == 'master' }}
206208
exclude:
207209
- os: windows-2022
208210
arch: aarch64
209-
- os: ubuntu-22.04
210-
arch: aarch64
211211
- os: macos-14
212212
is-release: false
213213
- os: macos-14
214214
arch: x86_64
215215
- os: windows-2022
216216
is-release: false
217+
- os: ubuntu-22.04
218+
arch: aarch64
219+
- os: ubuntu-22.04-arm
220+
arch: x86_64
217221

218222
steps:
223+
- name: Run df -h
224+
if: ${{ runner.os == 'Linux' }}
225+
run: df -h
226+
219227
- name: Free up disk space
220228
if: ${{ runner.os == 'Linux' }}
221229
run: |
222230
rm -rf /__t/*
223231
232+
- name: Run df -h
233+
if: ${{ runner.os == 'Linux' }}
234+
run: df -h
235+
224236
- name: Checkout
225237
uses: actions/checkout@v4
226238

@@ -233,6 +245,10 @@ jobs:
233245
name: perspective-metadata
234246
path: rust/
235247

248+
- name: Run df -h
249+
if: ${{ runner.os == 'Linux' }}
250+
run: df -h
251+
236252
- name: Initialize Build
237253
id: init-step
238254
uses: ./.github/actions/install-deps
@@ -242,9 +258,13 @@ jobs:
242258
manylinux: ${{ matrix.container && 'true' || 'false' }}
243259
skip_cache: ${{ steps.config-step.outputs.SKIP_CACHE }}
244260

261+
- name: Run df -h
262+
if: ${{ runner.os == 'Linux' }}
263+
run: df -h
264+
245265
- name: Python Build
246266
run: pnpm run build
247-
if: ${{ !contains(matrix.os, 'windows') }}
267+
if: ${{ runner.os != 'Windows' }}
248268
env:
249269
PACKAGE: "python"
250270
PSP_ARCH: ${{ matrix.arch }}
@@ -255,7 +275,7 @@ jobs:
255275
run: |
256276
New-Item -ItemType Directory -Path $env:CARGO_TARGET_DIR -Force
257277
pnpm run build
258-
if: ${{ contains(matrix.os, 'windows') }}
278+
if: ${{ runner.os == 'Windows' }}
259279
env:
260280
CARGO_TARGET_DIR: D:\psp-rust
261281
PSP_CPP_BUILD_DIR: D:\psp-build
@@ -264,6 +284,10 @@ jobs:
264284
PSP_ARCH: ${{ matrix.arch }}
265285
PSP_BUILD_WHEEL: 1
266286

287+
- name: Run df -h
288+
if: ${{ runner.os == 'Linux' }}
289+
run: df -h
290+
267291
# Windows sucks lol
268292
- uses: actions/upload-artifact@v4
269293
if: ${{ runner.os == 'Windows' }}
@@ -658,7 +682,7 @@ jobs:
658682
matrix:
659683
os:
660684
- ubuntu-22.04
661-
- macos-14
685+
- ubuntu-22.04-arm
662686
- macos-14
663687
- windows-2022
664688
arch:
@@ -685,6 +709,8 @@ jobs:
685709
arch: aarch64
686710
- os: ubuntu-22.04
687711
arch: aarch64
712+
- os: ubuntu-22.04-arm
713+
arch: x86_64
688714
steps:
689715
- name: Checkout
690716
uses: actions/checkout@v4
@@ -702,8 +728,7 @@ jobs:
702728

703729
- uses: actions/download-artifact@v4
704730
with:
705-
# the macos-14 runner tests artifacts built on macos-14
706-
name: perspective-python-dist-${{ matrix.arch }}-${{ matrix.os == 'macos-14' && 'macos-14' || matrix.os }}-${{ matrix.python-version }}
731+
name: perspective-python-dist-${{ matrix.arch }}-${{ matrix.os }}-${{ matrix.python-version }}
707732

708733
- uses: ./.github/actions/install-wheel
709734

@@ -955,6 +980,10 @@ jobs:
955980
with:
956981
name: perspective-python-dist-aarch64-macos-14-3.9
957982

983+
- uses: actions/download-artifact@v4
984+
with:
985+
name: perspective-python-dist-aarch64-ubuntu-22.04-arm-3.9
986+
958987
# - uses: actions/download-artifact@v4
959988
# with:
960989
# name: perspective-python-dist-x86_64-macos-14-3.9

.husky/pre-push

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
32

43
pnpm run prepush

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"test_python": "node tools/scripts/test_python.mjs",
9191
"clean": "node tools/scripts/clean.mjs",
9292
"start": "npm run start --workspace",
93-
"prepush": "npm run lint",
93+
"prepush": "node tools/scripts/prepush.mjs && npm run lint",
9494
"prepare": "husky install",
9595
"lint": "node tools/scripts/lint.mjs",
9696
"fix": "node tools/scripts/fix.mjs",

rust/perspective-server/build.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,12 @@ fn cmake_build() -> Result<Option<PathBuf>, std::io::Error> {
4646
dst.define("ARROW_BUILD_EXAMPLES", "OFF");
4747
dst.define("RAPIDJSON_BUILD_EXAMPLES", "OFF");
4848
dst.define("ARROW_CXX_FLAGS_DEBUG", "-Wno-error");
49-
dst.define("PSP_PROTOC_PATH", protoc());
49+
dst.define(
50+
"PSP_PROTOC_PATH",
51+
protoc()
52+
.parent()
53+
.expect("protoc() returned root path or empty string"),
54+
);
5055
dst.define("CMAKE_COLOR_DIAGNOSTICS", "ON");
5156
dst.define(
5257
"PSP_PROTO_PATH",

rust/perspective-server/cmake/modules/FindProtoc.cmake

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ function(download_protoc VERSION DESTINATION)
99
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
1010
set(PROTOC_ZIP "protoc-${VERSION}-osx-x86_64.zip")
1111
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
12-
set(PROTOC_ZIP "protoc-${VERSION}-linux-x86_64.zip")
12+
if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")
13+
set(PROTOC_ZIP "protoc-${VERSION}-linux-aarch_64.zip")
14+
else()
15+
set(PROTOC_ZIP "protoc-${VERSION}-linux-x86_64.zip")
16+
endif()
1317
else()
1418
message(FATAL_ERROR "Unsupported host system: ${CMAKE_HOST_SYSTEM_NAME}")
1519
endif()
@@ -56,7 +60,7 @@ else()
5660
OUTPUT_VARIABLE PROTOC_VERSION_OUTPUT
5761
OUTPUT_STRIP_TRAILING_WHITESPACE
5862
)
59-
63+
6064
if(NOT PROTOC_VERSION_OUTPUT MATCHES "^libprotoc ([0-9]+)\\.([0-9]+)(:?\\.([0-9]+))?")
6165
message(WARNING "Unable to determine protoc version")
6266
return()
@@ -71,7 +75,7 @@ else()
7175
else()
7276
set(FOUND_VERSION "${PROTOC_VERSION_MAJOR}.${PROTOC_VERSION_MINOR}.${PROTOC_VERSION_PATCH}")
7377
endif()
74-
78+
7579
# Force the external project to use the same version as our installed protoc CLI
7680
set(LIBPROTOBUF_VERSION "v${FOUND_VERSION}" PARENT_SCOPE)
7781

@@ -120,4 +124,3 @@ function(protobuf_generate_cpp SRCS HDRS)
120124
set(${SRCS} ${_PROTOBUF_GENERATE_CPP_SRCS} PARENT_SCOPE)
121125
set(${HDRS} ${_PROTOBUF_GENERATE_CPP_HDRS} PARENT_SCOPE)
122126
endfunction()
123-

tools/scripts/lint.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ if (import.meta.url.startsWith("file:")) {
5353
// if (process.env.PSP_PROJECT === "python") {
5454
// await import("./lint_python.mjs");
5555
// } else {
56+
5657
await lint_js();
5758
lint_python();
5859
// }

tools/scripts/prepush.mjs

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
// ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
2+
// ┃ ██████ ██████ ██████ █ █ █ █ █ █▄ ▀███ █ ┃
3+
// ┃ ▄▄▄▄▄█ █▄▄▄▄▄ ▄▄▄▄▄█ ▀▀▀▀▀█▀▀▀▀▀ █ ▀▀▀▀▀█ ████████▌▐███ ███▄ ▀█ █ ▀▀▀▀▀ ┃
4+
// ┃ █▀▀▀▀▀ █▀▀▀▀▀ █▀██▀▀ ▄▄▄▄▄ █ ▄▄▄▄▄█ ▄▄▄▄▄█ ████████▌▐███ █████▄ █ ▄▄▄▄▄ ┃
5+
// ┃ █ ██████ █ ▀█▄ █ ██████ █ ███▌▐███ ███████▄ █ ┃
6+
// ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
7+
// ┃ Copyright (c) 2017, the Perspective Authors. ┃
8+
// ┃ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ ┃
9+
// ┃ This file is part of the Perspective library, distributed under the terms ┃
10+
// ┃ of the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). ┃
11+
// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
12+
13+
import "zx/globals";
14+
15+
function lint_git(sha) {
16+
if (!sha || typeof sha !== "string") {
17+
throw new Error(`invalid sha: ${sha}`);
18+
}
19+
const result = $.sync`git log -1 ${sha} | grep -F "Signed-off-by: "`;
20+
if (result.exitCode !== 0) {
21+
console.error(
22+
"`git log -1 " +
23+
sha +
24+
"` is missing a Signed-off-by: and DCO check will surely fail.",
25+
);
26+
console.error("To sign off, run:\ngit commit --amend --edit --sign");
27+
process.exit(1);
28+
}
29+
}
30+
31+
async function readPrePushInput() {
32+
// Git supplies information about the push to the hook on stdin.
33+
// https://git-scm.com/docs/githooks#_pre_push
34+
const chunks = [];
35+
36+
if (process.stdin.isTTY) {
37+
// Makes developing the pre-push script more convenient. In particular
38+
// when you run `pnpm run prepush` from a shell terminal you don't have
39+
// to send EOF on stdin.
40+
return [];
41+
}
42+
for await (const chunk of process.stdin) {
43+
chunks.push(chunk);
44+
}
45+
46+
const input = Buffer.concat(chunks).toString();
47+
const lines = input.split("\n").filter((l) => l.length > 0);
48+
return lines.map((line) => {
49+
const parts = line.trim().split(" ");
50+
51+
return {
52+
local_ref: parts[0],
53+
local_object_name: parts[1],
54+
remote_ref: parts[2],
55+
remote_object_name: parts[3],
56+
};
57+
});
58+
}
59+
60+
if (import.meta.main) {
61+
// Does not actually run all pre-push hook checks (it does not run the repo
62+
// lint script). These are lints which run only in pre-push. The
63+
// `prepush` script defined in package.json is responsible for running the
64+
// repo lint script.
65+
const pushes = await readPrePushInput();
66+
for (const push of pushes) {
67+
const { local_object_name } = push;
68+
lint_git(local_object_name);
69+
}
70+
}

0 commit comments

Comments
 (0)