From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Craven Subject: Re: [PATCH 1/7] build-system: Add cargo build system. Date: Fri, 30 Sep 2016 12:49:13 +0200 Message-ID: References: <20160928151538.11679-1-david@craven.ch> <87r381svhs.fsf@elephly.net> 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]:52503) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpvNa-00089V-5W for guix-devel@gnu.org; Fri, 30 Sep 2016 06:49:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bpvNV-0006rr-3L for guix-devel@gnu.org; Fri, 30 Sep 2016 06:49:21 -0400 Received: from mail-yw0-x243.google.com ([2607:f8b0:4002:c05::243]:36268) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpvNT-0006r7-SU for guix-devel@gnu.org; Fri, 30 Sep 2016 06:49:17 -0400 Received: by mail-yw0-x243.google.com with SMTP id r132so326764ywg.3 for ; Fri, 30 Sep 2016 03:49:14 -0700 (PDT) In-Reply-To: <87r381svhs.fsf@elephly.net> 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: Ricardo Wurmus Cc: guix-devel > Is this correct? What happens when test-target is not specified? I see > below that the target is hard-coded to =E2=80=9Ctest=E2=80=9D. Maybe set= it to =E2=80=9Ctest=E2=80=9D > here and use it on the build side? > Shouldn=E2=80=99t this respect =E2=80=9Ctest-target=E2=80=9D? There is no other build target than test. Functions that are tests have an attribute #[cfg(test)] above them. Running cargo test tells cargo to run all functions that are annotated like that. > I=E2=80=99m not familiar with Rust so I don=E2=80=99t know what crates ar= e. Are they > actually source files? Are they archives? A crate is a tar.gz file which contains the source. > You write that we are replacing references in Cargo.toml with store > paths but I see no evidence of this. Could you please clarify? These patches only build packages without dependencies. I have packages importing/building with a simple dependency structure. I'm refactoring the importer to allow recursive imports, and then I'll try to package cargo with it. > Why only use =E2=80=9Ccargo install=E2=80=9D in case there are executable= s? Can we > detect this by looking at some description file of the package? It > doesn=E2=80=99t seem right to unconditionally end on #t. So we installed the source. At this point the build system can use it. The only time we install binaries is when the crate contains an executable or a script. In those cases `cargo install` should work. If there isn't an executable we don't care if it fails. > I don=E2=80=99t understand this. Does this mean that currently dependenc= ies are > always bundled? No. This is to prevent cargo from fetching the missing dependencies from crates.io and to use our crates. Rust/LLVM performs aggressive optimization= , executables include all their rust symbols. You can write a C compatible library, but most crates are meant for Rust development. They have their own binary format called *.rlib that is like an *.a file. The main focus for now is building cargo. The situation should improve, but this is how other distros are pack= aging crates currently.