Commit Graph

115 Commits

Author SHA1 Message Date
Thomas Lamprecht
52a8eb6ace d/control: tree wide update after switch to weak/namespaced dependencies
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-08-26 12:07:36 +02:00
Fabian Grünbichler
289d297c7d build: use weak and namespaced features
to reduce the creep of optional dependencies being exposed as features.

this requires cargo 0.63 (and debcargo built against at least that
version), but greatly reduces the number of binary packages and provides
generated, while still allowing sensible selection of optional
dependencies via the explicit feature meant for pulling them in.

diff stat for running `make  deb` after this change:
 proxmox-http/debian/control         | 226 ++++--------------------------------
 proxmox-router/debian/control       |  74 +-----------
 proxmox-schema/debian/control       |  53 ++-------
 proxmox-subscription/debian/control |  17 +--
 proxmox-sys/debian/control          |  51 +++-----
 proxmox-tfa/debian/control          | 110 ++----------------
 6 files changed, 72 insertions(+), 459 deletions(-)

the 'dep:' prefix marks something on the RHS inside the features section
as dependency, it's only allowed if the string after it is an optional
dependency an no explicit feature of the same name exists. if all
pointers to the optional dependency in the features section are marked
as such, the optional dependency itself will not be exposed as a feature
(either on the cargo or debian/control level).

the '?' suffix marks dependencies as "weak", which only enables the
optional dependency + its feature(s) if the optional dependency itself
is also enabled. it has no effect on d/control since such a relationship
is not encodable in Debian package relations, but it does affect cargo
dependency resolution and allows skipping the build of unneeded optional
dependencies in some cases.

with no packages/crates depending on the no longer exposed automatically
generated features/packages, so these are safe to remove even though
it's technically a breaking change.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-08-26 10:35:00 +02:00
Wolfgang Bumiller
6dc2393625 sys: drop comment from Cargo.toml
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-28 13:29:42 +02:00
Wolfgang Bumiller
6e857c6090 bump proxmox-sys to 0.4.0
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-28 13:28:21 +02:00
Wolfgang Bumiller
c5382d1b20 sys: doc fixup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-27 10:55:10 +02:00
Wolfgang Bumiller
6cac8d5cbe sys: another Arc::clone
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-26 14:45:39 +02:00
Wolfgang Bumiller
51746a0d45 sys: explicit Arc::clone
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-26 14:44:49 +02:00
Wolfgang Bumiller
6e247b9593 sys: use Iterator::min instead of a manual version
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-26 13:21:36 +02:00
Wolfgang Bumiller
36903bf2fe sys: bump edition to 2021
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-26 13:04:09 +02:00
Wolfgang Bumiller
34d2c91118 sys: drop proxmox-borrow dependency
nix now has an owning directory iterator, we don't need it
anymore

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-26 12:24:14 +02:00
Wolfgang Bumiller
b84446a030 sys: enable CreateOptions::group_root/root_only
nix now has the required const fns

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-25 10:31:49 +02:00
Wolfgang Bumiller
d3364e07fb sys: file locking depends on timer feature
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-22 11:58:18 +02:00
Wolfgang Bumiller
e2e7ea6d62 sys: introduce 'acl', 'crypt' and 'timer' features
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-21 15:42:11 +02:00
Wolfgang Bumiller
757031ef33 sys: clippy fixups
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-20 13:35:58 +02:00
Wolfgang Bumiller
6e4a43d683 bump proxmox-sys to 0.3.2
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-07 11:49:57 +02:00
Wolfgang Bumiller
67fbf2b2ee sys: make escape_unit() more flexible, add unescape_unit_path
This adds the ability to use these functions with non-utf8
strings as well.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-07 11:45:26 +02:00
Wolfgang Bumiller
b1a5daef61 sys: clippy fixups
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-29 09:58:34 +02:00
Wolfgang Bumiller
8f769a3996 bump proxmox-sys to 0.3.1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-29 09:41:36 +02:00
Dominik Csapak
1e2aa3eea4 partially fix #2915: proxmox-sys: scandir: stat if file_type is unknown
when using readdir/getdents the file type might be 'DT_UNKNOWN'
(depending on the filesystem). Do a fstatat in that case to
get the file type. Since maybe the callback wants to do
a stat anyway, pass it there (if done)

