Skip to content

Commit f0fa79d

Browse files
authored
Merge pull request #390 from sidequery/cutover-inventory
Package the native runtime and expand Rust parity
2 parents 9bdc704 + df09230 commit f0fa79d

140 files changed

Lines changed: 6876 additions & 1202 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.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Save completed build work
2+
description: Preserve compiler objects and uv wheels when later tests fail, including PR runs.
3+
inputs:
4+
rust-key:
5+
description: Boxington primary key, empty when Rust caching is disabled.
6+
default: ''
7+
uv-key:
8+
description: setup-uv primary key, empty when uv caching is disabled.
9+
default: ''
10+
runs:
11+
using: composite
12+
steps:
13+
# The upstream action saves successful default-branch pushes. Preserve
14+
# completed objects for failed jobs and PRs as well; GitHub scopes PR
15+
# caches to the PR merge ref, so they cannot populate the trunk cache.
16+
- name: Export completed Rust builds
17+
id: rust
18+
if: inputs.rust-key != '' && (github.event_name != 'push' || failure())
19+
shell: bash
20+
run: |
21+
archive="$(mbx cache dir)/github-actions-cache-v1.tar"
22+
if mbx cache export --group "$MBX_CACHE_EXPORT_GROUP" "$archive" > "$RUNNER_TEMP/mbx-export.log" 2>&1; then
23+
echo "archive=$archive" >> "$GITHUB_OUTPUT"
24+
elif grep -q 'no completed mbx builds are recorded for export group' "$RUNNER_TEMP/mbx-export.log"; then
25+
cat "$RUNNER_TEMP/mbx-export.log"
26+
else
27+
cat "$RUNNER_TEMP/mbx-export.log" >&2
28+
exit 1
29+
fi
30+
31+
- uses: actions/cache/save@v4
32+
if: ${{ !cancelled() && steps.rust.outputs.archive != '' }}
33+
with:
34+
path: ${{ steps.rust.outputs.archive }}
35+
key: ${{ inputs.rust-key }}-${{ github.sha }}
36+
37+
# setup-uv saves successful jobs itself, but its post step skips failures.
38+
- name: Prune uv cache after failure
39+
if: inputs.uv-key != '' && failure()
40+
shell: bash
41+
run: uv cache prune --ci
42+
43+
- uses: actions/cache/save@v4
44+
if: inputs.uv-key != '' && failure()
45+
with:
46+
path: ${{ runner.temp }}/uv-cache
47+
key: ${{ inputs.uv-key }}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Cache Rust compilation
2+
description: Share completed compiler objects across Cargo, uv, maturin, and Make builds.
3+
inputs:
4+
suffix:
5+
description: Job and matrix partition for the compiler cache.
6+
required: true
7+
outputs:
8+
key:
9+
description: Key used by the Boxington action.
10+
value: ${{ steps.cache.outputs.cache-primary-key }}
11+
runs:
12+
using: composite
13+
steps:
14+
# Upstream 1.11.0 publishes ARM macOS binaries, but no Intel macOS binary.
15+
# Bootstrap that host once, then reuse the pinned executable across jobs.
16+
- uses: actions/cache/restore@v4
17+
if: runner.os == 'macOS' && runner.arch == 'X64'
18+
id: intel
19+
with:
20+
path: ${{ runner.temp }}/mbx-intel/bin/mbx
21+
key: mbx-1.11.0-macos-x64-v1
22+
23+
- name: Build Boxington for Intel macOS
24+
if: runner.os == 'macOS' && runner.arch == 'X64' && steps.intel.outputs.cache-hit != 'true'
25+
shell: bash
26+
run: cargo install --git https://github.com/jdx/mr-boxington --rev 4ebd2af1eb7e70fee37ec8678c30c0619f5ed5af --locked --root "$RUNNER_TEMP/mbx-intel" mbx
27+
28+
- uses: actions/cache/save@v4
29+
if: runner.os == 'macOS' && runner.arch == 'X64' && steps.intel.outputs.cache-hit != 'true'
30+
with:
31+
path: ${{ runner.temp }}/mbx-intel/bin/mbx
32+
key: mbx-1.11.0-macos-x64-v1
33+
34+
- name: Enable pinned Intel Boxington
35+
if: runner.os == 'macOS' && runner.arch == 'X64'
36+
shell: bash
37+
run: |
38+
test "$("$RUNNER_TEMP/mbx-intel/bin/mbx" --version)" = 'mbx 1.11.0'
39+
echo "$RUNNER_TEMP/mbx-intel/bin" >> "$GITHUB_PATH"
40+
41+
- uses: jdx/mr-boxington-action@a20e1ffcd962370fb2b6045c13b7b349f7b03386
42+
id: cache
43+
env:
44+
MBX_CACHE_DIR: ${{ github.workspace }}/.ci-mbx
45+
MBX_TARGET_VIEWS: '0'
46+
with:
47+
version: ${{ (runner.os != 'macOS' || runner.arch != 'X64') && '1.11.0' || '' }}
48+
github-cache-mode: objects
49+
cache-generation: sidemantic-v1-${{ inputs.suffix }}
50+
51+
- name: Remove imported Rust cache archive
52+
env:
53+
MBX_CACHE_DIR: ${{ github.workspace }}/.ci-mbx
54+
shell: bash
55+
run: |
56+
# The pinned action imports this transport archive but leaves it on disk.
57+
# Export writes a new full-size temporary tar before replacing this path;
58+
# keep the imported objects and targets, not a second copy of their bytes.
59+
rm -f -- "$(mbx cache dir)/github-actions-cache-v1.tar"
60+
61+
- name: Enable Cargo subprocess caching
62+
shell: bash
63+
run: |
64+
# mbx dispatches as a Cargo shim when invoked under Cargo's filename.
65+
# Keep the shim in the workspace so maturin's workspace mount can use it too.
66+
shim_dir="$GITHUB_WORKSPACE/.ci-cache-bin"
67+
mkdir -p "$shim_dir"
68+
if [ "$RUNNER_OS" = Windows ]; then
69+
cp "$(command -v mbx)" "$shim_dir/cargo.exe"
70+
else
71+
cp "$(command -v mbx)" "$shim_dir/cargo"
72+
chmod +x "$shim_dir/cargo"
73+
fi
74+
echo "$shim_dir" >> "$GITHUB_PATH"
75+
echo "MBX_CACHE_DIR=$GITHUB_WORKSPACE/.ci-mbx" >> "$GITHUB_ENV"
76+
echo "MBX_TARGET_VIEWS=0" >> "$GITHUB_ENV"
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Set up uv with native source caching
2+
description: Cache downloaded dependencies and built wheels, including their Rust build inputs.
3+
inputs:
4+
enable-cache:
5+
description: Disable in production release jobs.
6+
default: 'true'
7+
suffix:
8+
description: Job and matrix partition for the dependency cache.
9+
required: true
10+
outputs:
11+
cache-key:
12+
description: Key used by setup-uv.
13+
value: ${{ steps.uv.outputs.cache-key }}
14+
runs:
15+
using: composite
16+
steps:
17+
- uses: astral-sh/setup-uv@v7
18+
id: uv
19+
with:
20+
version: '0.12.14'
21+
enable-cache: ${{ inputs.enable-cache }}
22+
cache-local-path: ${{ runner.temp }}/uv-cache
23+
cache-suffix: ${{ inputs.suffix }}
24+
cache-dependency-glob: |
25+
uv.lock
26+
pyproject.toml
27+
sidemantic-rs/pyproject.toml
28+
crates/dax-pyo3/pyproject.toml
29+
crates/dax-pyo3/README.md
30+
.cargo/config.toml
31+
rust-toolchain*
32+
Cargo.lock
33+
Cargo.toml
34+
sidemantic-rs/Cargo.toml
35+
sidemantic-rs/build.rs
36+
sidemantic-rs/src/**
37+
crates/*/Cargo.toml
38+
crates/*/src/**
39+
crates/dax-pyo3/python/**/*.py
40+
crates/dax-pyo3/python/**/*.pyi
41+
crates/dax-pyo3/python/**/py.typed

0 commit comments

Comments
 (0)