From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH 08/12] build-system: Add cargo build system. Date: Fri, 30 Sep 2016 14:13:27 +0200 Message-ID: <87wphtmvq0.fsf@gnu.org> References: <20160922131903.1606-1-david@craven.ch> <20160922131903.1606-8-david@craven.ch> <87lgyfklsz.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44535) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpwh7-0001Hw-CG for guix-devel@gnu.org; Fri, 30 Sep 2016 08:13:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bpwh1-0007SN-7N for guix-devel@gnu.org; Fri, 30 Sep 2016 08:13:36 -0400 In-Reply-To: (David Craven's message of "Mon, 26 Sep 2016 20:01:07 +0200") 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+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: David Craven Cc: guix-devel David Craven skribis: >>> +(define* (configure #:rest empty) >>> + "Replace Cargo.toml [dependencies] section with guix inputs." >>> + ;;TODO >> >> So what would this do? Do we end up using bundled dependencies if we >> don=E2=80=99t do that? > > If we don't do that cargo tries to download them from crates.io, and > since it's running in a container, would fail. OK, fine. >>> +(define* (build #:rest empty) >>> + "Build a given Cargo package." >>> + (zero? (system* "cargo" "build" "--release"))) >> >> It may be useful to make "--release" configurable, like the #:build-type >> of =E2=80=98cmake-build-system=E2=80=99. > >> Why do we need to install the source code? >> >> If it=E2=80=99s really needed for the functioning of the package, I=E2= =80=99d suggest >> moving it to OUT/share/rust-source/PACKAGE-VERSION or something like >> this, no? > > Rust doesn't have a fixed ABI yet, so cargo builds everything from > source. There is precedent in other distros (I think debian) and > languages (go). So Cargo *rebuilds* dependencies, even if they were built with the exact same compiler? In our case it would be great if we could disable that because we can ensure that we are indeed building using a single compiler. Thoughts? >>> + (install-file "Cargo.toml" rsrc) >>> + ;; Will fail if crate doesn't contain an executable >>> + (system* "cargo" "install" "--root" bin) >> >> I suppose many crates provides a library and no executable, so it=E2=80= =99d be >> nice to find what needs to be done here. Thoughts? > > if we replace all dependencies with local ones, this isn't an issue. I was referring to the comment above; what happens if we run =E2=80=9Ccargo install --root BIN=E2=80=9D on a package that does not contains executables? Thanks, Ludo=E2=80=99.