From unknown Tue Aug 19 10:01:24 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#50261 <50261@debbugs.gnu.org> To: bug#50261 <50261@debbugs.gnu.org> Subject: Status: [PATCH] gnu: node: Enable cross-compilation. Reply-To: bug#50261 <50261@debbugs.gnu.org> Date: Tue, 19 Aug 2025 17:01:24 +0000 retitle 50261 [PATCH] gnu: node: Enable cross-compilation. reassign 50261 guix-patches submitter 50261 Pierre Langlois severity 50261 normal tag 50261 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 29 19:31:51 2021 Received: (at submit) by debbugs.gnu.org; 29 Aug 2021 23:31:51 +0000 Received: from localhost ([127.0.0.1]:57743 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKUHD-0004YJ-Tf for submit@debbugs.gnu.org; Sun, 29 Aug 2021 19:31:51 -0400 Received: from lists.gnu.org ([209.51.188.17]:40844) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKUHB-0004WM-Pe for submit@debbugs.gnu.org; Sun, 29 Aug 2021 19:31:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55906) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mKUHB-0003Sp-IE for guix-patches@gnu.org; Sun, 29 Aug 2021 19:31:45 -0400 Received: from mout.gmx.net ([212.227.15.15]:50413) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mKUH8-0002AQ-EX for guix-patches@gnu.org; Sun, 29 Aug 2021 19:31:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1630279899; bh=DtvswSsucaZ41VvihkagOeOXyNAvLVN8O0UuuvPlPUc=; h=X-UI-Sender-Class:From:To:Subject:Date; b=Qums9Jh+b6FmWCzMOj9PyL/UiutLoy2ukMo2Q5TuOB+SrOJfZR6elcRpahDoflzl0 XozyVKor6mtZrmVPNlEqE0tGNO6hYZXa8/+LngPqbWm9UUAw7XWQySEfg/67FOhIcW y5WroCCHBkPi9dOGp5UGtwUNGKVi6suiRVCYw7bc= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from labiere ([82.69.64.142]) by mail.gmx.net (mrgmx004 [212.227.17.184]) with ESMTPSA (Nemesis) id 1N3bWr-1n3YK144OZ-010doI for ; Mon, 30 Aug 2021 01:31:39 +0200 User-agent: mu4e 1.6.5; emacs 27.2 From: Pierre Langlois To: guix-patches@gnu.org Subject: [PATCH] gnu: node: Enable cross-compilation. Date: Sun, 29 Aug 2021 23:06:00 +0100 Message-ID: <87a6kzsu92.fsf@gmx.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K1:KumiYM/0n7epiV3SOc2LAh44WJ2NDNyfLZkvCtu35xzUm+q4WYA g8rlbZDoSwACJWx+EMK6kuUiURgB/X5IsSXik303HLz884aeQFVPdAB/3AoORizIuwFvRBM tC7VE6p7ALGgqhUaDq72Yq0eskwaDtjikdEJ+EK8fXgcwmPT9Bwu5j1Vq4kVL9D+ODiRi2+ uLsNeXS21CQSLy84Bs8Sg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:eWdy9dR2RIM=:zgoIaxekkLnuGFGXHe6jlj C6fGzMNV7Xpyzhr0VSlBZk4bl6J4fntSoatUU3b32ZZ9xjkJ6VIz2mIa7lp809FNq3NdMYFwr 0ZZfkn95lupMEbl+zPZnZrpo90hcsFgQrBw6xdTPIkreRKZGO9ck55UTG3tuUj+GtX9Jz6vM6 lnFC+OtrGM+tpy63/V3G+cb/G+RWIeo6gBKitsznrkAoY2QE4bRXeuanvsdUVAJ0xEbL5HYjP qimQCy67xOQ+fkeHoYFXyLV6z5Hg90h888zmvd6VUl1e+a/rVC3WPafmFilAPJ46dsC54/3PJ 9iZ8PeU8yxOebhPd2hR1yAgE5a/5G4ntn4WDCk3o64ccOLXsXZhuE9YpvuQnuF64x6i7AgVqx gFPzbTqTA3LNIg8E0p0msvi8TI+nS5iE0pQ9wSf0Why9N0c7JvDU/73TPuSJ135a/YcUl6mv8 kXgoMOtr37whwrkCDFc6oMkvSO4E9GgtswWpI6IR+B453BvD1rQsT/EP4kVslMaAQIV1D7/+1 Wb5QLJXw1Qae847xK+BZqVhpyO+CF3NHs3WV6YZ0Br9AtdzrxZrSj+/rqVovgGn7yLr6B92Tz Q9mReJF35V+9gTCqg6opo83h/rCGBLM4bJiFmLfp4x/ydi94CRVJfvwCqvJLqSGUap66w+Ydg 3abLC3J0b49ActGgyeAMHmtCn9Bq9HwVnUJOcH1nLVMVCpm9WkOpIhUIopsxSuD+qmXEuFyw4 q1Kjw/bj0+QiZYZN+ht/PMAqB7wqkqrd5GSGQl4HrGr9Y/eN1kgw9Oa7DRj3ppMFtiEGkWtk6 TTotvQoXYOA3x5Tubo5VJDC7YhIkxkWLPINx3RtBNwNGZvxIhpNFcWsfWIhWPRpOAlhZpApNv qHpWP2eKgJEk6knOWU5Kb+OUqSM0fPUcHZmbxCgnWnoSBQKPMs5nux6kxVvBrBYVqng+jzKZ2 ZztoDtGy44QLFlZUcBpNmA1HFht9UpTN49otJPCIT/FyddG+LZ0/41WuCIqilE375w9L59lTx Uk7M446o2ia5nHkgCdhd5YUaYc9/t5VwqxX8uofqgXIyxbeHf4d1YxRnQMW9SX5gbZNfVrXQQ 7NuakOOcstkJ5heqHyfgB4cu4Jylio4NOua3Vmwq7NqsKjgg+L2KSYZdA== Received-SPF: pass client-ip=212.227.15.15; envelope-from=pierre.langlois@gmx.com; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.1 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) --=-=-= Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" --==-=-= Content-Type: text/plain Hi Guix! While working on tree-sitter I realized our node packages didn't cross-compile [0] so I thought I'd give it a go, here's a patch! Note that fundamentally, because of how the V8 JavaScript engine bootstraps itself, cross-compiling only works for platforms with the same bitness. So a 32-bit binary cannot be produced on a 64-bit system, for example on x86_64: --8<---------------cut here---------------start------------->8--- # Build OK. $ guix build --target=aarch64-linux-gnu node # Will fail... $ guix build --target=arm-linux-gnueabihf node # ... unless the host is 32-bit. $ guix build --system=i686-linux --target=arm-linux-gnueabihf node --8<---------------cut here---------------end--------------->8--- I'm not sure there's any way to express this restriction in the package definition, it would be good to fail in a useful way, any thoughts? I suspect a mechanism for this isn't really worth the effort, I don't know of any other packages like this. As a drive-by, the esbuild package didn't build on 32-bit systems so I attached another patch for that. It was due to the build system using the "-race" option to detect race conditions in the tests, and this mechanism only works on 64-bit platforms. Thanks, Pierre [0]: https://lists.gnu.org/archive/html/guix-patches/2021-08/msg00646.html --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQFMBAEBCgA2FiEEctU9gYy29KFyWDdMqPyeRH9PfVQFAmEsGNkYHHBpZXJyZS5s YW5nbG9pc0BnbXguY29tAAoJEKj8nkR/T31U3UQH/2iqt6Va3LD1kCfyxwlyliGm dZOzEz07i/sbHmljI41uxDb3ikG8ETCXHYqnAguW3qjH0LIP7O2jqJuZNZG/s8fT bMtfE7Vfd1E+mACpT8cAH9Syahju6HmWUmDaH7x5e9MTlj7TqsgMT/sA00jFvlLY lWm9OakqT3tPK7k11Yk57NJCZTdxHR0z0ZhBP9etdQ0h9K2IBruIhlFJkFL1aNIA iUtAHWvNwxHmBic3TOrAHGOUvUGNjWKPW3nORQKTz30gQ2N1T9+39cw+0Mcbh7mI Qzos0gAcBL/+Vc7ocIF1DUglY0eRWGMD2OSG27wcHNu6ThjzeeAGE3DzOugbmKo= =tw+x -----END PGP SIGNATURE----- --==-=-=-- --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-gnu-node-Enable-cross-compilation.patch Content-Transfer-Encoding: quoted-printable >From 8b4cc4573d438eb108b8d1a9bcdf99f3af98b514 Mon Sep 17 00:00:00 2001 From: Pierre Langlois Date: Wed, 11 Aug 2021 16:43:45 +0100 Subject: [PATCH 1/2] gnu: node: Enable cross-compilation. Node runs parts of itself on the host for bootstraping therefore for cross-compiling support we need to fidle with the rpath in the build system, as well as duplicating some of the dependencies as native-inputs and inputs. * gnu/pakcages/node.scm (node)[arguments]: Refer to /bin/sh and /bin/env directly instead of using (which). Add new 'set-bootstrap-host-rpath phase to correctly set the rpath for binaries that are meant to run on the host. Pass --cross-compiling and --dest-cpu to configure script if needed. Set t= he CC_host, CXX_host, CC, CCX and PKG_CONFIG variable for cross-compilation. Refer to the host python. Do not return #t from any phases. [native-inputs]: Add c-ares, http-parser, icu4c, libuv, nghttp2, openssl and zlib. Remove which. [inputs]: Add bash and coreutils. (llhttp-bootstrap)[arguments]: Refer to esbuild via (or native-inputs input= s). (node-lts)[arguments]: Add new 'set-bootstrap-host-rpath phase to correctly set the rpath for host binaries. Pass --cross-compiling and --dest-cpu to configure script if needed. Set the CC_host, CXX_host, CCX and PKG_CONFIG variable for cross-compilation. Refer to the host python. Do not return #t from any phases. Refer to /bin/sh and /bin/env directly instead of using (which). Do not return #t from any phases. [native-inputs]: Hardcode native inputs instead of inheriting them from nod= e. [inputs]: Add bash and coreutils. --- gnu/packages/node.scm | 188 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 153 insertions(+), 35 deletions(-) diff --git a/gnu/packages/node.scm b/gnu/packages/node.scm index 36c45e9c7a..2dc23b881c 100644 --- a/gnu/packages/node.scm +++ b/gnu/packages/node.scm @@ -6,7 +6,7 @@ ;;; Copyright =C2=A9 2017 Mike Gerwitz ;;; Copyright =C2=A9 2018 Tobias Geerinckx-Rice ;;; Copyright =C2=A9 2018, 2019, 2020, 2021 Marius Bakke -;;; Copyright =C2=A9 2020 Pierre Langlois +;;; Copyright =C2=A9 2020, 2021 Pierre Langlois ;;; Copyright =C2=A9 2020 Ricardo Wurmus ;;; Copyright =C2=A9 2021 Simon Tournier ;;; @@ -38,6 +38,7 @@ #:use-module (gnu packages) #:use-module (gnu packages adns) #:use-module (gnu packages base) + #:use-module (gnu packages bash) #:use-module (gnu packages compression) #:use-module (gnu packages gcc) #:use-module (gnu packages icu4c) @@ -48,7 +49,9 @@ #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) #:use-module (gnu packages tls) - #:use-module (gnu packages web)) + #:use-module (gnu packages web) + #:use-module (ice-9 match) + #:use-module (srfi srfi-26)) =20 (define-public node (package @@ -111,14 +114,14 @@ "test/parallel/test-stdio-closed.js" "test/sequential/test-child-process-emfile.js") (("'/bin/sh'") - (string-append "'" (which "sh") "'"))) + (string-append "'" (assoc-ref inputs "bash") "/bin/sh'"))) =20 ;; Fix hardcoded /usr/bin/env references. (substitute* '("test/parallel/test-child-process-default-opti= ons.js" "test/parallel/test-child-process-env.js" "test/parallel/test-child-process-exec-env.js") (("'/usr/bin/env'") - (string-append "'" (which "env") "'"))) + (string-append "'" (assoc-ref inputs "coreutils") "/bin/en= v'"))) =20 ;; FIXME: These tests fail in the build container, but they d= on't ;; seem to be indicative of real problems in practice. @@ -155,23 +158,65 @@ ;; TODO: Regenerate certs instead. (for-each delete-file '("test/parallel/test-tls-passphrase.js" - "test/parallel/test-tls-server-verify.js")) - #t)) + "test/parallel/test-tls-server-verify.js")))) + (add-before 'configure 'set-bootstrap-host-rpath + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (let* ((inputs (or native-inputs inputs)) + (c-ares (assoc-ref inputs "c-ares")) + (http-parser (assoc-ref inputs "http-parser")) + (icu4c (assoc-ref inputs "icu4c")) + (nghttp2 (assoc-ref inputs "nghttp2")) + (openssl (assoc-ref inputs "openssl")) + (libuv (assoc-ref inputs "libuv")) + (zlib (assoc-ref inputs "zlib"))) + (substitute* "deps/v8/gypfiles/v8.gyp" + (("'target_name': 'torque'," target) + (string-append target + "'ldflags': ['-Wl,-rpath=3D" + c-ares "/lib:" + http-parser "/lib:" + icu4c "/lib:" + nghttp2 "/lib:" + openssl "/lib:" + libuv "/lib:" + zlib "/lib" + "'],")))))) (replace 'configure ;; Node's configure script is actually a python script, so we c= an't ;; run it with bash. - (lambda* (#:key outputs (configure-flags '()) inputs + (lambda* (#:key outputs (configure-flags '()) native-inputs inp= uts #:allow-other-keys) (let* ((prefix (assoc-ref outputs "out")) - (flags (cons (string-append "--prefix=3D" prefix) - configure-flags))) + (flags (cons* + (string-append "--prefix=3D" prefix) + ,@(if (%current-target-system) + `("--cross-compiling" + ,(string-append "--dest-cpu=3D" + (match (%current-target-system) + ((? (cut string-prefix? "arm" <>)) + "arm") + ((? (cut string-prefix? "aarch64" = <>)) + "arm64") + ((? (cut string-prefix? "i686" <>)) + "ia32") + ((? (cut string-prefix? "x86_64" <= >)) + "x64") + ((? (cut string-prefix? "powerpc64= " <>)) + "ppc64") + (_ "unsupported")))) + '()) + configure-flags))) (format #t "build directory: ~s~%" (getcwd)) (format #t "configure flags: ~s~%" flags) ;; Node's configure script expects the CC environment varia= ble to ;; be set. - (setenv "CC" (string-append (assoc-ref inputs "gcc") "/bin/= gcc")) + (setenv "CC_host" "gcc") + (setenv "CXX_host" "g++") + (setenv "CC" ,(cc-for-target)) + (setenv "CXX" ,(cxx-for-target)) + (setenv "PKG_CONFIG" ,(pkg-config-for-target)) (apply invoke - (string-append (assoc-ref inputs "python") + (string-append (assoc-ref (or native-inputs inputs) = "python") "/bin/python") "configure" flags)))) (add-after 'patch-shebangs 'patch-npm-shebang @@ -181,29 +226,37 @@ (npm (string-append bindir "/npm")) (target (readlink npm))) (with-directory-excursion bindir - (patch-shebang target (list bindir)) - #t)))) + (patch-shebang target (list bindir)))))) (add-after 'install 'patch-node-shebang (lambda* (#:key outputs #:allow-other-keys) (let* ((bindir (string-append (assoc-ref outputs "out") "/bin")) (npx (readlink (string-append bindir "/npx")))) (with-directory-excursion bindir - (patch-shebang npx (list bindir)) - #t))))))) + (patch-shebang npx (list bindir))))))))) (native-inputs - `(("python" ,python-2) + `(;; Runtime dependencies for binaries used as a bootstrap. + ("c-ares" ,c-ares) + ("http-parser" ,http-parser) + ("icu4c" ,icu4c) + ("libuv" ,libuv) + ("nghttp2" ,nghttp2 "lib") + ("openssl" ,openssl) + ("zlib" ,zlib) + ;; Regular build-time dependencies. ("perl" ,perl) ("pkg-config" ,pkg-config) ("procps" ,procps) - ("util-linux" ,util-linux) - ("which" ,which))) + ("python" ,python-2) + ("util-linux" ,util-linux))) (native-search-paths (list (search-path-specification (variable "NODE_PATH") (files '("lib/node_modules"))))) (inputs - `(("c-ares" ,c-ares) + `(("bash" ,bash) + ("coreutils" ,coreutils) + ("c-ares" ,c-ares) ("http-parser" ,http-parser) ("icu4c" ,icu4c) ("libuv" ,libuv) @@ -551,9 +604,10 @@ parser definition into a C output.") #:phases (modify-phases %standard-phases (replace 'configure - (lambda* (#:key inputs #:allow-other-keys) - (let ((esbuild (string-append (assoc-ref inputs "esbuild") - "/bin/esbuild"))) + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (let ((esbuild (string-append + (assoc-ref (or native-inputs inputs) "esbuil= d") + "/bin/esbuild"))) (invoke esbuild "--platform=3Dnode" "--outfile=3Dbin/generate.js" @@ -625,21 +679,72 @@ source files.") "--with-intl=3Dsystem-icu")) ((#:phases phases) `(modify-phases ,phases + (replace 'set-bootstrap-host-rpath + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (let* ((inputs (or native-inputs inputs)) + (c-ares (assoc-ref inputs "c-ares")) + (google-brotli (assoc-ref inputs "google-brotli")) + (icu4c (assoc-ref inputs "icu4c")) + (nghttp2 (assoc-ref inputs "nghttp2")) + (openssl (assoc-ref inputs "openssl")) + (libuv (assoc-ref inputs "libuv")) + (zlib (assoc-ref inputs "zlib")) + (host-binaries '("torque" + "bytecode_builtins_list_generator" + "gen-regexp-special-case" + "node_mksnapshot" + "mksnapshot"))) + (substitute* '("node.gyp" "tools/v8_gypfiles/v8.gyp") + (((string-append "'target_name': '(" + (string-join host-binaries "|") + ")',") + target) + (string-append target + "'ldflags': ['-Wl,-rpath=3D" + c-ares "/lib:" + google-brotli "/lib:" + icu4c "/lib:" + nghttp2 "/lib:" + openssl "/lib:" + libuv "/lib:" + zlib "/lib" + "'],")))))) (replace 'configure ;; Node's configure script is actually a python script, so we= can't ;; run it with bash. - (lambda* (#:key outputs (configure-flags '()) inputs + (lambda* (#:key outputs (configure-flags '()) native-inputs i= nputs #:allow-other-keys) (let* ((prefix (assoc-ref outputs "out")) - (flags (cons (string-append "--prefix=3D" prefix) - configure-flags))) + (flags (cons* + (string-append "--prefix=3D" prefix) + ,@(if (%current-target-system) + `("--cross-compiling" + ,(string-append "--dest-cpu=3D" + (match (%current-target-system) + ((? (cut string-prefix? "arm" <>= )) + "arm") + ((? (cut string-prefix? "aarch64= " <>)) + "arm64") + ((? (cut string-prefix? "i686" <= >)) + "ia32") + ((? (cut string-prefix? "x86_64"= <>)) + "x64") + ((? (cut string-prefix? "powerpc= 64" <>)) + "ppc64") + (_ "unsupported")))) + '()) + configure-flags))) (format #t "build directory: ~s~%" (getcwd)) (format #t "configure flags: ~s~%" flags) ;; Node's configure script expects the CC environment var= iable to ;; be set. + (setenv "CC_host" "gcc") + (setenv "CXX_host" "g++") (setenv "CC" ,(cc-for-target)) + (setenv "CXX" ,(cxx-for-target)) + (setenv "PKG_CONFIG" ,(pkg-config-for-target)) (apply invoke - (string-append (assoc-ref inputs "python") + (string-append (assoc-ref (or native-inputs inputs= ) "python") "/bin/python3") "configure" flags)))) (replace 'patch-files @@ -652,14 +757,14 @@ source files.") "test/parallel/test-stdio-closed.js" "test/sequential/test-child-process-emfile.j= s") (("'/bin/sh'") - (string-append "'" (which "sh") "'"))) + (string-append "'" (assoc-ref inputs "bash") "/bin/sh'")= )) =20 ;; Fix hardcoded /usr/bin/env references. (substitute* '("test/parallel/test-child-process-default-op= tions.js" "test/parallel/test-child-process-env.js" "test/parallel/test-child-process-exec-env.j= s") (("'/usr/bin/env'") - (string-append "'" (which "env") "'"))) + (string-append "'" (assoc-ref inputs "coreutils") "/bin/= env'"))) =20 ;; FIXME: These tests fail in the build container, but they= don't ;; seem to be indicative of real problems in practice. @@ -707,20 +812,33 @@ source files.") (copy-file (string-append llhttp "/src/http.c") "deps/llhttp/src/http.c") (copy-file (string-append llhttp "/include/llhttp.h") - "deps/llhttp/include/llhttp.h")) - #t)))))) + "deps/llhttp/include/llhttp.h")))))))) + (native-inputs + `(;; Runtime dependencies for binaries used as a bootstrap. + ("c-ares" ,c-ares) + ("google-brotli" ,google-brotli) + ("icu4c" ,icu4c-67) + ("libuv" ,libuv-for-node) + ("nghttp2" ,nghttp2 "lib") + ("openssl" ,openssl) + ("zlib" ,zlib) + ;; Regular build-time dependencies. + ("perl" ,perl) + ("pkg-config" ,pkg-config) + ("procps" ,procps) + ("python" ,python) + ("util-linux" ,util-linux))) (inputs - `(("c-ares" ,c-ares) + `(("bash" ,bash) + ("coreutils" ,coreutils) + ("c-ares" ,c-ares) ("icu4c" ,icu4c-67) ("libuv" ,libuv-for-node) ("llhttp" ,llhttp-bootstrap) ("google-brotli" ,google-brotli) ("nghttp2" ,nghttp2 "lib") ("openssl" ,openssl) - ("zlib" ,zlib))) - (native-inputs - (alist-replace "python" (list python-3) - (package-native-inputs node))))) + ("zlib" ,zlib))))) =20 (define-public libnode (package/inherit node --=20 2.33.0 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0002-gnu-esbuild-Disable-race-detector-on-32-bit-targets.patch Content-Transfer-Encoding: quoted-printable =46rom 17cd8ccb2255d4bb392a94468abeb785e134ff1e Mon Sep 17 00:00:00 2001 From: Pierre Langlois Date: Mon, 30 Aug 2021 00:25:58 +0100 Subject: [PATCH 2/2] gnu: esbuild: Disable race detector on 32-bit targets= . * gnu/packages/web.scm (esbuild)[arguments]: Set the ESBUILD_RACE variable to an empty string to remove the -race option. =2D-- gnu/packages/web.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index f0ac9ccee2..5817d2dd95 100644 =2D-- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -1672,13 +1672,17 @@ used to validate and fix HTML data.") #t)))) (build-system go-build-system) (arguments - '(#:import-path "github.com/evanw/esbuild/cmd/esbuild" + `(#:import-path "github.com/evanw/esbuild/cmd/esbuild" #:unpack-path "github.com/evanw/esbuild" #:phases (modify-phases %standard-phases (replace 'check (lambda* (#:key tests? unpack-path #:allow-other-keys) (when tests? + ;; The "Go Race Detector" is only supported on 64-bit + ;; platforms, this variable disables it. + (unless ,(target-64bit?) + (setenv "ESBUILD_RACE" "")) (with-directory-excursion (string-append "src/" unpack-pat= h) (invoke "make" "test-go"))) #t))))) =2D- 2.33.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 31 09:42:15 2021 Received: (at 50261) by debbugs.gnu.org; 31 Aug 2021 13:42:15 +0000 Received: from localhost ([127.0.0.1]:33300 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL41n-0004R3-6z for submit@debbugs.gnu.org; Tue, 31 Aug 2021 09:42:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38248) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL41k-0004Qm-77 for 50261@debbugs.gnu.org; Tue, 31 Aug 2021 09:42:14 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36118) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL41e-0007Ep-K5; Tue, 31 Aug 2021 09:42:06 -0400 Received: from [2a01:e0a:19b:d9a0:f2f7:a404:c3d3:f8b4] (port=37380 helo=meije) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL41H-0008Pw-TC; Tue, 31 Aug 2021 09:41:51 -0400 From: Mathieu Othacehe To: Pierre Langlois Subject: Re: bug#50261: [PATCH] gnu: node: Enable cross-compilation. References: <87a6kzsu92.fsf@gmx.com> Date: Tue, 31 Aug 2021 15:41:39 +0200 In-Reply-To: <87a6kzsu92.fsf@gmx.com> (Pierre Langlois's message of "Sun, 29 Aug 2021 23:06:00 +0100") Message-ID: <87h7f568a4.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50261 Cc: 50261@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello Pierre, > While working on tree-sitter I realized our node packages didn't > cross-compile [0] so I thought I'd give it a go, here's a patch! Nice! > I'm not sure there's any way to express this restriction in the package > definition, it would be good to fail in a useful way, any thoughts? I > suspect a mechanism for this isn't really worth the effort, I don't know > of any other packages like this. Yeah that's a strange limitation, I don't think we have something similar elsewhere. A restriction that compares the host and target bitness is maybe not worth it. > - (string-append (assoc-ref inputs "python") > + (string-append (assoc-ref (or native-inputs inputs) "python") You have several lines such as this one that are longer than the 78 columns limit. Other than that, it looks cool, and you can go ahead. Thanks, Mathieu From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 02 16:03:33 2021 Received: (at 50261-done) by debbugs.gnu.org; 2 Sep 2021 20:03:33 +0000 Received: from localhost ([127.0.0.1]:42123 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLsvt-0004FJ-Iw for submit@debbugs.gnu.org; Thu, 02 Sep 2021 16:03:33 -0400 Received: from mout.gmx.net ([212.227.15.15]:33185) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLsvq-0004F3-Me for 50261-done@debbugs.gnu.org; Thu, 02 Sep 2021 16:03:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1630613004; bh=wQAWq+TTpYEeDgwErTwqZNoKHmHpybxsqfxywLAdkLE=; h=X-UI-Sender-Class:References:From:To:Cc:Subject:Date:In-reply-to; b=isoTM1hEAqlSsvmHh2UR7b8xtEVczWXdBGqOpyG/a5NVsRHZq5PW48lTgkL5rFqFQ gSriQOpgmb5hAdFfQLHC12LZ2m1xbmp1YfjrjvyjgDmbp5zKAI0WMMIzNiGHAdkNvR AxSn1ibQGjBbiKsLMZ6ANsANlvMig069KPL5tcbI= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from labiere ([82.69.64.142]) by mail.gmx.net (mrgmx004 [212.227.17.184]) with ESMTPSA (Nemesis) id 1MryXH-1mipIM3xrB-00nwjv; Thu, 02 Sep 2021 22:03:24 +0200 References: <87a6kzsu92.fsf@gmx.com> <87h7f568a4.fsf@gnu.org> User-agent: mu4e 1.6.5; emacs 27.2 From: Pierre Langlois To: Mathieu Othacehe Subject: Re: bug#50261: [PATCH] gnu: node: Enable cross-compilation. Date: Thu, 02 Sep 2021 20:51:49 +0100 In-reply-to: <87h7f568a4.fsf@gnu.org> Message-ID: <871r66pwxk.fsf@gmx.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Provags-ID: V03:K1:2f3qZDdXWau547cWK6Fw+XfdAJnkmmovXdW5zDNZZVryfLA+f0/ eL9xBjQrm5Suzyw4+fOcbQvxmGeMhHehHZvO6sbGsi514kmN04dYh+I4EQJqt9At22hqLyE NAR5DqLJlZJpHff6OBDgqegSmsOPkCRbcRIEAl99fvYyG91rhvCNtEkriSm9xbxz+2n27J4 SCDqxGMJXK8/UgbL6kjUw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:SScbxqhrvpg=:qI4Dmif97RBi1AeDeps30p bYASX4nJgh8rAWLFwM+pCQWrhdr6gL/0QXHqJd+E0z/Ys2t8O+QSye8v180Xekwc1dxKJuWm+ AIP2vdXPlETMWA8jivOXwmMY2AVK8ZO6PUVJIQg1PbJIHakM1bV4vqWGXhn3j5R+Gx5OGqwkL XzbQYxu5CXPLup0MS/Uvt7AbRSVev6zsPw5y8wJzNhztEsm8QUpSJDipovTXE5SXQ8Vp7DsB7 I67mcx8K8K9kEJEGCHMuQ2jphzC8o+KAP+p/00RYy/wmPP0H43nCrXc/YsZ+NSu0uT5S3Z20m n/LipTQdUgNpeG9aS1CCl4eXwG3XnS3RjxSxrhSxdj2ObxqImqOvZrt+qpTgt0K5G9Lc5yY+N kaULFN2NkFOWvZoKqaO7DNCtCAjtw3RuAuEFBRpDIFJ4+JBruxxIZkt0SZ46d3PmLlNO0RkAC Skasd+0ssJNRoGQt8EvzrUEUSXwC63UtP0KMjRkucafmEvlhXSJ6ZM+Zpsz1W7rWlPDhBJmjR LE78eUJyNSp8ampsj59sCVLc4k1kiq0VeXbSWTIeAkDuId/kCQZOO28zxn/oA2tS4IGi9elXu OZVS4XfqDHca3V6YEjC91T1aqaZamSHMRBd0u/qK3t0sMd6+FlQlhQt10MkoEEQHYoVdzrYTA dhFUN/fKpmhl63EssUkFKhkN/YopLfuox815KRcDUp0/KHJ8XvEK9Kr5XWF6c2y6EU5vqDKcs m4LKeOl3YD0bgvngV5QtYQGLajgVxTMo2Lu2ecG99UPNO7YYHW1axnKdcmUhZ3MHMET6hEchY orghUKu9nMaDuWitEpI7oamLmCK3izhik6ChLqJ3e2pGIiMs2Hx/lyo2vyX5MmvfYlLiak2ef MIGnc6iKtEXjn6kA1f/dDi3h5LJlDOCG0RQYQTYP6R1SoitCMPnIwReEq62Ghe+M+HmoD8sHT N2YURGrH0m3HD2w5ZdGmQVM+ovUe+CFnTjWkIuCscUNBX3GUVQS9sBfO/2+1ToiWwi4WQ78cn t0lA4V2nSGskv0Sqm+qKbOCYm9L9UKdR9JiNuuTGUOCBY9YaMn/H7mLhJYhujsm5CGC0Jou9l 01C4zuNEJDTB5zQ+Kej8aGtBHGrnIDG9/H4Jbzu3GR0wK7maIMjfO1hfg== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 50261-done Cc: 50261-done@debbugs.gnu.org, Pierre Langlois X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Hi Mathieu, Mathieu Othacehe writes: > Hello Pierre, > >> While working on tree-sitter I realized our node packages didn't >> cross-compile [0] so I thought I'd give it a go, here's a patch! > > Nice! > >> I'm not sure there's any way to express this restriction in the package >> definition, it would be good to fail in a useful way, any thoughts? I >> suspect a mechanism for this isn't really worth the effort, I don't know >> of any other packages like this. > > Yeah that's a strange limitation, I don't think we have something > similar elsewhere. A restriction that compares the host and target > bitness is maybe not worth it. > >> - (string-append (assoc-ref inputs "python") >> + (string-append (assoc-ref (or native-inputs inputs) "python") > > You have several lines such as this one that are longer than the 78 > columns limit. I did my best to fix those by reworking the configure flags as such: --8<---------------cut here---------------start------------->8--- (let* ((prefix (assoc-ref outputs "out")) (xflags ,(if (%current-target-system) `'("--cross-compiling" ,(string-append "--dest-cpu=" (match (%current-target-system) ((? (cut string-prefix? "arm" <>)) "arm") ((? (cut string-prefix? "aarch64" <>)) "arm64") ((? (cut string-prefix? "i686" <>)) "ia32") ((? (cut string-prefix? "x86_64" <>)) "x64") ((? (cut string-prefix? "powerpc64" <>)) "ppc64") (_ "unsupported")))) ''())) (flags (cons (string-append "--prefix=" prefix) (append xflags configure-flags)))) --8<---------------cut here---------------end--------------->8--- It's still one column over, but I figured it was OK, I couldn't find another way to write it without sacrificing readability, hope that's OK :-). > Other than that, it looks cool, and you can go ahead. Thanks for the review! Pushed with 9f7c4f380fdd86d81c805b72e4d05e9e658d3dc2 and 5ee38c467298091e98fa12be45facdcc63a59a87. Pierre --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQFMBAEBCgA2FiEEctU9gYy29KFyWDdMqPyeRH9PfVQFAmExLgcYHHBpZXJyZS5s YW5nbG9pc0BnbXguY29tAAoJEKj8nkR/T31UPNoH/0oKiZ5rfZNCf2JHkb/a1u5J 7cSxQxoiugOe7FE/cZoQ+jTb/D9z+ZfIkbInVYhuVZCG14geaCl0nOxWT64eqEyr rWSLyB/zPc6lxkWwG+WkwipSYQDHSQfHsd/ACjMWzli/Zcbk0LTF3lxN6LWh0IpT Wrkietmhqaw58AmnPs2wC+TpziAzvw20uzxnQsyrpTowgG9fcniv3MQVtyANPYfP 0qPI75S8LeJVoF5KJfL1pirMbEBekq651rXdoU2a1OmY3lUx2/obrHA/27WTFctq FVWvzQJea6W6RfcFm/9rJwCFuQXFFklY1F/Xbssr0RPghpKkL6tEgpfMhsBZyjY= =F1JN -----END PGP SIGNATURE----- --=-=-=-- From unknown Tue Aug 19 10:01:24 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 01 Oct 2021 11:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator