From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Craven Subject: Re: rust: cargo build-system: how to handle libraries Date: Wed, 28 Dec 2016 01:07:52 +0100 Message-ID: References: <8760m5c4dv.fsf@wasp.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52543) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cM1mh-0006l1-2g for guix-devel@gnu.org; Tue, 27 Dec 2016 19:07:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cM1md-0002ym-2V for guix-devel@gnu.org; Tue, 27 Dec 2016 19:07:59 -0500 Received: from mail-qt0-x22b.google.com ([2607:f8b0:400d:c0d::22b]:34286) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cM1mc-0002yb-Ta for guix-devel@gnu.org; Tue, 27 Dec 2016 19:07:54 -0500 Received: by mail-qt0-x22b.google.com with SMTP id d45so116765822qta.1 for ; Tue, 27 Dec 2016 16:07:53 -0800 (PST) In-Reply-To: <8760m5c4dv.fsf@wasp.i-did-not-set--mail-host-address--so-tickle-me> 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: ng0 Cc: guix-devel > We run (or this is the default) cargo with `--bin`, which is > necessary for everything which needs to be compiled and features > a Cargo.toml. All crates have a Cargo.toml file. The interesting crates are the ones with a Cargo.lock file. > To "build" libraries, we have to explicitly tell cargo to not > run/build/whatever with --bin ? Building libraries is currently not very useful at the moment, since they are not meant to be libraries in the C sense, but in the sense that it's a collection of source code that can be reused in a rust project. One can create a library in the C sense, but most crates do not do this and are not intended to be abi compatible with C. > Or do I have to interprete what I read a while ago "we just need > to copy the libraries to the store" as literally "if we encounter > no Cargo.toml, let's copy everything to the store as is"? If we encounter no Cargo.lock file it generally means the above.