From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id UJmJFL/Q2GXnbQAAe85BDQ:P1 (envelope-from ) for ; Fri, 23 Feb 2024 18:07:11 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id UJmJFL/Q2GXnbQAAe85BDQ (envelope-from ) for ; Fri, 23 Feb 2024 18:07:11 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=futurile.net header.s=selector1 header.b=WOl3fG0j; dmarc=none; 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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1708708020; 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=LoPXwiBQIQvmGAa7RnAajv1nAI0+E5HKpnC1wyB8jxM=; b=tlHE9EEu2uq6yT+Gtc1/FJWM0bFvRC0GO2iCQsImZf4uylP25ticVWUCnb1d/SmJkE1W7E efmm+insBSmoBOEXfHwJ4cSyA6ew1KXwpth/q3Gv+pVRNtxK2Hfcx6rKYb++Kx2mqJNwnX svpZ+pUORjW7bGoi2YDUXXV8aD+5lckfAltSSrdApUxyfmEX+iIBu6YseNJFyMW30WQXjO fy2GTLWVQsNk/8xNVCSeMRbEX9qnTGFaPDF99OMelECNnLUDIK3JVka2MtrJ94cYcz6Uh3 ljSxErgcijMzII/rrRXWr1OTMvJMKn4f5zDLjGfW1G0WXH/LGFTPrN3Zuknbxg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=futurile.net header.s=selector1 header.b=WOl3fG0j; dmarc=none; 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=1708708020; a=rsa-sha256; cv=none; b=fwy5b8NgC3v8g0JkKRbKuIUw2etDUDCiAwJh1pcysp5b8Frfs+sFyaE+a6U5tTqCd3nnHh O1+L4WKOwacCTsynROUASKR0tNSjrYCzhX12jOKcFb85lnm3PlH/HMhW6w1CP8E2KXcmwU bss3dDl7+3rPeq74TQwNzvXV0EYFSVVjDJX2/y3/8Ni/lv4mWJnGivGDFilyn+uZ8dEeW7 /++e4OZO8W/L/yViYgp2V55ccR7W+vCcidgy8eTPlpRBKfXk65MgNPaxYj9MtsRPt/4XXL ik4Y16UufwfDyf8NAW6CPtlQBR5XS0rDxW49+Z+WdBzfXeZG2v72wHxUzQej6A== 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 A0B2C13B93 for ; Fri, 23 Feb 2024 18:06:59 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rdZ0D-00068s-6V; Fri, 23 Feb 2024 12:06:25 -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 1rdYjn-0004B4-0z for guix-devel@gnu.org; Fri, 23 Feb 2024 11:49:27 -0500 Received: from mailtransmit05.runbox.com ([2a0c:5a00:149::26]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rdYjg-0002UV-NT for guix-devel@gnu.org; Fri, 23 Feb 2024 11:49:26 -0500 Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com) by mailtransmit05.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1rdYja-00B78B-Oj; Fri, 23 Feb 2024 17:49:14 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=futurile.net; s=selector1; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=LoPXwiBQIQvmGAa7RnAajv1nAI0+E5HKpnC1wyB8jxM=; b=WOl3fG0jrfADt1J+Gv8atISP6J ynzjHm0IbixgZJzvMef9ZHv3UkvQ2+3J1xJxsvq4fXuGsbZNn2qd4imBvwsJ/PTaHZDOtYGBYzNmw R57o41rAef9bKPE764yDyCH/gODp59QxbCcVHJy3e2XekLDpcDvB6ODg/zBWA6s9LxhRnENkwYQov cdYDze4q14mxvXi4ZGkJNEVOlAuVUkCR4X2B18KI0IAb9f/F6IPF2Rn6ISZnKsbxS0wH7ReE3Nyq0 fblEcHY62lRPWRVhBGnixQ3ir3KCJ5MebJmcByX4AtWDeAly4exUDcbhiJeM2ayv2m/xB2PQyWe4j hJ/SxSHg==; Received: from [10.9.9.72] (helo=submission01.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1rdYja-0000MQ-6f; Fri, 23 Feb 2024 17:49:14 +0100 Received: by submission01.runbox with esmtpsa [Authenticated ID (641962)] (TLS1.2:ECDHE_SECP256R1__RSA_SHA256__AES_256_GCM:256) (Exim 4.93) id 1rdYjR-004bjz-Iq; Fri, 23 Feb 2024 17:49:05 +0100 Date: Fri, 23 Feb 2024 16:49:04 +0000 From: Steve George To: Maxime Devos Cc: "guix-devel@gnu.org" , r0man , Reilly Siegel Subject: Re: Proposal to turn off AOT in clojure-build-system Message-ID: References: <20240219154444.p2kj2B0094wMGJ4012kk71@baptiste.telenet-ops.be> <20240222155741.qExg2B0021q4WC401Exg6J@andre.telenet-ops.be> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240222155741.qExg2B0021q4WC401Exg6J@andre.telenet-ops.be> Received-SPF: permerror client-ip=2a0c:5a00:149::26; envelope-from=steve@futurile.net; helo=mailtransmit05.runbox.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_PERMERROR=0.01 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -7.25 X-Spam-Score: -7.25 X-Migadu-Queue-Id: A0B2C13B93 X-Migadu-Scanner: mx13.migadu.com X-TUID: JwwwTusFog7h Hi, I don't think I'm making any progress convincing you, and I'm not enjoying the interaction so I'm going to take a few days off from this thread. I've tried to ask the Clojure community for a definitive expression of what they think Linux distributions should do with byte-compiled libraries. We'll see if there's a response, this is a public forum so feel free to chime in and express clearly your perpective: https://clojureverse.org/t/should-linux-distributions-ship-clojure-byte-compiled-aot-or-not/10595/1 Thanks, Steve / Futurile On 22 Feb, Maxime Devos wrote: > >> [...] > >> > But, I would like to draw attention to this thread on Clojureverse as the best source I could find: > >> >Alex Miller is the main community manager for Clojure, and is a maintainer of the core libraries, so his perspective is key. He notes that, AOT code is tied to *specific versions of Clojure*: > >> > > >> > "AOT'ed code is that it is inherently the product of a particular version of tthe Clojure compiler ... I would recommend NOT AOT compiling libraries" [4] > >> > >> This reasoning does not follow – yes, it is tied to the Clojure version, so what? Guix automatically rebuilds dependents when the dependency (in this case, the Clojure compiler) changes. > (...) > > >I think this preceding sentence is the heart of different assumptions between us. > > >The Clojure packages we haave are for developers writing applications (libraries and tools). The ecosystem has very few end-user applications [0]. As a Clojure developer I can use the Clojure tools from Guix, and a few libraries. We (and all the other distributions) have a miniscule portion of the Clojure/Java library universe [1]. This leads to the following usage scenarios: > > >1. A developer installs Clojure from Guix, and uses libraries from outside Guix. > They can install the JVM/Clojure and some common tools (like clj-tools-cli). They will use libraries from elsewhere, including their own. AOT compilation is a problem because of the issue of mixed AOT and non-AOT. > > >2. A developer installs a Clojure from outside Guix, uses libraries from inside Guix > This will cause problems because the Guix Clojure libraries will have been AOT'd by a different version of the compiler. It's also fairly common to install/use parallel versions of Clojure/jvm due to different deployment needs, this is likely to cause difficult to find bugs. > > My answer to (1) and (2) is: > > (a) About “install Clojure from outside Guix + use libraries inside Guix”: > > If these libraries are AOT: > > Don’t do that, then. If you mix-and-match binaries (in this case, .class files) different distributions, you are free to do so, but when (not if, when) things break, you get to keep the pieces. > > If these libraries are just the .clj files (not AOT) (which as I understand it is the standard situation): doesn’t seem a problem to me (see point (b)). > > Adding source from other places is one thing (probably ok), adding binaries is another (probably not ok, especially if unstable ABIs (see Clojure compiler) and mismatched versions (see hypotheses of 2.) are involved. > > (b) What is this “the issue of mixed AOT and non-AOT”? Do you have a source on this? Besides Clojure supposedly, I haven’t ever heard of such problems for any language – for example, there is no such issue with Guile and AFAIK not for Python. I haven’t heard of any such issues for the Common Lisp implementations either (though I haven’t checked), so this doesn’t seem like a “Clojure doesn’t do hygienic macros” issue. > > (c) Guix isn’t forcing anyone to use AOT’d libraries. If people really want to assist in murdering the climate (or its a situation where total cost of non-AOT is lower than AOT), they can unfortunately (*) simply do so applying a recursive transformation that adds #:aot? #false flags everywhere or whatever the exact argument is (**). > > Given that this transformation has some legitimate use cases, this transformation could even be a pre-canned procedure + transformation included in Guix itself > > (*) ‘unfortunately’ only applies to the first case. For the case in parentheses, replace by ‘fortunately’. > (**) IIRC is wasn’t #:aot? but some other name, but that’s not really the point here. > > (d) If a deployment need multiple versions of Clojure, then just fix your deployment to make everything work with the latest version of Clojure. Or, if you for some reason don’t do that, just use a (recursive) transformation to change the version of the Clojure compiler used to match the Clojure that will be used in the particular deployment. > > (e) You can simply add missing packages to Guix as the need arises. > > >I can see the sense of compiling to byte code if it's an end-user application. In that case we'd want to make the start-up as fast as possible. Your comments seem to have this use-case in mind. > > >But, today there aren't any such end-user Clojure applications in Guix. > > That’s a shame. Hopefully that will change some day. > Also, this is false, “clojure-tools” exists – developers are people too (I don’t care about the “_end_-user” distinction – surely developers want fast start-up as well). > > Also, I _don’t_ have that use case in mind – I have efficiency in general in mind, efficiency of the start-up is only a part of that. > > The point is: most likely you will want the application to have AOT code, and that library has dependencies. Furthermore, likely many of these dependencies are dependencies of other applications as well. > > Instead of redoing the compilation of N shared dependencies for each M applications (total work: ~N*M), by not participating in these Clojure conventions, the total work of compiling dependencies can be reduced to ~N). > > Let’s avoid joining the madness that is Go’s build system and Cargo(*). > > (*) Rust is fine for compilation, it’s cargo that is the problem (at least, Cargo as used by Guix) – antioxidant (https://notabug.org/maximed/cargoless-rust-experiments) avoids the sheer inefficiency of Cargo. > > >> >I believe this means that with AOT code on, any user who installs a different version of Clojure from the one that we used to AOT the libraries *may* have problems. > >> > >> Unlike, say, Maven, this situation simply does not happen in Guix, because we don’t just download binaries and call it a day (except for some bootstrapping stuff, but that’s not relevant for Clojure AOT), because we have functioning recompilation of dependents, because of shebang patching, because binaries that are to be invoked should not rely on the ambient CLASSPATH / LD_LIBRARY_PATH / etc. and, if, the underlying binaries do rely on that, they are wrapped (see wrap-program) to set them (or, at least, they should be, you might find some bugs in this department if you go looking). > >> > >> Even if they aren’t wrapped, then in that case the dependencies are propagated-inputs, and you can only have a single version of a propagated package in the same environment (barring stacking environment shenanigans, but then you are looking for it and/or you can just report a bug about how the binaries should be wrapped/classpath should be patched in/...). > > > > >In this paragraph you're assumption is that a Guix user is only using libraries from within Guix. Hopefully, I've shown why this assumption is unlikely above. > > You haven’t. You have shown that other situations exist, not that this situation is unlikely. To demonstrate likelihood / unlikelyhood, you need some statistics (or a very thorough argument on why people wouldn’t just make a package for missing dependencies – it’s very simple, especially if you aren’t sending them for inclusion.) > > >You also mentioned Debian, and @e.hashiman [2] said that Clojure libraries are not AOT'd on Debian, while applications are. From what I can find there are 130 packages in Debian with the word Clojure in them [3]. I looked at a selection and it seems true that Debian does not AOT libraries (and I can't find any Clojure 'apps'). For completeness I also checked what Clojars, the main distribution archive for Clojure developers, does: > > [...] > > OK ... and? Other people doing things differently doesn’t mean those different approaches are better. If Debian mentions somewhere the reason _why_ it doesn’t AOT libraries, that reason can be investigated and perhaps carried over to Guix, but it’s the ‘why’ that’s important, not the ‘it doesn’t’. > > > Does this help clarify why I'm asking to change the default? > > Yes. It appears you are unfamiliar with the “transformations” functionality of Guix, which allows for easy rewriting of packages to whatever Clojure version you want, eliminating compatibility concerns or even turning off AOT completely. > > (This requires the relevant versions of Clojure to be packaged in Guix, but that shouldn’t be too much of a problem.) > > It also appears you are unfamiliar with Guix importers, which easily make package definitions (somewhat low quality w.r.t. descriptions, with lack of verification of freeness, etc., but usually otherwise fully functional). I don’t know if an importer for Clojure exists but it shouldn’t be too difficult I think. > > Best regards, > Maxime Devos.