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
36 changes: 30 additions & 6 deletions .github/workflows/build-attention.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,16 @@ jobs:
- name: Copy to platform package
shell: bash
run: |
# Find the built .node file (exclude committed npm/ platform binaries)
NODE_FILE=$(find crates/ruvector-attention-node -name "*.node" -type f ! -path "*/npm/*" | head -1)

if [ -z "$NODE_FILE" ]; then
echo "ERROR: No .node file found"
# napi --platform writes exactly attention.<platform>.node at the crate
# root. Do NOT `find` for it: `npm install` above pulls the host's
# previously published @ruvector/attention-<host> binary into
# node_modules, and a find | head -1 picked that stale host-arch file
# (linux-arm64-gnu shipped an x86-64 binary, darwin-x64 an arm64 one).
NODE_FILE="crates/ruvector-attention-node/attention.${{ matrix.settings.platform }}.node"

if [ ! -f "$NODE_FILE" ]; then
echo "ERROR: expected napi output $NODE_FILE not found"
ls -la crates/ruvector-attention-node/*.node || true
exit 1
fi

Expand Down Expand Up @@ -154,7 +159,7 @@ jobs:
continue-on-error: true
shell: bash
run: |
NODE_FILE=$(find crates/ruvector-attention-node -name "*.node" -type f ! -path "*/npm/*" | head -1)
NODE_FILE="crates/ruvector-attention-node/attention.${{ matrix.settings.platform }}.node"
echo "Testing: $NODE_FILE"
node -e "
const native = require('./$NODE_FILE');
Expand All @@ -174,6 +179,25 @@ jobs:
git checkout -- index.js index.d.ts
node --test test/*.test.js

- name: Assert binary architecture matches the platform
if: runner.os != 'Windows'
shell: bash
run: |
F="crates/ruvector-attention-node/npm/${{ matrix.settings.platform }}/attention.${{ matrix.settings.platform }}.node"
desc=$(file -b "$F"); echo "$F: $desc"
case "${{ matrix.settings.platform }}" in
linux-x64-gnu) want='ELF 64-bit.*x86-64' ;;
linux-arm64-gnu) want='ELF 64-bit.*(ARM aarch64|aarch64)' ;;
darwin-x64) want='Mach-O 64-bit.*x86_64' ;;
darwin-arm64) want='Mach-O 64-bit.*arm64' ;;
esac
echo "$desc" | grep -Eq "$want" || { echo "::error::$F is not a ${{ matrix.settings.platform }} binary: $desc"; exit 1; }

- name: Gate linux-arm64 binary (no LDAPR, GLIBC <= 2.34)
if: matrix.settings.platform == 'linux-arm64-gnu'
shell: bash
run: bash scripts/ci/check-arm64-node-binary.sh crates/ruvector-attention-node/npm/linux-arm64-gnu/attention.linux-arm64-gnu.node

- name: Upload artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ruvector/attention-darwin-arm64",
"version": "2.3.0",
"version": "2.3.1",
"homepage": "https://ruv.io",
"os": [
"darwin"
Expand Down
2 changes: 1 addition & 1 deletion crates/ruvector-attention-node/npm/darwin-x64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ruvector/attention-darwin-x64",
"version": "2.3.0",
"version": "2.3.1",
"homepage": "https://ruv.io",
"os": [
"darwin"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ruvector/attention-linux-arm64-gnu",
"version": "2.3.0",
"version": "2.3.1",
"homepage": "https://ruv.io",
"os": [
"linux"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ruvector/attention-linux-x64-gnu",
"version": "2.3.0",
"version": "2.3.1",
"homepage": "https://ruv.io",
"os": [
"linux"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ruvector/attention-linux-x64-musl",
"version": "2.3.0",
"version": "2.3.1",
"homepage": "https://ruv.io",
"os": [
"linux"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ruvector/attention-win32-arm64-msvc",
"version": "2.3.0",
"version": "2.3.1",
"homepage": "https://ruv.io",
"os": [
"win32"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ruvector/attention-win32-x64-msvc",
"version": "2.3.0",
"version": "2.3.1",
"homepage": "https://ruv.io",
"os": [
"win32"
Expand Down
10 changes: 5 additions & 5 deletions crates/ruvector-attention-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@
"access": "public"
},
"optionalDependencies": {
"@ruvector/attention-win32-x64-msvc": "2.3.0",
"@ruvector/attention-darwin-x64": "2.3.0",
"@ruvector/attention-darwin-arm64": "2.3.0",
"@ruvector/attention-linux-x64-gnu": "2.3.0",
"@ruvector/attention-linux-arm64-gnu": "2.3.0"
"@ruvector/attention-win32-x64-msvc": "2.3.1",
"@ruvector/attention-darwin-x64": "2.3.1",
"@ruvector/attention-darwin-arm64": "2.3.1",
"@ruvector/attention-linux-x64-gnu": "2.3.1",
"@ruvector/attention-linux-arm64-gnu": "2.3.1"
},
"devDependencies": {
"@napi-rs/cli": "^2.18.0"
Expand Down
14 changes: 12 additions & 2 deletions scripts/ci/check-arm64-node-binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,18 @@ status=0
for f in "$@"; do
[ -f "$f" ] || { echo "::error::$f does not exist"; status=1; continue; }

ldapr=$("$OBJDUMP" -d "$f" | grep -c ldapr || true)
glibc=$("$OBJDUMP" -T "$f" | grep -o 'GLIBC_[0-9][0-9.]*' | sed 's/^GLIBC_//' | sort -uV | tail -1)
# A non-aarch64 file would disassemble to nothing and pass the LDAPR count
# vacuously, so verify the ELF architecture first.
arch=$("$OBJDUMP" -f "$f" 2>/dev/null | sed -n 's/^architecture: \([^,]*\).*/\1/p')
if [ "$arch" != "aarch64" ]; then
echo "::error file=$f::not an aarch64 ELF (objdump architecture: ${arch:-unrecognised})"
status=1
continue
fi

# Match the mnemonic column only (objdump prints the file path in its header).
ldapr=$("$OBJDUMP" -d "$f" | grep -cE $'\tldapr' || true)
glibc=$("$OBJDUMP" -T "$f" | { grep -o 'GLIBC_[0-9][0-9.]*' || true; } | sed 's/^GLIBC_//' | sort -uV | tail -1)
glibc="${glibc:-none}"
echo "$f: ldapr=$ldapr max_glibc=$glibc (limit $MAX_GLIBC)"

Expand Down
Loading