Hello,

as requested I am reporting test failure that happens on unprivileged
daemon.  On normal GuixSD system running daemon under the root, the
package builds fine, but on Ubuntu-based GitLab runner (unprivileged
daemon) three tests do not pass.

This is not an AppArmor issue (since it was causing too many problems, I
have disabled it completely for Guix; I lack the skills to fix it by
myself).

All 4 node packages I have are failing, but for now let us start with
the fastest one to build, node v6:

--8<---------------cut here---------------start------------->8---
;;; Copyright (C) 2026 Tomas Volf <[email protected]>
;;; SPDX-License-Identifier: AGPL-3.0-only

;;; Commentary:

;; Collection of node packages at various old versions.  To make sure it keeps
;; working, bundled libraries are used.

;;; Code:

(define-module (wolfsden packages node)
  #:use-module (gnu packages)
  #:use-module (gnu packages base)
  #:use-module (gnu packages commencement)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages perl)
  #:use-module (gnu packages python)
  #:use-module (guix build-system gnu)
  #:use-module (guix download)
  #:use-module (guix gexp)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix utils))

(define-public node-6
  (package
    (name "node")
    (version "6.17.1")
    (source (origin
              (method url-fetch)
              (uri (string-append "http://nodejs.org/dist/v"; version
                                  "/node-v" version ".tar.gz"))
              (sha256
               (base32
                "1slx8n26kdngkqbfpp7b39fhzpxwsqrfbh370p5cf33pqv2qg93g"))))
    (build-system gnu-build-system)
    (arguments
     (list
      #:test-target "test-ci-js"
      #:configure-flags
      #~(list "--shared-zlib"
              ;; Necessary for reproducible build.
              "--without-snapshot")
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'fake-/etc/os-release
            (lambda _
              ;; Some tests try to detect Alpine based on /etc/os-release, but
              ;; we do not have the file in the build container.
              (let ((files
                     '(
                       ;; v18
                       "test/parallel/test-single-executable-application.js"
                       ;; v20
                       "test/common/sea.js")))
                (substitute* (filter file-exists? files)
                  (("/etc/os-release") "/etc/hosts")))))
          (add-after 'unpack 'delete-problematic-tests-6
            (lambda _
              (for-each
               delete-file
               '(
                 ;; Requires multiple network interfaces.
                 "test/parallel/test-dgram-multicast-set-interface-lo.js"
                 ;; v6 does not pack eslint into the tarball, weird choice.
                 "test/parallel/test-eslint-lowercase-name-for-primitive.js"
                 "test/parallel/test-eslint-number-isnan.js"
                 ;; Time bomb.
                 "test/parallel/test-tls-passphrase.js"))))
          (add-before 'configure 'patch-files
            (lambda* (#:key inputs #:allow-other-keys)
              ;; Fix hardcoded /bin/sh references.
              (let ((files
                     '("lib/child_process.js"
                       "test/parallel/test-child-process-spawnsync-shell.js"
                       "test/parallel/test-fs-write-sigxfsz.js"
                       "test/parallel/test-stdin-from-file-spawn.js" ;18+
                       "test/parallel/test-stdio-closed.js"
                       "test/sequential/test-child-process-emfile.js")))
                (substitute* (filter file-exists? files)
                  (("'/bin/sh'")
                   (string-append "'" (search-input-file inputs "bin/sh") 
"'"))))

              ;; Fix hardcoded /usr/bin/env references.
              (let ((files
                     '("test/fixtures/syntax/bad_syntax_shebang.js"  ;14
                       "test/fixtures/syntax/good_syntax_shebang.js" ;14
                       "test/parallel/test-child-process-default-options.js"
                       "test/parallel/test-child-process-env.js"
                       "test/parallel/test-child-process-exec-env.js")))
                (substitute* (filter file-exists? files)
                  (("'/usr/bin/env'")
                   (string-append "'" (search-input-file inputs "bin/env") 
"'"))))))
          (replace 'configure
            (lambda* (#:key inputs native-inputs configure-flags
                      #:allow-other-keys)
              (setenv "CC" #$(cc-for-target))
              (let* ((flags (cons* "--prefix" #$output configure-flags))
                     (inputs (or native-inputs inputs))
                     (python (or (false-if-exception
                                  (search-input-file inputs "/bin/python3"))
                                 (false-if-exception
                                  (search-input-file inputs "/bin/python2")))))
                (format #t "build directory: ~s~%" (getcwd))
                (format #t "python: ~s~%" python)
                (format #t "configure flags: ~s~%" flags)
                (apply invoke python "./configure" flags))))
          (add-after 'patch-shebangs 'patch-npm-shebang
            (lambda* _
              (with-directory-excursion (string-append #$output "/bin")
                (patch-shebang (readlink "npm")
                               (list (string-append #$output "/bin"))))))
          (add-after 'compress-documentation 'test-installed
            (lambda* _
              (invoke (string-append #$output "/bin/node") "--version")
              (invoke (string-append #$output "/bin/npm")  "--version"))))))
    (native-inputs (list gcc-toolchain-10
                         python-2
                         perl
                         procps
                         util-linux))
    (inputs (list zlib))
    (synopsis "Evented I/O for V8 JavaScript")
    (description "Node.js is a platform built on Chrome's JavaScript runtime for
easily building fast, scalable network applications.  Node.js uses an
event-driven, non-blocking I/O model that makes it lightweight and efficient,
perfect for data-intensive real-time applications that run across distributed
devices.")
    (home-page "http://nodejs.org/";)
    (license license:expat)))

node-6
--8<---------------cut here---------------end--------------->8---

On my GuixSD build server (root daemon) it builds:

--8<---------------cut here---------------start------------->8---
$ guix build -f /tmp/xxx.scm 
/gnu/store/bzh3qdy80nsklzkrk2z0zlqsalnd945p-node-6.17.1
--8<---------------cut here---------------end--------------->8---

On Ubuntu-based system (non-root daemon, no AppArmor) it fails in test
phase, with three failures:

--8<---------------cut here---------------start------------->8---
not ok 117 parallel/test-child-process-uid-gid
  ---
  duration_ms: 0.936
  severity: fail
  stack: |-
    assert.js:344
        throw actual;
        ^
    
    Error: spawn EINVAL
        at exports._errnoException (util.js:1020:11)
        at ChildProcess.spawn (internal/child_process.js:328:11)
        at exports.spawn (child_process.js:370:9)
        at assert.throws 
(/tmp/guix-build-node-6.17.1.drv-0/node-v6.17.1/test/parallel/test-child-process-uid-gid.js:9:5)
        at tryBlock (assert.js:305:5)
        at innerThrows (assert.js:322:18)
        at Function.throws (assert.js:350:3)
        at Object.<anonymous> 
(/tmp/guix-build-node-6.17.1.drv-0/node-v6.17.1/test/parallel/test-child-process-uid-gid.js:8:10)
        at Module._compile (module.js:577:32)
        at Object.Module._extensions..js (module.js:586:10)
  ...
--8<---------------cut here---------------end--------------->8---

--8<---------------cut here---------------start------------->8---
not ok 849 parallel/test-process-geteuid-getegid
  ---
  duration_ms: 0.716
  severity: fail
  stack: |-
    assert.js:344
        throw actual;
        ^
    
    Error: EINVAL, Invalid argument
        at Error (native)
        at assert.throws 
(/tmp/guix-build-node-6.17.1.drv-0/node-v6.17.1/test/parallel/test-process-geteuid-getegid.js:34:13)
        at tryBlock (assert.js:305:5)
        at innerThrows (assert.js:322:18)
        at Function.throws (assert.js:350:3)
        at Object.<anonymous> 
(/tmp/guix-build-node-6.17.1.drv-0/node-v6.17.1/test/parallel/test-process-geteuid-getegid.js:33:10)
        at Module._compile (module.js:577:32)
        at Object.Module._extensions..js (module.js:586:10)
        at Module.load (module.js:494:32)
        at tryModuleLoad (module.js:453:12)
  ...
--8<---------------cut here---------------end--------------->8---

--8<---------------cut here---------------start------------->8---
not ok 863 parallel/test-process-setuid-setgid
  ---
  duration_ms: 0.521
  severity: fail
  stack: |-
    assert.js:344
        throw actual;
        ^
    
    Error: EINVAL, Invalid argument
        at Error (native)
        at assert.throws 
(/tmp/guix-build-node-6.17.1.drv-0/node-v6.17.1/test/parallel/test-process-setuid-setgid.js:33:21)
        at tryBlock (assert.js:305:5)
        at innerThrows (assert.js:322:18)
        at Function.throws (assert.js:350:3)
        at Object.<anonymous> 
(/tmp/guix-build-node-6.17.1.drv-0/node-v6.17.1/test/parallel/test-process-setuid-setgid.js:32:10)
        at Module._compile (module.js:577:32)
        at Object.Module._extensions..js (module.js:586:10)
        at Module.load (module.js:494:32)
        at tryModuleLoad (module.js:453:12)
  ...
--8<---------------cut here---------------end--------------->8---

Tomas

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.



Reply via email to