Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
81 changes: 81 additions & 0 deletions .github/workflows/matter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,20 @@ jobs:
# CSC_LINK: ${{ secrets.api_key_id }}
# CSC_KEY_PASSWORD: ${{ secrets.api_key_issuer_id }}

- name: Assert zap-cli is statically linked (no GLIBC)
if: startsWith(matrix.os, 'ubuntu')
run: |
set -e
unzip -o dist/zap-linux-x64.zip -d /tmp/zap-static-check
BIN=/tmp/zap-static-check/zap-cli
file "$BIN"
file "$BIN" | grep -q 'statically linked' || { echo 'FAIL: zap-cli is not statically linked'; exit 1; }
GLIBC_REFS=$(objdump -T "$BIN" 2>/dev/null | grep -oE 'GLIBC_[0-9.]+' | sort -uV || true)
echo "GLIBC versioned symbols: ${GLIBC_REFS:-(none)}"
if [ -n "$GLIBC_REFS" ]; then echo 'FAIL: zap-cli still imports GLIBC symbols'; exit 1; fi
ldd "$BIN" || true
rm -rf /tmp/zap-static-check

- name: Verify zap-cli exists in Linux x64 .zip package
if: startsWith(matrix.os, 'ubuntu')
run: |
Expand Down Expand Up @@ -182,6 +196,73 @@ jobs:
name: zap-linux-x64-deb
path: dist/zap-linux-x64.deb

linux-portability-test:
name: Verify static zap-cli on ${{ matrix.label }}
needs: [build-zap]
runs-on: ubuntu-22.04
container:
image: ${{ matrix.image }}
strategy:
fail-fast: false
matrix:
include:
- label: 'ubuntu:22.04 (glibc 2.35)'
image: 'ubuntu:22.04'
installer: 'apt'
- label: 'debian:bullseye (glibc 2.31)'
image: 'debian:bullseye-slim'
installer: 'apt'
- label: 'rockylinux:8 (glibc 2.28)'
image: 'rockylinux:8'
installer: 'dnf'
steps:
- name: Install minimal tooling
run: |
if [ "${{ matrix.installer }}" = "apt" ]; then
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates binutils file unzip
else
dnf install -y binutils file unzip
fi
- name: Print baseline OS info
run: |
cat /etc/os-release || true
ldd --version 2>/dev/null | head -n 1 || true
uname -a || true
- uses: actions/download-artifact@v4
with:
name: zap-linux-x64-zip
- name: Unpack zap-linux-x64.zip
run: |
mkdir -p zap-release
ART_ZIP=zap-linux-x64-zip/zap-linux-x64.zip
if [ ! -f "$ART_ZIP" ]; then
ART_ZIP=zap-linux-x64.zip
fi
unzip -o "$ART_ZIP" -d zap-release
- name: Inspect zap-cli binary
run: |
chmod +x zap-release/zap-cli
file zap-release/zap-cli
objdump -T zap-release/zap-cli 2>/dev/null | grep -oE 'GLIBC_[0-9.]+' | sort -uV || echo '(no GLIBC refs)'
ldd zap-release/zap-cli || true
- name: Run zap-cli --version (must succeed; proves binary loads with old glibc)
run: |
set -euo pipefail
./zap-release/zap-cli --version
- name: Run zap-cli selfCheck (SQLite-touching path)
run: |
set -euo pipefail
CLI=./zap-release/zap-cli
PROP=zap-release/zcl-builtin/silabs/zcl-test.properties
GEN=zap-release/test/gen-template/zigbee/gen-templates.json
if [[ -f "$PROP" ]] && [[ -f "$GEN" ]]; then
"$CLI" selfCheck --zclProperties "$PROP" --genTemplateJson "$GEN"
else
"$CLI" selfCheck
fi

matter-sdk-codegen-master:
name: Test matter sdk codegen changes (master)
needs: [build-zap]
Expand Down
81 changes: 81 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,20 @@ jobs:
# CSC_LINK: ${{ secrets.api_key_id }}
# CSC_KEY_PASSWORD: ${{ secrets.api_key_issuer_id }}

- name: Assert zap-cli is statically linked (no GLIBC)
if: startsWith(matrix.os, 'ubuntu')
run: |
set -e
unzip -o dist/zap-linux-x64.zip -d /tmp/zap-static-check
BIN=/tmp/zap-static-check/zap-cli
file "$BIN"
file "$BIN" | grep -q 'statically linked' || { echo 'FAIL: zap-cli is not statically linked'; exit 1; }
GLIBC_REFS=$(objdump -T "$BIN" 2>/dev/null | grep -oE 'GLIBC_[0-9.]+' | sort -uV || true)
echo "GLIBC versioned symbols: ${GLIBC_REFS:-(none)}"
if [ -n "$GLIBC_REFS" ]; then echo 'FAIL: zap-cli still imports GLIBC symbols'; exit 1; fi
ldd "$BIN" || true
rm -rf /tmp/zap-static-check

