[PATCH] bump Node to 14.6

  • Done
  • quality assurance status badge
Details
3 participants
  • Formbi
  • Jelle Licht
  • Jakub K?dzio?ka
Owner
unassigned
Submitted by
Formbi
Severity
normal
F
F
Formbi wrote on 31 Jul 2020 19:11
(name . guix-patches@gnu.org)(address . guix-patches@gnu.org)
tN6dc0jlib3fz91hRViWOMPWBBaRSulxZN7pevQOHnoTLjBmpFdA2em-AUB5sqqbxhbtUNE2Q635-1JOyrbrZ39MZHWOgGCCMUvnwPeaqqs=@protonmail.com
Empty Message
From 0dc32f60b10c39f585d3535f3ff35e0e9812a6a0 Mon Sep 17 00:00:00 2001
From: Formbi <formbi@protonmail.com>
Date: Fri, 31 Jul 2020 19:09:26 +0200
Subject: [PATCH 2/2] bump node to 14.6

---
gnu/packages/node.scm | 54 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)

Toggle diff (67 lines)
diff --git a/gnu/packages/node.scm b/gnu/packages/node.scm
index 1adb2cd07f..a7658e626a 100644
--- a/gnu/packages/node.scm
+++ b/gnu/packages/node.scm
@@ -199,6 +199,60 @@ devices.")
(properties '((max-silent-time . 7200) ;2h, needed on ARM
(timeout . 21600))))) ;6h
+(define-public node-14.6
+ (package
+ (inherit node)
+ (version "14.6.0")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://nodejs.org/dist/v" version
+ "/node-v" version ".tar.xz"))
+ (sha256
+ (base32
+ "153a07ffrmvwbsc78wrc0xnwymmzrhva0kn6mgnfi3086v3h1wss"))
+ (modules '((guix build utils)))
+ (snippet
+ `(begin
+ ;; Remove bundled software.
+ (for-each delete-file-recursively
+ '("deps/cares"
+ "deps/icu-small"
+ "deps/openssl"))
+ (substitute* "Makefile"
+ ;; Remove references to bundled software.
+ (("deps/http_parser/http_parser.gyp") "")
+ (("deps/uv/include/\\*.h") ""))
+ #t))))
+ (arguments
+ (substitute-keyword-arguments (package-arguments node)
+ ((#:configure-flags configure-flags)
+ ''("--shared-cares"
+ ;; "--shared-http-parser"
+ ;; node can't find the pkg-config file for http-parser
+ "--shared-libuv"
+ ;; "--shared-nghttp2"
+ ;; for some reason only the bundled nghttp2 works
+ "--shared-openssl"
+ "--shared-zlib"
+ ;; "--without-snapshot"
+ ;; this option is no longer available
+ "--with-intl=system-icu"))
+ ;; Almost all the tests require NPM and the one that doesn't does
+ ;; something stupid and fails on 14.6
+ ((#:tests? _ #f) #f)
+ ;; The patch-files was preparing the tests, now it's not needed
+ ((#:phases phases)
+ `(modify-phases ,phases
+ (delete 'patch-files)))))
+ (inputs
+ `(("c-ares" ,c-ares)
+ ("http-parser" ,http-parser)
+ ("icu4c" ,icu4c-67)
+ ("libuv" ,libuv-1.38)
+ ("openssl" ,openssl)
+ ("zlib" ,zlib)
+ ("brotli" ,google-brotli)))))
+
(define-public libnode
(package
(inherit node)
--
2.26.0
J
J
Jelle Licht wrote on 31 Jul 2020 23:26
87ime31ilf.fsf@jlicht.xyz
Hey Formbi,


Formbi via Guix-patches via <guix-patches@gnu.org> writes:

Toggle quote (2 lines)
> Subject: [PATCH 2/2] bump node to 14.6

Sadly, recent node versions come bundled with generated code based on
the llhttp[1] project. These generated source files can be found in the
deps/llhttp/src directory of the 14.6 release, and the annoying thing is
that upstream uses typescript to generate these C files. See [2] for my
feeble attempt at having upstream take note of this issue to allow for
properly bootstrapping lltthp and subsequently recent versions of node.

There are some alternative typescript implementations that I
unsuccessfully have tried in the past in at least translating the
typescript used in llhttp to normal javascript, which we could then
interpret using our packaged version of node to build the C files that
would allow us to build newer versions of node. The ones I looked at in
some detail are:

- Sucrase [3] but it doesn't support all used typescript constructs
- swc [4] but it actually depends on the normal typescript compiler

I'm sorry I don't have better news to share either. Perhaps some
guile-guru can drop down from their higher spheres of existence and
create a hacky interpreter that translates typescript to
extremely-ugly-yet-correct javascript to help us escape this quagmire.

- Jelle


F
F
Formbi wrote on 31 Jul 2020 23:33
(name . Jelle Licht)(address . jlicht@fsfe.org)
TaiOK9GDidTtXiRXYoDN2CN6BnzbZsILKhZO7GDfjyrZFdYIpvv7nwYaxTX2sRhX27pJwV7WvEk0vLe4ac2We94cdbKAMsQKhcRCuI_cIlE=@protonmail.com
oh my bananas, that's bad news :(
J
J
Jelle Licht wrote on 31 Jul 2020 23:37
87ft971i3v.fsf@jlicht.xyz
Jelle Licht <jlicht@fsfe.org> writes:

Toggle quote (5 lines)
> would allow us to build newer versions of node. The ones I looked at in
> some detail are:
>
> - Sucrase [3] but it doesn't support all used typescript constructs
> - swc [4] but it actually depends on the normal typescript compiler
[snip]
Toggle quote (1 lines)
It seems this is not actually the case, but swc still seems to depend on
having a rust nightly compiler available.

- Jelle
F
F
Formbi wrote on 31 Jul 2020 23:41
(name . Jelle Licht)(address . jlicht@fsfe.org)(name . 42639@debbugs.gnu.org)(address . 42639@debbugs.gnu.org)
1w6Hk8z0yJiGKLNsVjy4eUMQv9GSSXxzwTyq3Hv3YUwxY0vW7psgQrUn8MEQPh6FA3ReZKmxzAq3U8fgReGn6J36_1mzpVYTX6hGABZDMvk=@protonmail.com
Toggle quote (2 lines)
> seems to depend on having a rust nightly compiler available.

we have Rust 1.45.1 in Guix, wouldn't it be sufficient?
J
J
Jakub K?dzio?ka wrote on 7 Aug 2020 00:01
20200806220124.rc32clbnwozgbnqs@gravity
On Fri, Jul 31, 2020 at 11:37:24PM +0200, Jelle Licht wrote:
Toggle quote (14 lines)
> Jelle Licht <jlicht@fsfe.org> writes:
>
> > would allow us to build newer versions of node. The ones I looked at in
> > some detail are:
> >
> > - Sucrase [3] but it doesn't support all used typescript constructs
> > - swc [4] but it actually depends on the normal typescript compiler
> [snip]
> > [4] https://github.com/swc-project/swc
> It seems this is not actually the case, but swc still seems to depend on
> having a rust nightly compiler available.
>
> - Jelle

It seems that a nightly compiler is only used for an optimization flag:
commenting out the -Z thinlto=no line in .cargo/config in swc's repo
made it pass `cargo check' just fine.

Regards,
Jakub K?dzio?ka
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEE5Xa/ss9usT31cTO54xWnWEYTFWQFAl8sfbQACgkQ4xWnWEYT
FWTCwRAAjSoa/7eCW5KBpZhkAGjtIqVEleyg0Ykzj4tqHpw2Btm8sY9TwU+jhZVk
YYmGbqxAYFHtvgjmeg3/+uTlcm/KdUuidZruGkIV7ps/bz41D6uLNS/Fo6KHRUQI
Mseo8ucnmFrmYHoRzaJst15M8dQ2TWv/NzYY1bDS+XhyN0rkzvSOhWl3/G2yV3ZM
JEn7e0d0V/bk4nKfNdasdyQ2ZsGCrZ7D2Z+NZYeSxHmLsbcCk8fR49oXbX/T6SbJ
tL2wTBAeObjhiyDCtbEGi8z5QNVx5hLLAon9vNfFdWWF4LwlKtECKJ+RodmF7RXf
5Pn4diHeNVGQLVtzIX44dHhhk/f5dIrIUF/oWr5k5dcgjd+/7Zxm8fLh7Wu/tTo1
yaluKgP9n0ulWPRFnWHhg74YPvru5v2HQGZgwu6mVx/9hrXn5wme7QF8MNa5UlZ7
Oq0XHJCjDdcT8ym/wc94POmhu8yZe7l0XrUXW7h7JrY9OOJzspNxKWPi1/cppyI7
K3Q+a4/IJj8GT597SrIdusWQswZZLBJ7jm12ffIhW5lwhhFuBemfjQKvosr/1o+H
tcKv1NqqC28wecmsOI5ALuY+B7KLiICrLGhV1tCkyl+OxDGZHqsKIBQHAYTGfucy
REhffambyVBKKfTi/XDjPk5mGhwuVk6tfwmIc7RKzNZa6FEG7Ak=
=wVNo
-----END PGP SIGNATURE-----


J
J
Jelle Licht wrote on 7 Aug 2020 00:53
87tuxfe67y.fsf@jlicht.xyz
Jakub K?dzio?ka <kuba@kadziolka.net> writes:

Toggle quote (10 lines)
> On Fri, Jul 31, 2020 at 11:37:24PM +0200, Jelle Licht wrote:
>> It seems this is not actually the case, but swc still seems to depend on
>> having a rust nightly compiler available.
>>
>> - Jelle
>
> It seems that a nightly compiler is only used for an optimization flag:
> commenting out the -Z thinlto=no line in .cargo/config in swc's repo
> made it pass `cargo check' just fine.

Indeed it does; does that fix this problem for us? At this stage, I end
up with a library that was built successfully, but no clue how to
continue from here. Either way, progress! ;)

- Jelle
J
J
Jakub K?dzio?ka wrote on 7 Aug 2020 15:58
(name . Jelle Licht)(address . jlicht@fsfe.org)
20200807135839.pr2cnyqmnlandx3l@gravity
On Fri, Aug 07, 2020 at 12:53:53AM +0200, Jelle Licht wrote:
Toggle quote (4 lines)
> Indeed it does; does that fix this problem for us? At this stage, I end
> up with a library that was built successfully, but no clue how to
> continue from here. Either way, progress! ;)

Hmm, it seems that the main way to use swc is by a wrapper written in
TypeScript (node-swc/src), which is built with neon, also a tool written
in TypeScript. However, it seems that it shouldn't be too hard to invoke
swc with just Rust, with something along the lines of examples/usage.rs

Regards,
Jakub K?dzio?ka
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEE5Xa/ss9usT31cTO54xWnWEYTFWQFAl8tXg8ACgkQ4xWnWEYT
FWQpAg/8DV9l3xjmw14xn86vq+CibnSZxvtxz5suN8oYn33gCX+d2duNmaKg8IBF
04m0kGNNTCy2oZE7wnrK3V4YqhjqYDcWzQZMXd1zOstaXAVGiiaFqBtOij2XkRfa
7gDTZGm4rsKUYJqXQewUCUhoHTB/WUrumwUK+Z+5xXGs7EsrKE/e7krACA/3SecS
NQarKYR+5oyf2lSq5r5DY2ZQEYhkiICUD+3Rv1vkF0Fl2ICnQOsz3JX7wcIKvrTj
N471GNfEbAMDeUrpOWrCXeM7tajesnUIaSMXYcOAOPMmN3SogeMGnSgweGj2Yuj8
TFYqrmQQD/2hZdjIR+ogT9OHuKuo81kzMJ5Tqm3BdiluuqDkd1t3VdXyaxpq9qnL
sXsM1QJ1p7JKkwPsfhpvXlmfAIhuq29glSb3/ZTXgCnOcIRJqxI541O/8VBN3P1V
6LbUNcPEygLiOfsmFAk+zkfud8M7d/M7runj5Bub9GtpKhxsfxoPfcZVv53ZlKoj
w77tD/1/j6AIS9mOQNLEN1y8DLHVxWc9wR3blI0ckz1S5ccTh19trCvofR4n7ybt
QA9tTmrKbNV7dRsHsQsdm3GXKechMF4UlVuZ+vDllaLMiWFiOHWjPz588dmDuCe/
R2/GT1kfCfNZBp8J3pw7gDW++CS0TM1VaFivAT1c6qED0v4qsNI=
=q5k2
-----END PGP SIGNATURE-----


J
J
Jelle Licht wrote on 28 May 2023 23:58
Re: bug#42639: [PATCH] bump Node to 14.6
(address . 42639-done@debbugs.gnu.org)
878rd8p18s.fsf@fsfe.org
We now have node@18 on master, and worked around the bootstrapping issue
using a different solution (esbuild). Closing.
Closed
?