[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: rust build system, building libc crate
From: |
Danny Milosavljevic |
Subject: |
Re: rust build system, building libc crate |
Date: |
Mon, 5 Feb 2018 09:01:32 +0100 |
Hi ng0,
> and the Cargo.lock of libc is long. My assumption was it has no
> real dependencies. 0. Nada. Nichts.
>
> I think I have to read more into rust packaging, in the meantime
> it would be good if someone with reference to the first email and
> the email I referenced in there could reply about their knowledge
> of the rust/cargo build system. I'm okay with stabbing in the
> dark, but shared expertise is good.
The rust-build-system takes a wild guess as to what is a library and
what isn't. The Cargo.lock "freezes" the dependencies to a known-good
configuration - and most libraries don't do that. So the rust-build-system
uses that as a clue - if there's a file named "Cargo.lock" then the thing
is treated as a program (which means that the build system will invoke
"cargo install" on it).
My rust-libc package definition is:
(define-public rust-libc
(package
(name "rust-libc")
(version "0.2.18")
(source
(origin
(method url-fetch)
;; (crate-uri "libc" version) doesn't contain libc-test.
(uri (string-append "https://github.com/rust-lang/libc/archive/" version
".tar.gz"))
(file-name (string-append name "-" version ".tar.gz"))
(sha256
(base32
"1mh62gfm91aypbr830m2qklwgscgb0pcfpxzi3a6k60faamlrndf"))))
(build-system cargo-build-system)
;(native-inputs
; `(("rust-ctest-bootstrap" ,rust-ctest-bootstrap "src")))
(arguments
`(#:tests? #f ; missing dependencies
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'delete-lock
(lambda _
(delete-file "Cargo.lock")
#t))
(delete 'build))))
(home-page "https://github.com/rust-lang/libc")
(synopsis "Raw bindings to platform APIs for Rust")
(description
"Libc provides a library for types and bindings to native
C functions often found in libc or other common platform libraries.")
;; Choose either license.
(license (list license:expat license:asl2.0))))
I've attached the other crates I have (most of them unfinished).
The main problems is dependency cycles, as usual.
crates.scm
Description: Text Data