Skip to content
Merged
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
4 changes: 3 additions & 1 deletion .github/actions/install-deps/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ runs:
remove-haskell: "true"
remove-codeql: "true"

# Sticking to 3.29 because of:
# https://github.com/open-telemetry/opentelemetry-cpp/issues/2998
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
# uses: jwlawson/actions-setup-cmake@v2
uses: tomjakubowski/actions-setup-cmake@v0-aarch64-test4
with:
cmake-version: "3.29.6"

Expand Down
49 changes: 39 additions & 10 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,6 @@ jobs:
- name: Lint
run: pnpm run lint --nightly

# - name: Docs Build
# run: pnpm run docs

- uses: actions/upload-artifact@v4
with:
name: perspective-metadata
Expand Down Expand Up @@ -188,6 +185,7 @@ jobs:
matrix:
os:
- ubuntu-22.04
- ubuntu-22.04-arm
- macos-14
- windows-2022
arch:
Expand All @@ -201,26 +199,40 @@ jobs:
arch: x86_64
python-version: 3.9
container: pagmo2/manylinux228_x86_64_with_deps
- os: ubuntu-22.04-arm
arch: aarch64
python-version: 3.9
container: pagmo2/manylinux228_aarch64_with_deps
is-release:
- ${{ startsWith(github.ref, 'refs/tags/v') || github.ref_name == 'master' }}
exclude:
- os: windows-2022
arch: aarch64
- os: ubuntu-22.04
arch: aarch64
- os: macos-14
is-release: false
- os: macos-14
arch: x86_64
- os: windows-2022
is-release: false
- os: ubuntu-22.04
arch: aarch64
- os: ubuntu-22.04-arm
arch: x86_64

steps:
- name: Run df -h
if: ${{ runner.os == 'Linux' }}
run: df -h

