From patchwork Tue Mar 30 05:27:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timothy Sample X-Patchwork-Id: 28192 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id EA12B27BC63; Tue, 30 Mar 2021 06:30:13 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 5667D27BC64 for ; Tue, 30 Mar 2021 06:30:12 +0100 (BST) Received: from localhost ([::1]:54658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lR6x9-0001oO-FB for patchwork@mira.cbaines.net; Tue, 30 Mar 2021 01:30:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40092) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lR6x1-0001nD-LJ for guix-patches@gnu.org; Tue, 30 Mar 2021 01:30:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38548) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lR6x1-0001KY-E9 for guix-patches@gnu.org; Tue, 30 Mar 2021 01:30:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lR6x1-0005n5-Af for guix-patches@gnu.org; Tue, 30 Mar 2021 01:30:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47282] [PATCH v2 13/13] gnu: Add node-lts. Resent-From: Timothy Sample Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 30 Mar 2021 05:30:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47282 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 47282@debbugs.gnu.org Cc: Jelle Licht Received: via spool by 47282-submit@debbugs.gnu.org id=B47282.161708214722137 (code B ref 47282); Tue, 30 Mar 2021 05:30:03 +0000 Received: (at 47282) by debbugs.gnu.org; 30 Mar 2021 05:29:07 +0000 Received: from localhost ([127.0.0.1]:50093 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lR6w6-0005ki-UN for submit@debbugs.gnu.org; Tue, 30 Mar 2021 01:29:07 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:59027) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lR6vx-0005ig-HK for 47282@debbugs.gnu.org; Tue, 30 Mar 2021 01:28:58 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 731F35C017D; Tue, 30 Mar 2021 01:28:52 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 30 Mar 2021 01:28:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=rMR/7beTDsdT3kmJffi1nTSh8klMzsL5F7x6BgGnY5s=; b=un6z9/r5 8H118PJ621+55qUT8vgQBoxik57aeFe1YDmje6jQHs5QTQz88PRvWVGscI0MZI7W KLoMcp+PcGkGXFQYvaT1rsEwQhiv3ItGnfkct7RYLEfMyhftr68AM7b7DFhp9uaj fscEIfCqh9GGghxNDsqh1HR+8eaNUGq3Jf/sBdoNGL1nm960hyULihPVAfPnqqOG 0RQSq/amd2tm6GBLvxT+60Ze/1N/ujZ/3QxD7efGRxXyGoUYmBSmqLo9TF3Ajvwf S4GyE1EkX6BSBGM2L9Euuf8IyIB4LttNekdGPUSX/IPsknOAFKHQpOjIj10GKw1f hsJomoPJ0ktT4Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudehledgleelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvihhmohht hhihucfurghmphhlvgcuoehsrghmphhlvghtsehnghihrhhordgtohhmqeenucggtffrrg htthgvrhhnpedvueekfeduteffgeekudegueffheeuledttdegjefguedutdfgkeettdet keegleenucffohhmrghinhepnhhouggvjhhsrdhorhhgpdhgihhthhhusgdrtghomhenuc fkphepjeegrdduudeirddukeeirdeggeenucevlhhushhtvghrufhiiigvpedtnecurfgr rhgrmhepmhgrihhlfhhrohhmpehsrghmphhlvghtsehnghihrhhordgtohhm X-ME-Proxy: Received: from mrblack.lan (74-116-186-44.qc.dsl.ebox.net [74.116.186.44]) by mail.messagingengine.com (Postfix) with ESMTPA id 39299240057; Tue, 30 Mar 2021 01:28:52 -0400 (EDT) From: Timothy Sample Date: Tue, 30 Mar 2021 01:27:43 -0400 Message-Id: <20210330052743.575-13-samplet@ngyro.com> X-Mailer: git-send-email 2.31.0 In-Reply-To: <87k0pprz6n.fsf@ngyro.com> References: <87k0pprz6n.fsf@ngyro.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches From: Jelle Licht * gnu/packages/node.scm (node-lts): New variable. * guix/build-system/node.scm (default-node): Use it. --- gnu/packages/node.scm | 135 +++++++++++++++++++++++++++++++++++++ guix/build-system/node.scm | 2 +- 2 files changed, 136 insertions(+), 1 deletion(-) diff --git a/gnu/packages/node.scm b/gnu/packages/node.scm index 45e5f8feca..249241f110 100644 --- a/gnu/packages/node.scm +++ b/gnu/packages/node.scm @@ -580,6 +580,141 @@ parser definition into a C output.") source files.") (license license:expat))) +(define-public node-lts + (package + (inherit node) + (version "14.16.0") + (source (origin + (method url-fetch) + (uri (string-append "https://nodejs.org/dist/v" version + "/node-v" version ".tar.xz")) + (sha256 + (base32 + "19nz2mhmn6ikahxqyna1dn25pb5v3z9vsz9zb2flb6zp2yk4hxjf")) + (modules '((guix build utils))) + (snippet + `(begin + ;; Remove bundled software, where possible + (for-each delete-file-recursively + '("deps/cares" + "deps/icu-small" + "deps/nghttp2" + "deps/openssl" + "deps/zlib")) + (substitute* "Makefile" + ;; Remove references to bundled software. + (("deps/uv/uv.gyp") "") + (("deps/zlib/zlib.gyp") "")) + #t)))) + (arguments + (substitute-keyword-arguments (package-arguments node) + ((#:configure-flags configure-flags) + ''("--shared-cares" + "--shared-libuv" + "--shared-nghttp2" + "--shared-openssl" + "--shared-zlib" + "--shared-brotli" + "--with-intl=system-icu")) + ((#:phases phases) + `(modify-phases ,phases + (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 + #:allow-other-keys) + (let* ((prefix (assoc-ref outputs "out")) + (flags (cons (string-append "--prefix=" prefix) + configure-flags))) + (format #t "build directory: ~s~%" (getcwd)) + (format #t "configure flags: ~s~%" flags) + ;; Node's configure script expects the CC environment variable to + ;; be set. + (setenv "CC" (string-append (assoc-ref inputs "gcc") "/bin/gcc")) + (apply invoke + (string-append (assoc-ref inputs "python") + "/bin/python3") + "configure" flags)))) + (replace 'patch-files + (lambda* (#:key inputs #:allow-other-keys) + ;; Fix hardcoded /bin/sh references. + (substitute* '("lib/child_process.js" + "lib/internal/v8_prof_polyfill.js" + "test/parallel/test-child-process-spawnsync-shell.js" + "test/parallel/test-fs-write-sigxfsz.js" + "test/parallel/test-stdio-closed.js" + "test/sequential/test-child-process-emfile.js") + (("'/bin/sh'") + (string-append "'" (which "sh") "'"))) + + ;; Fix hardcoded /usr/bin/env references. + (substitute* '("test/parallel/test-child-process-default-options.js" + "test/parallel/test-child-process-env.js" + "test/parallel/test-child-process-exec-env.js") + (("'/usr/bin/env'") + (string-append "'" (which "env") "'"))) + + ;; FIXME: These tests fail in the build container, but they don't + ;; seem to be indicative of real problems in practice. + (for-each delete-file + '("test/parallel/test-cluster-master-error.js" + "test/parallel/test-cluster-master-kill.js")) + + ;; These require a DNS resolver. + (for-each delete-file + '("test/parallel/test-dns.js" + "test/parallel/test-dns-lookupService-promises.js")) + + ;; FIXME: This test fails randomly: + ;; https://github.com/nodejs/node/issues/31213 + (delete-file "test/parallel/test-net-listen-after-destroying-stdin.js") + + ;; FIXME: These tests fail on armhf-linux: + ;; https://github.com/nodejs/node/issues/31970 + ,@(if (string-prefix? "arm" (%current-system)) + '((for-each delete-file + '("test/parallel/test-zlib.js" + "test/parallel/test-zlib-brotli.js" + "test/parallel/test-zlib-brotli-flush.js" + "test/parallel/test-zlib-brotli-from-brotli.js" + "test/parallel/test-zlib-brotli-from-string.js" + "test/parallel/test-zlib-convenience-methods.js" + "test/parallel/test-zlib-random-byte-pipes.js" + "test/parallel/test-zlib-write-after-flush.js"))) + '()) + + ;; These tests have an expiry date: they depend on the validity of + ;; TLS certificates that are bundled with the source. We want this + ;; package to be reproducible forever, so remove those. + ;; TODO: Regenerate certs instead. + (for-each delete-file + '("test/parallel/test-tls-passphrase.js" + "test/parallel/test-tls-server-verify.js")) + + ;; Replace pre-generated llhttp sources + (let ((llhttp (assoc-ref inputs "llhttp"))) + (copy-file (string-append llhttp "/src/llhttp.c") + "deps/llhttp/src/llhttp.c") + (copy-file (string-append llhttp "/src/api.c") + "deps/llhttp/src/api.c") + (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)))))) + (inputs + `(("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))))) + (define-public libnode (package/inherit node (name "libnode") diff --git a/guix/build-system/node.scm b/guix/build-system/node.scm index 4991ed53a5..98f63f87ef 100644 --- a/guix/build-system/node.scm +++ b/guix/build-system/node.scm @@ -39,7 +39,7 @@ "Return the default Node package." ;; Lazily resolve the binding to avoid a circular dependency. (let ((node (resolve-interface '(gnu packages node)))) - (module-ref node 'node))) + (module-ref node 'node-lts))) (define* (lower name #:key source inputs native-inputs outputs system target