Commit Graph

171 Commits

Author SHA1 Message Date
Timothée Ravier
6cfdb1f585 countme: Add DNF Count Me support
Add support for the DNF Count Me feature [1,2,3] as a standalone
rpm-ostree subcommand called weekly via a systemd timer.

[1] https://fedoraproject.org/wiki/Changes/DNF_Better_Counting
[2] https://dnf.readthedocs.io/en/latest/conf_ref.html?highlight=countme#options-for-both-main-and-repo
[3] https://github.com/rpm-software-management/ci-dnf-stack/blob/master/dnf-behave-tests/features/countme.feature
2021-01-13 14:53:50 -05:00
Colin Walters
5b19195fe8 With vendored source, use cargo build --offline
This way we're sure it will build in e.g. Koji.  Right now
it's annoying to test that locally; one needs to explicitly
create a no-network container to do so strictly.  But
cargo has a convenient `--offline` flag, and nothing else
in our build stack should touch the network.
2021-01-11 15:10:07 -05:00
Colin Walters
08c414f897 Rework bindgen/cxx.rs usage and CI build
cxx.rs (aka cxxbridge) and cbindgen are
both generating source code.  Since the last release
we've introduced the former, and we need to ensure
that the generated cxx.rs source ends up in release tarballs
the same way as the cbindgen code.

Rationalize and clean up the binding infrastructure.
Drop support for the vendored cbindgen which we
weren't actually using:
Closes: https://github.com/coreos/rpm-ostree/issues/2392

Move the cxx-rs and cbindgen bits into the same place,
and update our CoreOS CI build to use a separate `Makefile.bindings`
that just generates the code, so our CI still "works like"
a main Koji RPM build.
2021-01-04 13:17:35 +01:00
Colin Walters
9b13ce3906 buildsys: Make one big rpmostreeinternals.la, enable unit tests again
In the previous buildsytem rework we disabled the unit tests because
of linking problems.  Now I realized that a simple solution is
to continue to build one big object, just make it an internal
static library and have a tiny "stub main" that delegates to an entrypoint.

