[PATCH] bump Node to 14.6

OpenSubmitted by Formbi.
Details
3 participants
  • Formbi
  • Jelle Licht
  • Jakub Kądziołka
Owner
unassigned
Severity
normal
F
F
Formbi wrote on 31 Jul 19:11 +0200
(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 2001From: Formbi <formbi@protonmail.com>Date: Fri, 31 Jul 2020 19:09:26 +0200Subject: [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.scmindex 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 23:26 +0200
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 onthe llhttp[1] project. These generated source files can be found in thedeps/llhttp/src directory of the 14.6 release, and the annoying thing isthat upstream uses typescript to generate these C files. See [2] for myfeeble attempt at having upstream take note of this issue to allow forproperly bootstrapping lltthp and subsequently recent versions of node.
There are some alternative typescript implementations that Iunsuccessfully have tried in the past in at least translating thetypescript used in llhttp to normal javascript, which we could theninterpret using our packaged version of node to build the C files thatwould allow us to build newer versions of node. The ones I looked at insome 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 someguile-guru can drop down from their higher spheres of existence andcreate a hacky interpreter that translates typescript toextremely-ugly-yet-correct javascript to help us escape this quagmire.
- Jelle

[1] https://github.com/nodejs/llhttp[2] https://github.com/nodejs/llhttp/issues/14[3] https://github.com/alangpierce/sucrase/issues/464[4] https://github.com/swc-project/swc
F
F
Formbi wrote on 31 Jul 23:33 +0200
(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 23:37 +0200
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)> [4] https://github.com/swc-project/swc
It seems this is not actually the case, but swc still seems to depend onhaving a rust nightly compiler available.
- Jelle
F
F
Formbi wrote on 31 Jul 23:41 +0200
(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 00:01 +0200
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 repomade it pass `cargo check' just fine.
Regards,Jakub Kądziołka
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEE5Xa/ss9usT31cTO54xWnWEYTFWQFAl8sfbQACgkQ4xWnWEYTFWTCwRAAjSoa/7eCW5KBpZhkAGjtIqVEleyg0Ykzj4tqHpw2Btm8sY9TwU+jhZVkYYmGbqxAYFHtvgjmeg3/+uTlcm/KdUuidZruGkIV7ps/bz41D6uLNS/Fo6KHRUQIMseo8ucnmFrmYHoRzaJst15M8dQ2TWv/NzYY1bDS+XhyN0rkzvSOhWl3/G2yV3ZMJEn7e0d0V/bk4nKfNdasdyQ2ZsGCrZ7D2Z+NZYeSxHmLsbcCk8fR49oXbX/T6SbJtL2wTBAeObjhiyDCtbEGi8z5QNVx5hLLAon9vNfFdWWF4LwlKtECKJ+RodmF7RXf5Pn4diHeNVGQLVtzIX44dHhhk/f5dIrIUF/oWr5k5dcgjd+/7Zxm8fLh7Wu/tTo1yaluKgP9n0ulWPRFnWHhg74YPvru5v2HQGZgwu6mVx/9hrXn5wme7QF8MNa5UlZ7Oq0XHJCjDdcT8ym/wc94POmhu8yZe7l0XrUXW7h7JrY9OOJzspNxKWPi1/cppyI7K3Q+a4/IJj8GT597SrIdusWQswZZLBJ7jm12ffIhW5lwhhFuBemfjQKvosr/1o+HtcKv1NqqC28wecmsOI5ALuY+B7KLiICrLGhV1tCkyl+OxDGZHqsKIBQHAYTGfucyREhffambyVBKKfTi/XDjPk5mGhwuVk6tfwmIc7RKzNZa6FEG7Ak==wVNo-----END PGP SIGNATURE-----

J
J
Jelle Licht wrote on 7 Aug 00:53 +0200
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 endup with a library that was built successfully, but no clue how tocontinue from here. Either way, progress! ;)
- Jelle
J
J
Jakub Kądziołka wrote on 7 Aug 15:58 +0200
(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 inTypeScript (node-swc/src), which is built with neon, also a tool writtenin TypeScript. However, it seems that it shouldn't be too hard to invokeswc with just Rust, with something along the lines of examples/usage.rs
Regards,Jakub Kądziołka
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEE5Xa/ss9usT31cTO54xWnWEYTFWQFAl8tXg8ACgkQ4xWnWEYTFWQpAg/8DV9l3xjmw14xn86vq+CibnSZxvtxz5suN8oYn33gCX+d2duNmaKg8IBF04m0kGNNTCy2oZE7wnrK3V4YqhjqYDcWzQZMXd1zOstaXAVGiiaFqBtOij2XkRfa7gDTZGm4rsKUYJqXQewUCUhoHTB/WUrumwUK+Z+5xXGs7EsrKE/e7krACA/3SecSNQarKYR+5oyf2lSq5r5DY2ZQEYhkiICUD+3Rv1vkF0Fl2ICnQOsz3JX7wcIKvrTjN471GNfEbAMDeUrpOWrCXeM7tajesnUIaSMXYcOAOPMmN3SogeMGnSgweGj2Yuj8TFYqrmQQD/2hZdjIR+ogT9OHuKuo81kzMJ5Tqm3BdiluuqDkd1t3VdXyaxpq9qnLsXsM1QJ1p7JKkwPsfhpvXlmfAIhuq29glSb3/ZTXgCnOcIRJqxI541O/8VBN3P1V6LbUNcPEygLiOfsmFAk+zkfud8M7d/M7runj5Bub9GtpKhxsfxoPfcZVv53ZlKojw77tD/1/j6AIS9mOQNLEN1y8DLHVxWc9wR3blI0ckz1S5ccTh19trCvofR4n7ybtQA9tTmrKbNV7dRsHsQsdm3GXKechMF4UlVuZ+vDllaLMiWFiOHWjPz588dmDuCe/R2/GT1kfCfNZBp8J3pw7gDW++CS0TM1VaFivAT1c6qED0v4qsNI==q5k2-----END PGP SIGNATURE-----

?