]> git.proxmox.com Git - proxmox.git/blame_incremental - README.rst
bump proxmox-sys to 0.5.3-1
[proxmox.git] / README.rst
... / ...
CommitLineData
1Local cargo config
2==================
3
4This repository ships with a ``.cargo/config`` that replaces the crates.io
5registry with packaged crates located in ``/usr/share/cargo/registry``.
6
7A similar config is also applied building with dh_cargo. Cargo.lock needs to be
8deleted when switching between packaged crates and crates.io, since the
9checksums are not compatible.
10
11To reference new dependencies (or updated versions) that are not yet packaged,
12the dependency needs to point directly to a path or git source.
13
14Steps for Releases
15==================
16
17- Run ./bump.sh <CRATE> [patch|minor|major|<VERSION>]
18-- Fill out changelog
19-- Confirm bump commit
20- Build packages with `make deb`.
21-- Don't forget to commit updated d/control!
22
23Adding Crates
24=============
25
261) At the top level:
27 - Generate the crate: ``cargo new --lib the-name``
28 - Sort the crate into ``Cargo.toml``'s ``workspace.members``
29
302) In the new crate's ``Cargo.toml``:
31 - In ``[package]`` set:
32 authors.workspace = true
33 license.workspace = true
34 edition.workspace = true
35 exclude.workspace = true
36 repository.workspace = true
37 - Add a meaningful ``description``
38 - Copy ``debian/copyright`` and ``debian/debcargo.toml`` from another subcrate.
39
40Adding a new Dependency
41=======================
42
431) At the top level:
44 - Add it to ``[workspace.dependencies]`` specifying the version and any
45 features that should be enabled throughout the workspace
46
472) In each member's ``Cargo.toml``:
48 - Add it to the desired dependencies section with ``workspace = true`` and no
49 version specified.
50 - If this member requires additional features, add only the extra features to
51 the member dependency.
52
53Updating a Dependency's Version
54===============================
55
561) At the top level:
57 - Bump the version in ``[workspace.dependencies]`` as desired.
58 - Check for deprecations or breakage throughout the workspace.
59
60Notes on Workspace Inheritance
61==============================
62
63Common metadata (like authors, license, ..) are inherited throughout the
64workspace. If new fields are added that are identical for all crates, they
65should be defined in the top-level ``Cargo.toml`` file's
66``[workspace.package]`` section, and inherited in all members explicitly by
67setting ``FIELD.workspace = true`` in the member's ``[package]`` section.
68
69Dependency information is also inherited throughout the workspace, allowing a
70single dependency specification in the top-level Cargo.toml file to be used by
71all members.
72
73Some restrictions apply:
74- features can only be added in members, never removed (this includes
75 ``default_features = false``!)
76 - the base feature set at the workspace level should be the minimum (possibly
77 empty!) set required by all members
78- workspace dependency specifications cannot include ``optional``
79 - if needed, the ``optional`` flag needs to be set at the member level when
80 using a workspace dependency