Skip to content

Commit

Permalink
Address ArchLinux's nodejs no longer including libnode.so
Browse files Browse the repository at this point in the history
  • Loading branch information
rootmos committed Apr 16, 2024
1 parent 2e03889 commit d012e76
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 15 deletions.
24 changes: 17 additions & 7 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
apt-get install -y --no-install-recommends git sudo gettext-base ca-certificates
- name: Check out repository code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -35,7 +35,7 @@ jobs:
run: sudo -u $UNPRIVILEGED --preserve-env=WORKDIR env SUDO=sudo build/ubuntu/mk

- name: Archive source package
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: source-package.${{github.sha}}.${{env.ARCH}}
retention-days: 7
Expand All @@ -58,7 +58,7 @@ jobs:
run hsh
- name: Archive test results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: tests.${{github.sha}}.${{env.ARCH}}
Expand All @@ -75,10 +75,20 @@ jobs:
TEST_OUTPUT_DIR: /tmp/tests
steps:
- name: Install minimal dependencies
run: pacman -Suy --noconfirm sudo fakeroot binutils which wget git
run: pacman -Suy --noconfirm base-devel wget git

# workaround for upstream nodejs package does not include libnode.so
# https://gitlab.archlinux.org/archlinux/packaging/packages/nodejs/-/issues/1
- name: Install nodejs-shared
env:
GH_TOKEN: ${{github.token}}
run: |
pacman -S --noconfirm github-cli
gh --repo rootmos/nodejs-shared release download --pattern "nodejs-shared*x86_64*"
pacman --noconfirm -U nodejs-shared*x86_64*
- name: Check out repository code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -92,7 +102,7 @@ jobs:
run: sudo -u $UNPRIVILEGED build/archlinux/mk

- name: Archive PKGBUILD
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: PKGBUILD.${{github.sha}}
retention-days: 7
Expand All @@ -116,7 +126,7 @@ jobs:
run hsh
- name: Archive test results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: tests.${{github.sha}}.${{env.ARCH}}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout repository code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VERSION_MAJOR=0
VERSION_MINOR=9
VERSION_PATCH=1
VERSION_PATCH=2
3 changes: 1 addition & 2 deletions build/archlinux/PKGBUILD.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ pkgver=$BUILD_VERSION
pkgrel=1
arch=("x86_64")
depends=("lua" "python" "nodejs" "bash")
makedepends=("make" "gcc" "pkgconf" "bpf")
checkdepends=("python-toml") # TODO until python >= 3.11
makedepends=("bpf")
url=$BUILD_REPO_URL
source=("$pkgname-$pkgver.zip::$BUILD_SOURCE_TARBALL_URL")
sha256sums=("$SOURCE_TARBALL_SHA256")
Expand Down
1 change: 1 addition & 0 deletions hlua/filter.bpf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jeq #$__NR_read, good
jeq #$__NR_write, good
jeq #$__NR_close, good
jeq #$__NR_newfstatat, good
jeq #$__NR_fstat, good
jeq #$__NR_lseek, good
jeq #$__NR_unlink, good

Expand Down
1 change: 1 addition & 0 deletions hnode/filter.bpf
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jeq #$__NR_futex, good
jeq #$__NR_getrandom, good

jeq #$__NR_newfstatat, good
jeq #$__NR_fstat, good
jeq #$__NR_statx, good

jeq #$__NR_getpid, good
Expand Down
2 changes: 1 addition & 1 deletion hnode/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <uv.h>

#define RLIMIT_DEFAULT_CPU (1<<2)
#define RLIMIT_DEFAULT_DATA (1<<25)
#define RLIMIT_DEFAULT_DATA (1<<26)
#define RLIMIT_DEFAULT_NOFILE (1<<5)
#define RLIMIT_DEFAULT_NPROC (1<<11)
#define RLIMIT_DEFAULT_RSS (1<<28)
Expand Down
1 change: 1 addition & 0 deletions hpython/filter.bpf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jeq #$__NR_getrandom, good

jeq #$__NR_openat, good
jeq #$__NR_newfstatat, good
jeq #$__NR_fstat, good

jeq #$__NR_getpid, good
jeq #$__NR_gettid, good
Expand Down
1 change: 1 addition & 0 deletions hsh/filter.bpf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jeq #$__NR_writev, good
jeq #$__NR_lseek, good
jeq #$__NR_access, good
jeq #$__NR_newfstatat, good
jeq #$__NR_fstat, good
jeq #$__NR_dup2, good
jeq #$__NR_readlink, good

Expand Down
15 changes: 12 additions & 3 deletions tools/test-runner
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,19 @@ import signal
import subprocess
import sys
import tempfile
import toml
import uuid

try:
import tomllib
def toml_load(path):
with open(path, "rb") as f:
return tomllib.load(f)
except ImportError:
import toml
def toml_load(path):
with open(path, "r") as f:
return toml.load(f)

TOOLS = os.environ.get("TOOLS", os.path.dirname(os.path.realpath(__file__)))
CAPTURE = os.environ.get("CAPTURE", os.path.join(TOOLS, "capture"))
STRACE_LOG_WATCH = os.environ.get("STRACE_LOG_WATCH", os.path.join(TOOLS, "strace-log-watch"))
Expand Down Expand Up @@ -68,8 +78,7 @@ class Test:
raise RuntimeError("unable to read test spec", fn)
self.fn = fn

with open(fn, "r") as f:
self.spec = toml.load(f)
self.spec = toml_load(fn)
logger.debug(f"test spec: {self.spec}")

self.cwd = os.path.realpath(os.path.dirname(fn))
Expand Down

0 comments on commit d012e76

Please sign in to comment.