From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 01 22:17:34 2019 Received: (at 38408) by debbugs.gnu.org; 2 Dec 2019 03:17:34 +0000 Received: from localhost ([127.0.0.1]:36928 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ibcDO-0000zk-5v for submit@debbugs.gnu.org; Sun, 01 Dec 2019 22:17:34 -0500 Received: from mx1.riseup.net ([198.252.153.129]:50034) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ibcDM-0000zZ-KI for 38408@debbugs.gnu.org; Sun, 01 Dec 2019 22:17:33 -0500 Received: from capuchin.riseup.net (capuchin-pn.riseup.net [10.0.1.176]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 47R9K74pl6zDyXn; Sun, 1 Dec 2019 19:17:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1575256651; bh=TcfwRDSETiFWN95jwXesU6AEdW4YfipFAnuEWcwton4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=QjG9ep9jD0jUz/SNnpCkw8oW+Rf9/85b21Q8PfIdEJdoeBiZq/5+qyf96aMypVnRR O9lA8oYWWe6fNSKiBPZgF/udBGNYdUSO3WK1JY3976wgjJPv3Z16NU05OuXmo5R2Ym EnSnIJWUO3hQgHY2N3512OK4FMKvcacxEZXCYkKI= X-Riseup-User-ID: E527341317AC04F4F013696A43592837619BCB6B005E03A56583E25355DD821B Received: from [127.0.0.1] (localhost [127.0.0.1]) by capuchin.riseup.net (Postfix) with ESMTPSA id 47R9K7279Gz8tVR; Sun, 1 Dec 2019 19:17:31 -0800 (PST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Sun, 01 Dec 2019 19:17:31 -0800 From: Martin Becze To: Efraim Flashner Subject: Re: [PATCH] WIP patches for the rust importer In-Reply-To: <20191201085941.GB14869@E5400> References: <20191126120408.GL1124@E5400> <1E01C051-2EE5-4050-B826-C60E858AAC2B@flashner.co.il> <0b2db52d687fc2acf34dc1e00618dae7.squirrel@sm.riseup.net> <20191128122255.GT1124@E5400> <8981451ac5d914dd5f53fa928741b846@riseup.net> <20191201085941.GB14869@E5400> Message-ID: X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 38408 Cc: guix-devel@gnu.org, 38408@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 2019-12-01 08:59, Efraim Flashner wrote: > On Fri, Nov 29, 2019 at 07:59:35AM -0800, Martin Becze wrote: >> On 2019-11-28 12:22, Efraim Flashner wrote: >> > On Wed, Nov 27, 2019 at 04:36:20PM -0800, mjbecze@riseup.net wrote: >> >> >> >> > I'd love to see what you have so far if you want to share >> >> >> >> Okie Dokie, I posted it and cc'd ya. >> >> >> >> Also I took a look at your patches. >> >> 0001-import-crate-Don-t-include-optional-dependencies.patch should work >> >> just fine with my patch. But >> >> 0003-import-crate-Honor-versioned-dependencies-when-impor.patch will not >> >> work. >> >> >> >> I took a different route here with the naming. If you are interested take >> >> a look take a look at my second patch. (recusive-import-semver) only will >> >> add the version number to the name if the crate being imported is not the >> >> latest version. I thought this was more inline with the canonical names, >> >> but if always adding version number the export symbol is desirable it will >> >> simplify things. >> >> >> > >> > I'll take a look at it in a minute. I figured with the versioned >> > requirements we would always want to be specific in version numbers for >> > crate dependents so I figured it made sense. Also, if we did want to >> > provide an unversioned '-latest' version we could declare an extra >> > variable '(define-public rust-libc rust-libc-0.2)' and now rust-libc >> > points to rust-libc-0.2. >> > >> >> Also I added a function (find-packages-by-name*/direct) to packages.scm >> >> which will return the export symbol of a package that already exists. I >> >> use this in case there are some non-canocal export name already added. >> >> >> >> I added the no-optional-dep logic to the recusive-semver patch >> (https://issues.guix.gnu.org/issue/38408), but it seems to break >> packages. I'm testing on the recursive importer on "hello-cli". Attach >> is the patch to add the logic and the before and after output for "guix >> import crate -r hello-cli". Removing all the optional deps breaks clap >> here for some reason which I haven't figured out. > > Looking at the two attached files I want to bring attention to the size > of them: > after.scm [text/plain, base64, utf-8, 5.7K] > before.scm [text/plain, base64, utf-8, 226K] > > One way to fix this (in addition to your "default to the don't build" > argument) is to keep rust-clap in it's broken state and define a > different rust-clap for when we actually want it and to have that use > enough inputs to actually build. I do now actually realize that only > really works if we keep all the crates hidden, which I don't think we > want. So I guess that has us sending bug reports upstream that some of > the optional dependencies aren't actually optional. > > In any case, I think it'd be better to skip the optional dependencies > and then add them back in as needed to actually build the crates we > want. oh to be more clear. Even with "#:skip-build? #t" on all the rust libs, things fail if I omit one optional dependency from somewhere. I'm just testing on hello-cli but hello-cli inculdes clap which has alot of optional deps. In ./guix/build-systems/cargo.scm on line 186 it says "Cargo requires all transitive crate dependencies' sources to be available in its index, even if they are optional (this is so it can generate deterministic Cargo.lock files regardless of the target platform or enabled features). Thus we need all transitive crate dependencies for any cargo dev-dependencies, but this is only needed when building/testing a crate directly (i.e. we will never need transitive dev-dependencies for any dependency crates)." I haven't really dug into the cargo build-system yet but my guess is that the problem lies there. Allllsooo i totally could have missed something simple.. idk