That's basically what the C unit tests are - an alternative `main()`
with some extra code.
2020-12-23 17:45:29 +01:00
Colin Walters
d8263d2c38 Port rpmostree-builtin-compose to C++
Prep for using https://cxx.rs/
2020-12-22 16:36:13 -05:00
Colin Walters
642c8b1453 Port rpmostree-builtin-kargs to C++
Prep for using https://cxx.rs/
2020-12-22 16:36:13 -05:00
Colin Walters
9a91eecbb0 Port rpmostree-polkit-agent to C++
Prep for using https://cxx.rs/
2020-12-22 16:36:13 -05:00
Colin Walters
665bb07994 Port rpmostree-override-builtins to C++
Prep for using https://cxx.rs/
2020-12-22 16:36:13 -05:00
Colin Walters
2ada9808ec Port rpmostree-db-builtin-version to C++
Prep for using https://cxx.rs/
2020-12-22 16:36:13 -05:00
Colin Walters
604145e1f9 Port rpmostree-db-builtin-list to C++
Prep for using https://cxx.rs/
2020-12-22 16:36:13 -05:00
Colin Walters
63b5ccb1b1 Port rpmostree-db-builtin-dif to C++
Prep for using https://cxx.rs/
2020-12-22 16:36:13 -05:00
Colin Walters
e58316ec94 Port rpmostree-builtin-finalize-deployment to C++
Prep for using https://cxx.rs/
2020-12-22 16:36:13 -05:00
Colin Walters
8ca0eddabf Port rpmostree-builtin-start-daemon to C++
Prep for using https://cxx.rs/
2020-12-22 09:24:34 -05:00
Colin Walters
79488a76de Port rpmostree-builtin-db to C++
Prep for using https://cxx.rs/
2020-12-22 09:24:34 -05:00
Colin Walters
761e92ab93 Port rpmostree-builtin-shlib-backend to C++
Prep for using https://cxx.rs/
2020-12-22 09:24:34 -05:00
Colin Walters
4462f16fa4 Port rpmostree-builtin-testutils to C++
Prep for using https://cxx.rs/
2020-12-22 09:24:34 -05:00
Colin Walters
5259323161 Port rpmostree-builtin-ex to C++
Prep for using https://cxx.rs/
2020-12-22 09:24:34 -05:00
Colin Walters
c3cff4f8f4 Port rpmostree-builtin-status to C++
Prep for using https://cxx.rs/
2020-12-22 09:24:34 -05:00
Colin Walters
ff5cc68879 Port rpmostree-builtin-initramfs-etc to C++
Prep for using https://cxx.rs/
2020-12-22 09:24:34 -05:00
Colin Walters
6052c92f75 Port rpmostree-builtin-initramfs to C++
Prep for using https://cxx.rs/
2020-12-22 09:24:34 -05:00
Colin Walters
b9cfbfae0f Port rpmostree-builtin-cleanup to C++
Prep for using https://cxx.rs/
2020-12-22 09:24:34 -05:00
Colin Walters
e9fc5a95e8 Port rpmostree-builtin-cliwrap to C++
Prep for using https://cxx.rs/
2020-12-22 09:24:34 -05:00
Colin Walters
b7050d61c2 Port rpmostree-builtin-cancel to C++
Prep for using https://cxx.rs/
2020-12-22 09:24:34 -05:00
Colin Walters
ccf2a1ea97 Port rpmostree-builtin-rebase to C++
Prep for using https://cxx.rs/
2020-12-22 09:24:34 -05:00
Colin Walters
e8bc9dbd00 Port rpmostree-builtin-reload to C++
Prep for using https://cxx.rs/
2020-12-22 09:24:34 -05:00
Colin Walters
7f65818d53 Port rpmostree-builtin-deploy to C++
Prep for using https://cxx.rs/
2020-12-22 09:24:34 -05:00
Colin Walters
5820fd2136 Port rpmostree-builtin-rollback to C++
Prep for using https://cxx.rs/
2020-12-22 09:24:34 -05:00
Colin Walters
7c1b6df951 Port rpmostree-builtin-upgrade to C++
Prep for using https://cxx.rs/
2020-12-22 09:24:34 -05:00
Colin Walters
8f3c50aacf Port rpmostree-builtin-livefs to C++
Prep for using https://cxx.rs/
2020-12-22 09:24:34 -05:00
Colin Walters
86efc2035a Port rpmostree-builtin-refresh-md to C++
Prep for using https://cxx.rs/
2020-12-22 09:24:34 -05:00
Colin Walters
8560e0ba3e Port rpmostree-builtin-usroverlay to C++
Prep for using https://cxx.rs/
2020-12-22 09:24:34 -05:00
Colin Walters
626e82fb3a Port rpmostree-builtin-override to C++
Prep for using https://cxx.rs/
2020-12-22 09:24:34 -05:00
Colin Walters
6c47792bd0 Port rpmostree-builtin-reset to C++
Prep for using https://cxx.rs/
2020-12-22 09:24:34 -05:00
Colin Walters
89b9020e31 Port rpmostree-pkg-builtins to C++
Prep for using https://cxx.rs/
2020-12-22 09:24:34 -05:00
Jonathan Lebon
df9c60ea62 Makefile-rpm-ostree: fix path to cbindgen.toml
Minor regression from #2365.
2020-12-21 20:31:30 -05:00
Jonathan Lebon
db775f43ec Default to sqlite rpmdb backend on f34
There won't be any support for writing to the bdb backend in f34, so
e.g. pkglayering won't work (and obviously even composes wouldn't work
once the buildroot moves to f34).

