guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 08/12] build-system: Add cargo build system.


From: Ludovic Courtès
Subject: Re: [PATCH 08/12] build-system: Add cargo build system.
Date: Fri, 30 Sep 2016 14:13:27 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

David Craven <address@hidden> 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’t 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 ‘cmake-build-system’.
>
>> Why do we need to install the source code?
>>
>> If it’s really needed for the functioning of the package, I’d 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’d 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 “cargo
install --root BIN” on a package that does not contains executables?

Thanks,
Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]