adds two new helpers:
'file_type_from_file_stat': uses a FileStat struct to get the file type
'get_file_type': calls fstatat to determine the file_type

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-29 09:34:34 +02:00
Fabian Grünbichler
9dd4134052 bump proxmox-sys to 0.3.0
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-06-02 14:33:12 +02:00
Fabian Grünbichler
97fd3a0a14 sys: feature-gate logrotate (and zstd)
it's not needed everywhere we pull in proxmox-sys.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-06-02 14:08:37 +02:00
Wolfgang Bumiller
376af82be7 update proxmox-sys to nix 0.24.1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-02 13:34:09 +02:00
Fabian Grünbichler
43b4440ef0 sys: bump log dependency
to ensure format strings with "{var}" work properly.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-05-16 15:50:50 +02:00
Thomas Lamprecht
9c0e9dca59 tree wide update of genereated control
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-05 10:22:50 +02:00
Thomas Lamprecht
4cdeee64dc sys: make acl constants rustfmt safe
there's not much better one can do here..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-04-10 17:39:31 +02:00
Thomas Lamprecht
0a651e00a9 sys: rust fmt
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-04-10 17:39:31 +02:00
Wolfgang Bumiller
d663ff328a formatting fixup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-02-21 13:49:48 +01:00
Wolfgang Bumiller
57d052af36 workspace: set proxmox-lang dep version to 1.1
to ensure the error macros are available

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-02-21 13:45:46 +01:00
Dominik Csapak
d4b4115400 move io error helpers to proxmox-lang
this removes proxmox_sys as a dependecy for proxmox-async

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-02-21 13:35:14 +01:00
Fabian Grünbichler
ca563a8cfd misc clippy fixes
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-02-08 14:28:44 +01:00
Dominik Csapak
e428920a15 proxmox-sys: add FileSystemInformation struct and helper
code mostly copied from proxmox-backups 'disk_usage'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-02-01 12:26:14 +01:00
Dominik Csapak
131f3d9471 proxmox-sys: make some structs serializable
we already depend on serde anyway, and this makes gathering structs a
bit more comfortable

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-02-01 12:26:14 +01:00
Fabian Grünbichler
540fb905c2 sys: make xattr tests integration tests
these touch files, so should use the cargo-provided tmp dir, but that is
only available to benchmarks and integration tests, not unit tests.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-12-30 11:51:08 +01:00
Fabian Grünbichler
e8cb382442 add missing library dependencies
without these, the generated d/control files are incomplete and builds
fail on clean systems.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-12-30 11:51:08 +01:00
Thomas Lamprecht
61cd0ac2ba proxmox-sys: fix glob-import of anyhow
will break usage of the `Result::Ok()' with anyhow 1.0.49+ as that
added a new Ok helper, so a glob-import would make that shadow the
core one.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-12-13 07:46:34 +01:00
Wolfgang Bumiller
59986f1195 sys: another minor clippy fix
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-12-07 11:43:28 +01:00
Wolfgang Bumiller
b213dbb7c8 sys: formatting
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-12-07 11:42:53 +01:00
Wolfgang Bumiller
c280f73793 sys: clippy fixes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-12-07 11:42:53 +01:00
Fabian Grünbichler
6bb932e604 use nix::unistd::fchown
instead of re-implementing it, now that we depend on >=0.19

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-12-02 09:04:55 +01:00
Fabian Grünbichler
1db9a5bc0e clippy: allow manual_range_contains
we use it quite often in this module, and it's more readable when split.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-12-02 09:04:55 +01:00
Fabian Grünbichler
e303ad8605 clippy: misc fixes
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-12-02 09:00:52 +01:00
Wolfgang Bumiller
eac7ebfc55 sys: add back d/control
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-29 11:35:39 +01:00
Wolfgang Bumiller
30e99fef5b bump proxmox-sys to 0.2.2
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-29 11:33:42 +01:00
Wolfgang Bumiller
35ecf9a551 sys: deprecate the identity macro
to be removed with the next major version bump

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-29 11:31:39 +01:00
Wolfgang Bumiller
9dcc229491 sys: depend on sortable-macro 0.1.2
drops the requirement for the identity macro

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-29 11:30:06 +01:00
Wolfgang Bumiller
3891953724 proxmox-sys: fix a warning in io_bail_last macro
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-29 11:29:31 +01:00
Dietmar Maurer
248e888ae7 cleanup: avoid use anyhow::*
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-11-28 12:50:59 +01:00
Dietmar Maurer
10ad340322 bump proxmox-sys version to 0.2.1
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-11-25 12:12:35 +01:00
Dietmar Maurer
80df41a887 proxmox-sys: import pipe() function from pbs-toos/src/io.rs
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-11-25 10:34:33 +01:00
Dietmar Maurer
82245339b8 use new proxmox-sys 0.2.0 for all crates
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-11-24 10:00:38 +01:00