[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: rust: cargo build-system: how to handle libraries
From: |
David Craven |
Subject: |
Re: rust: cargo build-system: how to handle libraries |
Date: |
Wed, 28 Dec 2016 01:07:52 +0100 |
> 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.