Instead of requiring the whole world to add an `rpmdb` key in their
manifests, let's just add a compile flag for it, and tweak the spec file
to use this flag on f34.
2020-12-21 19:01:48 -05:00
Colin Walters
aeb3dc2c07 Port rpmostree-libbuiltin to C++
Prep for using https://cxx.rs/
2020-12-21 08:58:14 +00:00
Colin Walters
9ad21b205a Port compose-builtin-rojig to C++
Prep for using https://cxx.rs/
2020-12-21 08:58:14 +00:00
Colin Walters
b62b9850c2 Port rojig2commit to C++
Prep for using https://cxx.rs/
2020-12-21 08:58:14 +00:00
Colin Walters
29dbeee72f More C++ porting, round 6
Port rojig-build and rpm-util to C++.

Prep for using https://cxx.rs/
2020-12-21 08:58:14 +00:00
Colin Walters
f35afb197d buildsys: Unify build of binary and internal shared library
This completes the task of unifying the build of all of our C/C++
into a single unit, which avoids code duplication and will allow
us to more easily use LTO in the future.
2020-12-20 15:23:53 +00:00
Colin Walters
ec5bdca9e5 buildsys: Compile daemon code directly with binary
A long time ago we de-duplicated the daemon and binary
into a single executable, but left the daemon code
building as an internal static library.

Let's take the next step and compile the sources directly as part
of the executable build.  For example, we can then de-duplicate
the `CFLAGS/CXXFLAGS`.  And in the future this will help us
turn on LTO.
2020-12-20 15:23:53 +00:00
Colin Walters
1de524f668 shlib: Make basearch APIs call /usr/bin/rpm-ostree shlib-backend
This is a potential path to fix
https://github.com/coreos/rpm-ostree/issues/2391

Basically our shared library and executable duplicate too much
code (particularly Rust).  Since most of the shlib APIs aren't
performance sensitive, let's have them fork off the binary
via a hidden CLI entrypoint and parse the output.
2020-12-20 15:23:53 +00:00
Colin Walters
b78de32d21 Port rpmostree-composeutil to C++
Prep for using https://cxx.rs
2020-12-19 12:40:43 +00:00
Colin Walters
2ec303b244 main: Convert to C++
Also here, catch C++ exceptions and convert to GError.
2020-12-11 15:17:00 -05:00
Colin Walters
c718f34d43 Fix and improve support for rpmostree-rust.h being pre-generated
First, we now need the `vendor/` directory at the toplevel because
that's where `Cargo.toml` is.

Now this triggers another bug introduced in the build system
with how we're handling the `rpmostree-rust.h` header.
We ended up vendoring a pre-generated one in the tarball
mainly because RHEL doesn't include cbindgen.
Now probably in the future I'd like to fix that.

But let's clean this up - the tarball generation process copies
the file into `rpmostree-rust-prebuilt.h`, and build machinery
detects that and entirely skips looking for or trying to build
our internal cbindgen.
2020-12-11 11:54:34 -05:00
Colin Walters
f1488e52f0 Move the main Rust infra (i.e. Cargo.toml) to the toplevel
I think we should have done this as soon as it was clear that
Rust was sticking and not just an optional thing.

Reasons to make this change now:
 - More clear that Rust is going to be the majority of code in the future
 - `cargo build` and `cargo test` in a fresh git clone Just Work
 - Paves the way for using `cargo` to build C/C++ instead of Automake
2020-12-09 17:42:35 -05:00
Colin Walters
90f4427bbf Move bindgen into tooling/, add dependabot
Prep for adding cxxbridge-cmd which we need to vendor too.
2020-12-08 16:32:24 -05:00
Colin Walters
6722496bb1 app: Port dbus-helpers to C++
Prep for using https://cxx.rs/
2020-12-08 09:57:08 -05:00
Colin Walters
bee9c0f605 Remove ex-container
I still think we should do this at some point, but
the experiment with using `GKeyfile` for configuration
is IMO a failure and the variety of data formats
(treefile JSON vs YAML vs origin keyfiles vs container keyfiles)
causes a lot of confusion.

Prep for https://github.com/coreos/rpm-ostree/issues/2326
2020-12-01 23:51:45 +01:00