Skip to content

Commit

Permalink
Trying to solve issues, remove qemu for amd64, improve script.
Browse files Browse the repository at this point in the history
  • Loading branch information
viferga committed Dec 13, 2024
1 parent 341667a commit 5d02a44
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 45 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
if: ${{ matrix.arch }} != amd64
with:
platforms: all

Expand Down Expand Up @@ -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

Expand Down
30 changes: 20 additions & 10 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
30 changes: 21 additions & 9 deletions scripts/deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
28 changes: 2 additions & 26 deletions source/metacall.scm
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5d02a44

Please sign in to comment.