Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 570080 Details for
Bug 680984
cargo.eclass; Improve rust packaging (package crates individually?)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
pdf -> txt
pdf2txt.txt (text/plain), 3.54 KB, created by
SpanKY
on 2019-03-20 20:33:07 UTC
(
hide
)
Description:
pdf -> txt
Filename:
MIME Type:
Creator:
SpanKY
Created:
2019-03-20 20:33:07 UTC
Size:
3.54 KB
patch
obsolete
>Rust Crate Management in >Chrome OS >last update: 2018-02-26, first proposed: 2018-02-26 >by: chirantan@ > >Objective >Adoption of rust for Chrome OS projects is rapidly increasing. As of today we have crosvm, >mosys, and memd. These projects may depend on additional rust crates from the rust >community. The goal of this document is to define a plan for managing all of these >dependencies in a way that will scale well. > >Background >Rust projects are built using the `cargo` tool. It looks for files named `Cargo.toml` and >`Cargo.lock` in the projectâs top-level directory. These files have a bunch of metadata >about the project, including the crates that it depends on. These dependencies are declared >using the SemVer specification. This means that a single rust project may depend on >multiple versions of the same crate: >â crate foo depends on version 0.3 of crate bar >â crate foo also depends on version 0.2 of crate baz >â version 0.2 of crate baz depends on version 0.2 of crate bar >The `cargo` tool is able to handle these dependencies without issue. > >Requirements >â Keep track of all crates being used in Chrome OS. >â Keep track of licensing and copyright attribution information for third party crates. >â Be able to answer questions like: which packages depend on this rust crate? >â Have an easy way to patch crates for applying security updates. > >Proposed Solution >Put each crate into its own ebuild. >â Built-in mechanism for tracking licensing and copyright attribution information. >â Easily figure out which packages depend on a crate with `equery-$BOARD d ><rust_crate>`. >â Apply patches with epatch. > >Implementation Details >Adding a new crate / updating a crate >Process for adding (or updating) a crate: >â Download a tarball for the appropriate version >â Upload the tarball to the Chrome OS localmirror >â Update the ebuild version / create a new ebuild that matches the version >â Set SLOT=â${PV}/${PR}â > >Install source files instead of build artifacts >The rust developers are very aggressive about not maintaining any ABI compatibility >between library crates and binaries. As a result there are no meaningful build artifacts that >can be installed into a boardâs sysroot. Instead, we will install all the source files into the >boardâs sysroot and tell cargo (via the cargo eclass) where to find the dependencies. This >does mean that the same package may be built multiple times. >Source files will be installed in /build/$BOARD/usr/lib/rust/${P}. We will probably use a >new eclass (cros-rust ?) to handle this so that individual ebuilds donât need to manually >install files. > >Dependencies go only in DEPEND >As a consequence of installing source files in the board sysroot, having a runtime >dependency on a rust crate doesnât really make any sense. Instead all rust crates should >only be listed as build-time dependencies. > >Use SLOTs to manage multiple versions of the same crate >Since a single package may depend on multiple versions of the same rust crate we need to >provide a way for the source for multiple versions of the crate to be installed at the same >time. We will accomplish this using portage SLOTs. Different versions of the package >should use different SLOT numbers (ideally SLOT=â${PV}/${PR}â). Similarly, the install >location for the source files will include the version number in the path so that there are no >file conflicts. > >Use SLOT operators for all dependencies >Rust packages should use SLOT operators on all rust crate dependencies. This will ensure >that when a crate is updated (and its SLOT is changed) any package that depends on it will >get rebuilt.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 680984
:
569922
| 570080