From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id yC/BFE9Wk18lIgAA0tVLHw (envelope-from ) for ; Fri, 23 Oct 2020 22:16:47 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id COyqEE9Wk1/3KwAA1q6Kng (envelope-from ) for ; Fri, 23 Oct 2020 22:16:47 +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 C35949400C7 for ; Fri, 23 Oct 2020 22:16:46 +0000 (UTC) Received: from localhost ([::1]:47766 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kW5Mb-0006w1-Hu for larch@yhetil.org; Fri, 23 Oct 2020 18:16:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34872) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kW5MS-0006vs-Pt for guix-devel@gnu.org; Fri, 23 Oct 2020 18:16:36 -0400 Received: from mail1.fsfe.org ([217.69.89.151]:45554) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kW5MQ-0002nm-IF for guix-devel@gnu.org; Fri, 23 Oct 2020 18:16:36 -0400 From: Jelle Licht To: guix-devel@gnu.org Subject: wip-node-14 branch Date: Sat, 24 Oct 2020 00:16:28 +0200 Message-ID: <863624y4eb.fsf@fsfe.org> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=217.69.89.151; envelope-from=jlicht@fsfe.org; helo=mail1.fsfe.org X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/23 18:16:31 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=fsfe.org (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Spam-Score: -0.91 X-TUID: Nh8OelJt13Bv Hey Guix! Depending on whom you ask, I come with what I see as good news! I just pushed a series of patches with the long-term goal of getting the Node.js situation in guix unstuck. You may find it on the `wip-node-14' branch on on Savannah. First things first: most of the hard work has been done by others. I'd like to specifically thank Timothy Sample for their `other-node-build-system' and Ryan Prior for getting `esbuild' packaged and telling me about it. A shout out goes to Giacomo Leidi for making me grumpy enough with the existing node-build-system to finally sit down and fix this. I added Timothy as a Co-author on the first commit, so I hope that is Good Enough for the copyright situation. The branch contains the following changes: - A revised `node-build-system', shelling out to `npm' for pretty much all phases of building a package. This also solves some inconsistencies our way of installing node packages lead to before [0]. It makes the current npm packages a bit more verbose, but if we ever end up with 'properly' built npm packages, they should be easy to write. - For now, I took the most recent Node.js package we had available that we could still build from source, and arbitrarily made an alias for it dubbed `node-bootstrap'. - I used `esbuild' and some good old fashioned distro-packager moxie to bend the packages we need to run `llhttp's TypeScript and generate C files. I have also verified that the generated C files are identical to what is distributed upstream. - I added a libuv-node package that tracks libuv upstream at a pretty fast pace. Help wanted on how/where/if we should manage this. - ... and then I packaged Node.js version 14.14, which should last us for a good couple of years :-). Some open issues/challenges: - We used to patch out references to bundled dependencies in Node.js; this is no longer easily possible in some cases, although I have verified that the `--shared-XXX' flags do work; in practice this just means we waste some space in storing the sources for Node.js 14. - There is a wrapper in use by Node.js for libuv called uvwasi; Once [1] is closed, we should look into packaging and subsequently unbundling this. - Currently it is not possible to build a shared-library of `llhttp'[2]: I currently worked around this by generated both the sources and static library of `llhttp', and copying over our generated `llhttp.{c,h}' into the Node.js sourcetree. It works, but it ain't pretty. Once we can build llhttp as a shared library and Node.js supports a `--shared-llhttp' configure flag, we should do that. - There are two (disabled) tests with a "TODO" comment above them. As a result of me not being clever enough and my laptop not being fast enough to compensate, I have not been able to figure why these tests fail (and if that is a problem in practice). - There is _a lot_ of almost-duplication going on between our `node' and `node-14.14' packages; I don't like it whatsoever. As a small extra, I have also worked on getting Timothy Sample's 'binary' npm importer to work with the contemporary guix import and guile-json APIs; I'd like some insight into whether this binary importer could still hold some value for inclusion in guix proper[3]. I could still add this code to the branch as well if there is interest. I won't be able to commit significant chunks of time on my end in the upcoming month, but I've learned that it makes sense to share once you have something worth sharing, instead of when you think it's done. Reviews, tests and improvements very much welcome! I don't think it makes sense to still target the upcoming release for all of this fun stuff to be merged into master, but if somebody want to pick up the slack and champion that cause; go right ahead! Thanks! - Jelle [0]: http://issues.guix.gnu.org/41219 [1]: https://github.com/nodejs/node/issues/35339 [2]: https://github.com/nodejs/llhttp/issues/52 [3]: http://logs.guix.gnu.org/guix/2020-10-23.log#123831