From 5d02a44af66edd6fa91e6c350613bd385bc5f6cf Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Fri, 13 Dec 2024 17:07:52 +0100 Subject: [PATCH] Trying to solve issues, remove qemu for amd64, improve script. --- .github/workflows/ci.yml | 10 ++++++++++ scripts/build.sh | 30 ++++++++++++++++++++---------- scripts/deps.sh | 30 +++++++++++++++++++++--------- source/metacall.scm | 28 ++-------------------------- 4 files changed, 53 insertions(+), 45 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4d332d..62a8b76 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,7 @@ jobs: steps: - name: Set up QEMU uses: docker/setup-qemu-action@v3 + if: ${{ matrix.arch }} != amd64 with: platforms: all @@ -90,6 +91,15 @@ jobs: arch: [amd64, 386] steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + if: ${{ matrix.arch }} != amd64 + with: + platforms: all + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Check out the repo uses: actions/checkout@v4 diff --git a/scripts/build.sh b/scripts/build.sh index 52f94e5..8a012a7 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -19,18 +19,28 @@ # limitations under the License. # +set -euxo pipefail + export GUILE_WARN_DEPRECATED='detailed' # Generate a portable package tarball # Uses --no-grafts option in order to avoid conflicts between duplicated versions -`# Build` guix build metacall --fallback -L /metacall/nonguix -L /metacall/source \ -`# Install` && echo 'metacall' >> /metacall/source/metacall.scm \ - && guix package --fallback --no-grafts -f /metacall/source/metacall.scm | tee build.log \ -`# Lint` && guix lint -L /metacall/nonguix -L /metacall/source metacall \ -`# Pack` && guix pack --no-grafts \ - -S /gnu/bin=bin -S /gnu/etc=etc -S /gnu/lib=lib -S /gnu/include=include -S /gnu/share=share \ - -RR metacall nss-certs \ - -L /metacall/nonguix -L /metacall/source | tee build.log \ -`# Copy` && mv `grep 'tarball-pack.tar.gz$' build.log` /metacall/pack/tarball.tar.gz \ -`# Exit` && exit 0 || exit 1 +# Build +guix build metacall --fallback -L /metacall/nonguix -L /metacall/source + +# Install +echo 'metacall' >> /metacall/source/metacall.scm +guix package --fallback --no-grafts -f /metacall/source/metacall.scm | tee build.log + +# Lint +guix lint -L /metacall/nonguix -L /metacall/source metacall + +# Pack +guix pack --no-grafts \ + -S /gnu/bin=bin -S /gnu/etc=etc -S /gnu/lib=lib -S /gnu/include=include -S /gnu/share=share \ + -RR metacall nss-certs \ + -L /metacall/nonguix -L /metacall/source | tee build.log + +# Copy +mv `grep 'tarball-pack.tar.gz$' build.log` /metacall/pack/tarball.tar.gz diff --git a/scripts/deps.sh b/scripts/deps.sh index 64060f9..bcf0b53 100755 --- a/scripts/deps.sh +++ b/scripts/deps.sh @@ -19,17 +19,29 @@ # limitations under the License. # +set -euxo pipefail + export GUILE_WARN_DEPRECATED='detailed' -`# Clone nonguix` apk --update-cache add --virtual git-deps git \ - && rm -rf /metacall/nonguix \ - && git clone https://gitlab.com/nonguix/nonguix /metacall/nonguix \ - && cd /metacall/nonguix \ - && `# Fix nonguix version` git checkout e0951349603581895e0ba61f0e7410368ea1902a \ - && apk del git-deps \ -`# Build` && guix build --fallback \ +# Clone nonguix +apk --update-cache add --virtual git-deps git +rm -rf /metacall/nonguix +git clone https://gitlab.com/nonguix/nonguix /metacall/nonguix +cd /metacall/nonguix +git checkout e0951349603581895e0ba61f0e7410368ea1902a # Fix nonguix version +apk del git-deps + +# Build (i386 workaround for NodeJS) +architecture=$(uname -m) + +if [[ "$architecture" == "i386" || "$architecture" == "i686" ]]; then + guix install --fallback --without-tests=node node-lts + guix install --fallback --without-tests=node-lts libnode +fi + +# Build +guix build --fallback \ nss-certs \ `# dotnet codeanalysis-csharp codeanalysis-common codeanalysis-analyzers` \ espree typescript \ - -L /metacall/nonguix -L /metacall/source \ -`# Exit` && exit 0 || exit 1 + -L /metacall/nonguix -L /metacall/source diff --git a/source/metacall.scm b/source/metacall.scm index 55329c2..06c50b7 100644 --- a/source/metacall.scm +++ b/source/metacall.scm @@ -78,30 +78,6 @@ ) ; NodeJS Loader Dependencies -(define-public node-lts-386 -(package/inherit node-lts - (name "node-lts-386") - (arguments - (substitute-keyword-arguments (package-arguments node-lts) - ((#:phases phases '%standard-phases) - `(modify-phases ,phases - (add-before 'check 'delete-problematic-tests-386 - (lambda* (#:key inputs #:allow-other-keys) - ;; FIXME: These tests fail in 386 - (delete-file "test/parallel/test-fs-utimes-y2K38.js"))))))))) - -(define-public libnode-386 -(package/inherit libnode - (name "libnode-386") - (arguments - (substitute-keyword-arguments (package-arguments libnode) - ((#:phases phases '%standard-phases) - `(modify-phases ,phases - (add-before 'check 'delete-problematic-tests-386 - (lambda* (#:key inputs #:allow-other-keys) - ;; FIXME: These tests fail in 386 - (delete-file "test/parallel/test-fs-utimes-y2K38.js"))))))))) - (define-public espree (package (name "espree") @@ -449,8 +425,8 @@ for any host, on any OS. TypeScript compiles to readable, standards-based JavaSc `( ("python" ,python-3) ; Python Loader dependency ("ruby" ,ruby-2.7) ; Ruby Loader dependency - ("node" ,node-lts-386) ; NodeJS Loader dependency - ("libnode" ,libnode-386) ; NodeJS Loader dependency + ("node" ,node-lts) ; NodeJS Loader dependency + ("libnode" ,libnode) ; NodeJS Loader dependency ("libuv" ,libuv) ; NodeJS Loader dependency ("espree" ,espree) ; NodeJS Loader dependency ("typescript" ,typescript) ; TypeScript Loader dependency