- name: Verify zap-cli exists in Linux x64 .zip package
if: startsWith(matrix.os, 'ubuntu')
run: |
Expand Down Expand Up @@ -535,6 +549,73 @@ jobs:
name: zap-linux-x64-deb
path: dist/zap-linux-x64.deb

linux-portability-test:
name: Verify static zap-cli on ${{ matrix.label }}
needs: [build-zap]
runs-on: ubuntu-22.04
container:
image: ${{ matrix.image }}
strategy:
fail-fast: false
matrix:
include:
- label: 'ubuntu:22.04 (glibc 2.35)'
image: 'ubuntu:22.04'
installer: 'apt'
- label: 'debian:bullseye (glibc 2.31)'
image: 'debian:bullseye-slim'
installer: 'apt'
- label: 'rockylinux:8 (glibc 2.28)'
image: 'rockylinux:8'
installer: 'dnf'
steps:
- name: Install minimal tooling
run: |
if [ "${{ matrix.installer }}" = "apt" ]; then
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates binutils file unzip
else
dnf install -y binutils file unzip
fi
- name: Print baseline OS info
run: |
cat /etc/os-release || true
ldd --version 2>/dev/null | head -n 1 || true
uname -a || true
- uses: actions/download-artifact@v4
with:
name: zap-linux-x64-zip
- name: Unpack zap-linux-x64.zip
run: |
mkdir -p zap-release
ART_ZIP=zap-linux-x64-zip/zap-linux-x64.zip
if [ ! -f "$ART_ZIP" ]; then
ART_ZIP=zap-linux-x64.zip
fi
unzip -o "$ART_ZIP" -d zap-release
- name: Inspect zap-cli binary
run: |
chmod +x zap-release/zap-cli
file zap-release/zap-cli
objdump -T zap-release/zap-cli 2>/dev/null | grep -oE 'GLIBC_[0-9.]+' | sort -uV || echo '(no GLIBC refs)'
ldd zap-release/zap-cli || true
- name: Run zap-cli --version (must succeed; proves binary loads with old glibc)
run: |
set -euo pipefail
./zap-release/zap-cli --version
- name: Run zap-cli selfCheck (SQLite-touching path)
run: |
set -euo pipefail
CLI=./zap-release/zap-cli
PROP=zap-release/zcl-builtin/silabs/zcl-test.properties
GEN=zap-release/test/gen-template/zigbee/gen-templates.json
if [[ -f "$PROP" ]] && [[ -f "$GEN" ]]; then
"$CLI" selfCheck --zclProperties "$PROP" --genTemplateJson "$GEN"
else
"$CLI" selfCheck
fi

release:
if: startsWith(github.ref, 'refs/tags/')
needs: [build-zap]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
"pack:cli:win": "node ./src-script/pack-cli.js -p win",
"pack:cli:mac": "node ./src-script/pack-cli.js -p mac",
"pkg": "npx pkg --out-path dist/ --compress GZip --options max-old-space-size=4096 .",
"pkg:linux": "npx pkg -t node20-linux-x64,node20-linux-arm64 --public --no-bytecode --output dist/zap-linux --compress GZip --options max-old-space-size=4096 .",
"pkg:linux": "npx pkg -t node20-linuxstatic-x64,node20-linuxstatic-arm64 --public --no-bytecode --output dist/zap-linux --compress GZip --options max-old-space-size=4096 .",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

Switching the target platform from linux to linuxstatic will likely break the packaging workflow:

  1. Filename Mismatch: pkg generates output filenames based on the target platform string. Changing linux to linuxstatic will likely result in filenames like zap-linux-linuxstatic-x64 (and -arm64), which will cause src-script/pack-cli.js (lines 67 and 70) to fail as it expects zap-linux-x64 (and -arm64).
  2. Inconsistency: Other references to node20-linux-x64 in this file, specifically the pkg-use-local-fork script (line 120) and the pkg.targets configuration (line 368), have not been updated. These should be synchronized to node20-linuxstatic-x64 to ensure consistent behavior across all packaging commands.

"pkg-use-local-fork": "node ../pkg/lib-es5/bin.js -t node20-linux-x64 --output dist/zap-linux --compress GZip --options max-old-space-size=4096 .",
"pkg:win": "npx pkg -t node20-win-x64,node20-win-arm64 --public --no-bytecode --output dist/zap-win --compress GZip --options max-old-space-size=4096 .",
"pkg:mac": "npx pkg -t node20-macos-x64,node20-macos-arm64 --output dist/zap-macos --compress GZip --options max-old-space-size=4096 .",
Expand Down
Loading