From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id aFG3Knp9oWOFhgEAbAwnHQ (envelope-from ) for ; Tue, 20 Dec 2022 10:16:42 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id UIuuKnp9oWONJwEA9RJhRA (envelope-from ) for ; Tue, 20 Dec 2022 10:16:42 +0100 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 5A3EEE96D for ; Tue, 20 Dec 2022 10:16:42 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p7Yfo-0004H3-9g; Tue, 20 Dec 2022 04:12:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p7Yfl-0004FG-SA for guix-devel@gnu.org; Tue, 20 Dec 2022 04:12:30 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p7Yfj-0007Je-Ei for guix-devel@gnu.org; Tue, 20 Dec 2022 04:12:29 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 69B2A240103 for ; Tue, 20 Dec 2022 10:12:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1671527542; bh=mzvh3E83JSPFozyawdozRNI4EzoTZzt/HgPbU0+dllM=; h=From:To:Cc:Subject:Date:From; b=pM+lMGyYlrPYbKzyNgc4AkZN3+4JHh8C9WWp+Yd1zeHfutJ573Lqn6VS2wpendfaj UcEHZ14UR/xmruX/wXE3QpAG0Bd2+mXokfyPWuX3xeIGUEuypaqTBa6SIy2IVKAfW9 zo+HI4feKg6eSbK2j9IjkhV9eN1Ea20dh52In1NeInpYaSOzJ/Jo0pBOFTMq0T6iou p5MFm+bgaxmGrA4iTGpJiio29DQF5KXvDl/h1Y9SPkdrLrGOyxXKTFO21eG/mhC3gJ 7Vw4rMNX1BVYj/x7HLfv4wjt50l46nvZygqSfPokhvZcICN0xSuBb7yZTXZVzuUP4g hUjyudp+CrZeg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4NbrS7222Qz9rxL; Tue, 20 Dec 2022 10:12:06 +0100 (CET) References: <450401139.631101.1668893228599@privateemail.com> From: Mekeor Melire To: zamfofex Cc: guix-devel@gnu.org Subject: Re: bringing npm packages to Guix Date: Tue, 20 Dec 2022 09:00:16 +0000 In-reply-to: <450401139.631101.1668893228599@privateemail.com> Message-ID: <87ili6h227.fsf@posteo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.66; envelope-from=mekeor@posteo.de; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, 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.29 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.de header.s=2017 header.b=pM+lMGyY; dmarc=pass (policy=none) header.from=posteo.de; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1671527802; a=rsa-sha256; cv=none; b=CsnCKDgLeMCWa6E8Z90wg6TA9CMONloVf6XkrMiDBjNPV8DgWlmZbj+yCuW1LA1exkRlES 8rNBpEXSMsG1+aexg2sdKEOYSARFrT+n8hEFhiQh67De5igPGWzfuY4+ohCNQN73Uw2VAQ P2dcm13A9gZN3mFK2CnSQ2+vhNhiZMJ2UlmkrxCGdm6sbIqyoTrQQBx5DQRdc46FXV/t1K TR69WPhZsXT94ZP8QM92MHCEE3H5onMrLFumJgxFdizvid26l9S7+7Jthg8Z3s9cHOJr9+ 5xbIf1RoAsg/nP8hIUggXQBSX79KR+F7a6+m9rJxgObyvIICVxK0kQ0bie7f5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1671527802; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=mzvh3E83JSPFozyawdozRNI4EzoTZzt/HgPbU0+dllM=; b=mMC32bZ6Lf01uMuCjMYn35hDRSE4VBd6iJkVFXXTcCFESOFoDWo8wbRxM0jNKyE8a7KqMj U2IAHAWwpmUyUScgp0neCFiiXJ2BNRrdyqLCEPHFV/ap7z0IUnHrux8ZKMjfi0EreLaCDK 3ElP08MTsx2FkWyYSyp0Yu8O5sYGtl4gh0suZLag4lCea5mNlNXEXZGBS2awKF84+vS/E9 itP9u6jmSxA1I1GtuBejI9aL5tfFUH5rpV+v4js//2M4tYEkw7WGtueQuLyUZziqTZX93q d5xuxiILH2BoAc7SnjB1eFHfgLhWVgXb9kuqjddwx0KQL3qW44nQJfHLhoU+Yw== Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.de header.s=2017 header.b=pM+lMGyY; dmarc=pass (policy=none) header.from=posteo.de; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -7.43 X-Spam-Score: -7.43 X-Migadu-Queue-Id: 5A3EEE96D X-TUID: PDFVPE7uAwFB 2022-11-19 18:27 zamfofex@twdb.moe: > Hello, Guix! Hello :) > A few months ago, I picked up the work towards importing npm packages to= =20 > Guix by Jelle et al. in the hopes of continuing it, and I felt dishearten= ed=20 > when I concluded that it does indeed seem like a very large part of npm i= s=20 > necessary to build even a simple package like jQuery. Thanks for bringing this back up! Although, I work with the node/npm ecosystem on a daily basis, unfortunatel= y,=20 I don't really understand why it's so difficult to import npm-packages into= =20 Guix. > But, recently, I decided to spend some more time thinking about it, and I= =20 > realized that not all of the =E2=80=98devDependencies=E2=80=99 of a given= package are=20 > actually necessary to build it. A lot of packages have =E2=80=98devDepend= encies=E2=80=99 for=20 > things such as tests and watching the filesystem for changes for ease of= =20 > development. Is importing npm-packages into Guix difficult because npm-packages have so= =20 many dependencies? > If you think about it, what the vast majority of npm packages need to bui= ld=20 > successfully comes down to (optionally) compile TypeScript, then=20 > (optionally) perform some kind of bundling or transpilation. And that=20 > doesn=E2=80=99t really require TypeScript or a build tool from npm, since= esbuild=20 > (which is already packaged) can do both of those things by itself. Is importing npm-packages into Guix so difficult because we have a=20 chicken-and-egg problem, since many build-time dependencies (like TypeScrip= t)=20 have so many dependencies themselves? Also, is there a reason to choose esbuild over rust-swc (or vice versa)? > Now, taking away the =E2=80=98devDependencies=E2=80=99 when recursing the= dependency tree=20 > makes the whole endeavor of importing an npm package seem *much less*=20 > difficult and scary! The biggest unfortunate issue is that for packages w= ith=20 > a build step (TypeScript and/or bundling+transpilation), it is necessary = to=20 > use esbuild ad=E2=80=90hoc (i.e. in a case-by-case basis), because each p= ackage has=20 > its own build peculiarities, and esbuild doesn=E2=80=99t acknowledge them= . (One=20 > solution could be to create an esbuild wrapper that mimics =E2=80=98tsc= =E2=80=99 and other=20 > tools.) Could we also build TSC with Esbuild, and then use TSC to build packages th= at=20 depend on it, instead of mimicking TSC with Esbuild? Does that make sense? With "mimicking TSC", do you mean that Esbuild does not transpile multiple= =20 .ts-files at once? (By the way, Esbuild seems to make use of the tsconfig.j= son=20 file, according to .) > With that approach in mind, I was able to package sucrase as a proof of=20 > concept! Note that sucrase doesn=E2=80=99t have a lot of transitive depen= dencies, so=20 > it was easy to just modify the phases of each package in an ad=E2=80=90ho= c way.=20 > However, also note that sucrase depends on itself, so I decided to bootst= rap=20 > it with esbuild, then use the bootstrapped version to build sucrase again= .=20 > (The bootstrapped sucrase seems to also work as expected!) That's so great! Sorry for asking nooby questions. I just want to catch up and press ahead w= ith=20 the discussion.