Skip to content

Commit

Permalink
Install nodejs --shared workaround from rootmos/nodejs-shared
Browse files Browse the repository at this point in the history
  • Loading branch information
rootmos committed Apr 16, 2024
1 parent 0b6c71c commit 843bd56
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 43 deletions.
51 changes: 11 additions & 40 deletions .github/workflows/build-test.yaml
Expand Up @@ -75,7 +75,17 @@ jobs:
TEST_OUTPUT_DIR: /tmp/tests
steps:
- name: Install minimal dependencies
run: pacman -Suy --noconfirm sudo fakeroot binutils which wget git diffutils
run: pacman -Suy --noconfirm base-devel wget git diffutils

# 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@v4
Expand All @@ -91,45 +101,6 @@ jobs:
chown -R $UNPRIVILEGED:$UNPRIVILEGED .
tee -a /etc/sudoers.d/$UNPRIVILEGED <<< "$UNPRIVILEGED ALL = NOPASSWD: $(which pacman)"
- name: Generate nodejs-shared's PKGBUILD
id: nodejs_shared_pkgbuild
run: |
PKG=$(build/archlinux/nodejs-shared/PKGBUILD.gen)
echo "pkg=$PKG" >> "$GITHUB_OUTPUT"
- name: Archive nodejs-shared's PKGBUILD
uses: actions/upload-artifact@v4
with:
name: nodejs-shared.PKGBUILD
retention-days: 7
path: "build/archlinux/nodejs-shared/PKGBUILD.shared"

- name: Restore nodejs-shared package
id: nodejs_shared_cache
uses: actions/cache/restore@v4
with:
path: build/archlinux/nodejs-shared/${{ steps.nodejs_shared_pkgbuild.outputs.pkg }}
key: ${{ steps.nodejs_shared_pkgbuild.outputs.pkg }}

- name: Build nodejs-shared
if: steps.nodejs_shared_cache.outputs.cache-hit != 'true'
run: |
df -h
sudo -u $UNPRIVILEGED build/archlinux/nodejs-shared/build
df -h
- name: Cache nodejs-shared package
if: steps.nodejs_shared_cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: build/archlinux/nodejs-shared/${{ steps.nodejs_shared_pkgbuild.outputs.pkg }}
key: ${{ steps.nodejs_shared_pkgbuild.outputs.pkg }}

- name: Install nodejs-shared
run: pacman -U --noconfirm build/archlinux/nodejs-shared/${{ steps.nodejs_shared_pkgbuild.outputs.pkg }}


- name: Create PKGBUILD
run: sudo -u $UNPRIVILEGED build/archlinux/mk

Expand Down
5 changes: 3 additions & 2 deletions build/archlinux/PKGBUILD.template
Expand Up @@ -2,8 +2,9 @@ pkgname=$BUILD_PROJECT
pkgver=$BUILD_VERSION
pkgrel=1
arch=("x86_64")
depends=("lua" "python" "nodejs-shared")
makedepends=("bash" "make" "gcc" "pkgconf" "bpf" "debugedit")
depends=("lua" "python" "nodejs")
makedepends=("bash" "bpf")
checkdepends=("python-toml")
url=$BUILD_REPO_URL
source=("$pkgname-$pkgver.zip::$BUILD_SOURCE_TARBALL_URL")
sha256sums=("$SOURCE_TARBALL_SHA256")
Expand Down
2 changes: 1 addition & 1 deletion hnode/main.cpp
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

0 comments on commit 843bd56

Please sign in to comment.