- name: Free up disk space
if: ${{ runner.os == 'Linux' }}
run: |
rm -rf /__t/*

- name: Run df -h
if: ${{ runner.os == 'Linux' }}
run: df -h

- name: Checkout
uses: actions/checkout@v4

Expand All @@ -233,6 +245,10 @@ jobs:
name: perspective-metadata
path: rust/

- name: Run df -h
if: ${{ runner.os == 'Linux' }}
run: df -h

- name: Initialize Build
id: init-step
uses: ./.github/actions/install-deps
Expand All @@ -242,9 +258,13 @@ jobs:
manylinux: ${{ matrix.container && 'true' || 'false' }}
skip_cache: ${{ steps.config-step.outputs.SKIP_CACHE }}

- name: Run df -h
if: ${{ runner.os == 'Linux' }}
run: df -h
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate the thought to include these, but I may prune them in the future for brevity!


- name: Python Build
run: pnpm run build
if: ${{ !contains(matrix.os, 'windows') }}
if: ${{ runner.os != 'Windows' }}
env:
PACKAGE: "python"
PSP_ARCH: ${{ matrix.arch }}
Expand All @@ -255,7 +275,7 @@ jobs:
run: |
New-Item -ItemType Directory -Path $env:CARGO_TARGET_DIR -Force
pnpm run build
if: ${{ contains(matrix.os, 'windows') }}
if: ${{ runner.os == 'Windows' }}
env:
CARGO_TARGET_DIR: D:\psp-rust
PSP_CPP_BUILD_DIR: D:\psp-build
Expand All @@ -264,6 +284,10 @@ jobs:
PSP_ARCH: ${{ matrix.arch }}
PSP_BUILD_WHEEL: 1

- name: Run df -h
if: ${{ runner.os == 'Linux' }}
run: df -h

# Windows sucks lol
- uses: actions/upload-artifact@v4
if: ${{ runner.os == 'Windows' }}
Expand Down Expand Up @@ -658,7 +682,7 @@ jobs:
matrix:
os:
- ubuntu-22.04
- macos-14
- ubuntu-22.04-arm
- macos-14
- windows-2022
arch:
Expand All @@ -685,6 +709,8 @@ jobs:
arch: aarch64
- os: ubuntu-22.04
arch: aarch64
- os: ubuntu-22.04-arm
arch: x86_64
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -702,8 +728,7 @@ jobs:

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

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

Expand Down Expand Up @@ -955,6 +980,10 @@ jobs:
with:
name: perspective-python-dist-aarch64-macos-14-3.9

- uses: actions/download-artifact@v4
with:
name: perspective-python-dist-aarch64-ubuntu-22.04-arm-3.9

# - uses: actions/download-artifact@v4
# with:
# name: perspective-python-dist-x86_64-macos-14-3.9
Expand Down
1 change: 0 additions & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

husky was warning loudly that this is deprecated and will soon cause errors. The contents of that file now do nothing but echo that warning, so I think it is safe to heed it and remove this.


pnpm run prepush
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"test_python": "node tools/scripts/test_python.mjs",
"clean": "node tools/scripts/clean.mjs",
"start": "npm run start --workspace",
"prepush": "npm run lint",
"prepush": "node tools/scripts/prepush.mjs && npm run lint",
"prepare": "husky install",
"lint": "node tools/scripts/lint.mjs",
"fix": "node tools/scripts/fix.mjs",
Expand Down
7 changes: 6 additions & 1 deletion rust/perspective-server/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ fn cmake_build() -> Result<Option<PathBuf>, std::io::Error> {
dst.define("ARROW_BUILD_EXAMPLES", "OFF");
dst.define("RAPIDJSON_BUILD_EXAMPLES", "OFF");
dst.define("ARROW_CXX_FLAGS_DEBUG", "-Wno-error");
dst.define("PSP_PROTOC_PATH", protoc());
dst.define(
"PSP_PROTOC_PATH",
protoc()
.parent()
.expect("protoc() returned root path or empty string"),
);
dst.define("CMAKE_COLOR_DIAGNOSTICS", "ON");
dst.define(
"PSP_PROTO_PATH",
Expand Down
11 changes: 7 additions & 4 deletions rust/perspective-server/cmake/modules/FindProtoc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ function(download_protoc VERSION DESTINATION)
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
set(PROTOC_ZIP "protoc-${VERSION}-osx-x86_64.zip")
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
set(PROTOC_ZIP "protoc-${VERSION}-linux-x86_64.zip")
if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")
set(PROTOC_ZIP "protoc-${VERSION}-linux-aarch_64.zip")
else()
set(PROTOC_ZIP "protoc-${VERSION}-linux-x86_64.zip")
endif()
else()
message(FATAL_ERROR "Unsupported host system: ${CMAKE_HOST_SYSTEM_NAME}")
endif()
Expand Down Expand Up @@ -56,7 +60,7 @@ else()
OUTPUT_VARIABLE PROTOC_VERSION_OUTPUT
OUTPUT_STRIP_TRAILING_WHITESPACE
)

if(NOT PROTOC_VERSION_OUTPUT MATCHES "^libprotoc ([0-9]+)\\.([0-9]+)(:?\\.([0-9]+))?")
message(WARNING "Unable to determine protoc version")
return()
Expand All @@ -71,7 +75,7 @@ else()
else()
set(FOUND_VERSION "${PROTOC_VERSION_MAJOR}.${PROTOC_VERSION_MINOR}.${PROTOC_VERSION_PATCH}")
endif()

# Force the external project to use the same version as our installed protoc CLI
set(LIBPROTOBUF_VERSION "v${FOUND_VERSION}" PARENT_SCOPE)

Expand Down Expand Up @@ -120,4 +124,3 @@ function(protobuf_generate_cpp SRCS HDRS)
set(${SRCS} ${_PROTOBUF_GENERATE_CPP_SRCS} PARENT_SCOPE)
set(${HDRS} ${_PROTOBUF_GENERATE_CPP_HDRS} PARENT_SCOPE)
endfunction()

1 change: 1 addition & 0 deletions tools/scripts/lint.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ if (import.meta.url.startsWith("file:")) {
// if (process.env.PSP_PROJECT === "python") {
// await import("./lint_python.mjs");
// } else {

await lint_js();
lint_python();
// }
Expand Down
70 changes: 70 additions & 0 deletions tools/scripts/prepush.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
// ┃ ██████ ██████ ██████ █ █ █ █ █ █▄ ▀███ █ ┃
// ┃ ▄▄▄▄▄█ █▄▄▄▄▄ ▄▄▄▄▄█ ▀▀▀▀▀█▀▀▀▀▀ █ ▀▀▀▀▀█ ████████▌▐███ ███▄ ▀█ █ ▀▀▀▀▀ ┃
// ┃ █▀▀▀▀▀ █▀▀▀▀▀ █▀██▀▀ ▄▄▄▄▄ █ ▄▄▄▄▄█ ▄▄▄▄▄█ ████████▌▐███ █████▄ █ ▄▄▄▄▄ ┃
// ┃ █ ██████ █ ▀█▄ █ ██████ █ ███▌▐███ ███████▄ █ ┃
// ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
// ┃ Copyright (c) 2017, the Perspective Authors. ┃
// ┃ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ ┃
// ┃ This file is part of the Perspective library, distributed under the terms ┃
// ┃ of the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). ┃
// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

import "zx/globals";

function lint_git(sha) {
if (!sha || typeof sha !== "string") {
throw new Error(`invalid sha: ${sha}`);
}
const result = $.sync`git log -1 ${sha} | grep -F "Signed-off-by: "`;
if (result.exitCode !== 0) {
console.error(
"`git log -1 " +
sha +
"` is missing a Signed-off-by: and DCO check will surely fail.",
);
console.error("To sign off, run:\ngit commit --amend --edit --sign");
process.exit(1);
}
}

async function readPrePushInput() {
// Git supplies information about the push to the hook on stdin.
// https://git-scm.com/docs/githooks#_pre_push
const chunks = [];

if (process.stdin.isTTY) {
// Makes developing the pre-push script more convenient. In particular
// when you run `pnpm run prepush` from a shell terminal you don't have
// to send EOF on stdin.
return [];
}
for await (const chunk of process.stdin) {
chunks.push(chunk);
}

const input = Buffer.concat(chunks).toString();
const lines = input.split("\n").filter((l) => l.length > 0);
return lines.map((line) => {
const parts = line.trim().split(" ");

return {
local_ref: parts[0],
local_object_name: parts[1],
remote_ref: parts[2],
remote_object_name: parts[3],
};
});
}

if (import.meta.main) {
// Does not actually run all pre-push hook checks (it does not run the repo
// lint script). These are lints which run only in pre-push. The
// `prepush` script defined in package.json is responsible for running the
// repo lint script.
const pushes = await readPrePushInput();
for (const push of pushes) {
const { local_object_name } = push;
lint_git(local_object_name);
}
}
Loading