unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#42639] [PATCH] bump Node to 14.6
@ 2020-07-31 17:11 Formbi via Guix-patches via
  2020-07-31 21:26 ` Jelle Licht
  0 siblings, 1 reply; 9+ messages in thread
From: Formbi via Guix-patches via @ 2020-07-31 17:11 UTC (permalink / raw)
  To: 42639

[-- Attachment #1: Type: text/plain, Size: 13 bytes --]

Empty Message

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0002-bump-node-to-14.6.patch --]
[-- Type: text/x-patch; name=0002-bump-node-to-14.6.patch, Size: 2757 bytes --]

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(+)

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


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [bug#42639] [PATCH] bump Node to 14.6
  2020-07-31 17:11 [bug#42639] [PATCH] bump Node to 14.6 Formbi via Guix-patches via
@ 2020-07-31 21:26 ` Jelle Licht
  2020-07-31 21:33   ` Formbi via Guix-patches via
  2020-07-31 21:37   ` Jelle Licht
  0 siblings, 2 replies; 9+ messages in thread
From: Jelle Licht @ 2020-07-31 21:26 UTC (permalink / raw)
  To: formbi, 42639


Hey Formbi,


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

> 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


[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




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#42639] [PATCH] bump Node to 14.6
  2020-07-31 21:26 ` Jelle Licht
@ 2020-07-31 21:33   ` Formbi via Guix-patches via
  2020-07-31 21:37   ` Jelle Licht
  1 sibling, 0 replies; 9+ messages in thread
From: Formbi via Guix-patches via @ 2020-07-31 21:33 UTC (permalink / raw)
  To: Jelle Licht; +Cc: 42639

oh my bananas, that's bad news :(




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#42639] [PATCH] bump Node to 14.6
  2020-07-31 21:26 ` Jelle Licht
  2020-07-31 21:33   ` Formbi via Guix-patches via
@ 2020-07-31 21:37   ` Jelle Licht
  2020-07-31 21:41     ` Formbi via Guix-patches via
  2020-08-06 22:01     ` Jakub Kądziołka
  1 sibling, 2 replies; 9+ messages in thread
From: Jelle Licht @ 2020-07-31 21:37 UTC (permalink / raw)
  To: formbi, 42639

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




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#42639] [PATCH] bump Node to 14.6
  2020-07-31 21:37   ` Jelle Licht
@ 2020-07-31 21:41     ` Formbi via Guix-patches via
  2020-08-06 22:01     ` Jakub Kądziołka
  1 sibling, 0 replies; 9+ messages in thread
From: Formbi via Guix-patches via @ 2020-07-31 21:41 UTC (permalink / raw)
  To: Jelle Licht; +Cc: 42639@debbugs.gnu.org

> seems to depend on having a rust nightly compiler available.

we have Rust 1.45.1 in Guix, wouldn't it be sufficient?




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#42639] [PATCH] bump Node to 14.6
  2020-07-31 21:37   ` Jelle Licht
  2020-07-31 21:41     ` Formbi via Guix-patches via
@ 2020-08-06 22:01     ` Jakub Kądziołka
  2020-08-06 22:53       ` Jelle Licht
  1 sibling, 1 reply; 9+ messages in thread
From: Jakub Kądziołka @ 2020-08-06 22:01 UTC (permalink / raw)
  To: Jelle Licht, r; +Cc: formbi, 42639

[-- Attachment #1: Type: text/plain, Size: 763 bytes --]

On Fri, Jul 31, 2020 at 11:37:24PM +0200, Jelle Licht wrote:
> 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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#42639] [PATCH] bump Node to 14.6
  2020-08-06 22:01     ` Jakub Kądziołka
@ 2020-08-06 22:53       ` Jelle Licht
  2020-08-07 13:58         ` Jakub Kądziołka
  0 siblings, 1 reply; 9+ messages in thread
From: Jelle Licht @ 2020-08-06 22:53 UTC (permalink / raw)
  To: Jakub Kądziołka, r; +Cc: formbi, 42639

Jakub Kądziołka <kuba@kadziolka.net> writes:

> 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




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#42639] [PATCH] bump Node to 14.6
  2020-08-06 22:53       ` Jelle Licht
@ 2020-08-07 13:58         ` Jakub Kądziołka
  2023-05-28 21:58           ` bug#42639: " Jelle Licht
  0 siblings, 1 reply; 9+ messages in thread
From: Jakub Kądziołka @ 2020-08-07 13:58 UTC (permalink / raw)
  To: Jelle Licht; +Cc: formbi, 42639

[-- Attachment #1: Type: text/plain, Size: 579 bytes --]

On Fri, Aug 07, 2020 at 12:53:53AM +0200, Jelle Licht wrote:
> 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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#42639: [PATCH] bump Node to 14.6
  2020-08-07 13:58         ` Jakub Kądziołka
@ 2023-05-28 21:58           ` Jelle Licht
  0 siblings, 0 replies; 9+ messages in thread
From: Jelle Licht @ 2023-05-28 21:58 UTC (permalink / raw)
  To: 42639-done; +Cc: Jakub Kądziołka, formbi

We now have node@18 on master, and worked around the bootstrapping issue
using a different solution (esbuild). Closing.




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-05-28 21:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-31 17:11 [bug#42639] [PATCH] bump Node to 14.6 Formbi via Guix-patches via
2020-07-31 21:26 ` Jelle Licht
2020-07-31 21:33   ` Formbi via Guix-patches via
2020-07-31 21:37   ` Jelle Licht
2020-07-31 21:41     ` Formbi via Guix-patches via
2020-08-06 22:01     ` Jakub Kądziołka
2020-08-06 22:53       ` Jelle Licht
2020-08-07 13:58         ` Jakub Kądziołka
2023-05-28 21:58           ` bug#42639: " Jelle Licht

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).