From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id OF2HJK2+YmAQzgAAgWs5BA (envelope-from ) for ; Tue, 30 Mar 2021 08:01:17 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id kCF7Hq2+YmDvVAAA1q6Kng (envelope-from ) for ; Tue, 30 Mar 2021 06:01:17 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 14E751456B for ; Tue, 30 Mar 2021 08:01:17 +0200 (CEST) Received: from localhost ([::1]:54658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lR6xA-0001oO-5e for larch@yhetil.org; Tue, 30 Mar 2021 01:30:12 -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 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1617084077; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=rMR/7beTDsdT3kmJffi1nTSh8klMzsL5F7x6BgGnY5s=; b=BUT02cHGP/ZDvgRCfutTqNbun/wUutmBuGHPxK8UguN7Pb36f1OacNbM/oti9qDq8NK9oH 1ioaOFWkOK5A3nA0QiCPML++q2fAUNnSrm/5apBScsfEIS2eTR/NdwXBpX/mLPOzD6KY46 U5yEm0M6ei0KfYPZIZ60a4OQGeXUFvz1V/tPtj3yHUFK/ZiwEQTzC5pzgdYW/3MoDxmE2W erhFN1YqZb7gvq6xejSdFabJJZ26vOYCqPP5aWAH045KfzLocmL4+7UeZLxAIU5A9YICy1 Xjjkw0tD1vYXLU41pi2W6gyZ7A1G16/LKkFqlsPzO41FnPrGs03qiFhjx/K/Kw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1617084077; a=rsa-sha256; cv=none; b=lbL0ZEKqJLwD4Uyjpvwm3zZ4QJgZHz35ysF9RPqYQTxNgYHDXM+SZwWOs8nb3hUURzznt3 0lsmm4cYmQEbATDsQnNWxe4PtabNd/wzo1PnzRWfbfT9GF4ymNjfg6PsXCOnp1WPFOMSvJ O9IdnNYiw1OBg0FRJfryE3Hb0/STX1gNBH9WRlr0ssQAg177l8+VPskDNLo6rwt3x6k8km aDr5Jt1QyqRNXtb6hz2w5wUbNcUgxv/ucPxs3nHIDsFfS/fsNWGG3s3wQBE/fgRFkEDphJ k2NsfCcuxc/5liJXURGYZeQsy46uMniEEdMf+CGkyxCRfItY4O8EMH7P5z589Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm2 header.b="un6z9/r5"; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 5.08 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm2 header.b="un6z9/r5"; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 14E751456B X-Spam-Score: 5.08 X-Migadu-Scanner: scn0.migadu.com X-TUID: Hpowuz3wswd2 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 -- 2.31.0