Commit Graph

3441 Commits

Author SHA1 Message Date
Colin Walters
d5f518c785 Port rpmostree-json-parsing 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
Colin Walters
a2c5d1e659 Run rustfmt, and fix CI check for it
Moving the crate to the toplevel broke the CI check for `rustfmt`.
Fix it and run `cargo fmt`.
2020-12-21 19:59:31 -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
41ff46a1a6 Port rpmostree-rojig-assembler to C++
Prep for using https://cxx.rs/
2020-12-21 16:03:57 -05:00
Colin Walters
3f6b83ed9f Port rpmostree-origin to C++
Prep for using https://cxx.rs/
2020-12-21 16:03:57 -05:00
Colin Walters
2824fb556f Port rpmostree-rojig-client to C++
Prep for using https://cxx.rs/
2020-12-21 16:03:57 -05:00
Colin Walters
828be5380b Port rpmostree-importer to C++
Prep for using https://cxx.rs/
2020-12-21 16:03:57 -05:00
Colin Walters
88624692fb Port rpmostree-unpacker-core to C++
Prep for using https://cxx.rs/
2020-12-21 16:03:57 -05:00
Colin Walters
a03b5a26d7 Port rpmostree-scripts to C++
Prep for using https://cxx.rs/
2020-12-21 16:03:57 -05:00
dependabot[bot]
749b13f051 build(deps): bump cbindgen from 0.15.0 to 0.16.0 in /tooling
Bumps [cbindgen](https://github.com/eqrion/cbindgen) from 0.15.0 to 0.16.0.
- [Release notes](https://github.com/eqrion/cbindgen/releases)
- [Changelog](https://github.com/eqrion/cbindgen/blob/master/CHANGES)
- [Commits](https://github.com/eqrion/cbindgen/compare/v0.15.0...v0.16.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-21 10:14:08 +00:00
dependabot[bot]
2fb83b5ca1 build(deps): bump libdnf from 0aa50cc to 2ee2a47
Bumps [libdnf](https://github.com/rpm-software-management/libdnf) from `0aa50cc` to `2ee2a47`.
- [Release notes](https://github.com/rpm-software-management/libdnf/releases)
- [Commits](0aa50cca61...2ee2a47e19)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-21 09:41:53 +00:00
Colin Walters
022ff333a3 Port rpmostree-libarchive-input-stream to C++
Prep for using https://cxx.rs/
2020-12-21 08:58:14 +00:00
Colin Walters
8bdbc81442 Port rpmostree-refts to C++
Prep for using https://cxx.rs/
2020-12-21 08:58:14 +00:00
Colin Walters
1ec8a341f8 Port rpmostreed-transaction-livefs to C++
Prep for using https://cxx.rs/
2020-12-21 08:58:14 +00: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
ec4c1b5530 Port rpmostree-util 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
a3e2853942 lib: Make varsubst_basearch propagate errors
Shouldn't happen, but it's better than aborting.
2020-12-20 15:23:53 +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
e05ed11d50 tests: Disable C unit tests
These link to librpmostreepriv.la which will be going away.
I think we should basically focus on moving code into Rust which
has a solid solution for this in `#[test]` and debug vs release
builds etc.
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
3e025d9b92 lib: Drop dependencies on internal librpmostree-priv
A long time ago now we started injecting the package list
into the ostree commit.
We were carrying backwards compatibility code to do a checkout
of an ostree commit and extract it, but if we delete that
and have it return an error, it removes the last bits
that end up calling into our internal librpmostreepriv.la.

Now the internal shared library only links to our private `libdnf.so.2`,
`libglnx.la` statically, and libglib.so and libostree.so.

In the future it'd be nice to even drop the linkage to `libdnf.so.2`
because that drags in a lot of stuff, and I suspect e.g. gnome-software
may hit incompatibilities if it also links in the "system" libdnf.
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
15836d988a Port rpmostree-passwd-util to C++
Prep for using https://cxx.rs/
2020-12-19 12:40:43 +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
0571917254 Port rpmostree-output to C++
Prep for using https://cxx.rs/
2020-12-19 12:40:43 +00:00
Colin Walters
baf395e9ed spec: Propagate Fedora default rustflags
We got annobin (hardening) warnings in a downstream RPM analysis,
I think this will help ensure that the Rust code is built with
things like `-znow` etc.
2020-12-17 01:35:27 +00:00
Colin Walters
9d927e9850 daemon: Record the agent ID in the journal
Related to https://github.com/coreos/rpm-ostree/issues/1747

Basically after this we can have `rpm-ostree status` output
e.g. `Agent: zincati` at least *after* an upgrade has happened.
2020-12-16 13:55:11 +00:00
Colin Walters
b3b4dd3d22 msrv: Bump to Rust 1.48.0
We need this for https://cxx.rs

While we're here:

 - Add some more comments/links
 - Since the Rust bits are now at the toplevel, we can explicitly
   invoke `cargo`
 - And since we can do that, use the `+` syntax to specify the
   toolchain explicitly
2020-12-15 16:17:44 +00:00
Colin Walters
3065554ba1 transaction: Also log to journal when processes connect to txn
We have logging when a "client" connects to us over the main bus,
but none when a "process" connects to the transaction-private
DBus socket.

It's going to help us debug problems to log the latter.  In
the future we can try to correlate them, but for now simple
logging in a similar way should help.
2020-12-15 05:07:25 -05:00
Colin Walters
0c5820fd69 service: Explicitly RequiresMountsFor=/boot
See 82679ce834

I've seen at least one user report a bunch of failing
services on CoreOS that might be due to `/boot` not mounting.
Let's make it explicitly clear this is required.

The error would then be systemd saying a dependency failed, rather
than ostree confusingly saying it can't invoke `readlinkat()`.
2020-12-14 14:43:06 -05:00
Colin Walters
63717138ab apply-live: Print a success message
Silence is a bit too eerie for this.  But what we really
need to do is switch to using cxx-rs so we can pass down the
`Transaction` object into Rust so that we can emit messages
from that side (including things like package diffs).
2020-12-14 11:55:09 -05:00
Colin Walters
d9e9e5cf9b Rename ex livefs to ex apply-live
(Keeping the old name for muscle memory compatibility for now)

I think `apply-live` is a clearer name; it's more imperative
and it may not be obvious (particularly to non-native English speakers)
to parse "livefs" as "live fs".
2020-12-14 11:55:09 -05:00
Colin Walters
901649cf2c Port rpmostreed-transaction-types to C++
Prep for using https://cxx.rs
2020-12-14 11:02:56 -05:00
Colin Walters
c75ca8a5c4 Port rpmostreed-os to C++
Prep for using https://cxx.rs
2020-12-14 11:02:56 -05:00
Colin Walters
007a50c51e Port rpmostree-deployment-utils to C++
Prep for using https://cxx.rs
2020-12-14 11:02:56 -05:00
Colin Walters
7d96b598f6 Port rpmostree-sysroot-core to C++
Prep for using https://cxx.rs
2020-12-14 11:02:56 -05:00
Colin Walters
2409228d76 Port rpmostree-sysroot-upgrader to C++
Prep for usage of cxx.rs
2020-12-14 11:02:56 -05:00
dependabot[bot]
f62ec35c41 build(deps): bump libdnf from 028bc35 to 0aa50cc
Bumps [libdnf](https://github.com/rpm-software-management/libdnf) from `028bc35` to `0aa50cc`.
- [Release notes](https://github.com/rpm-software-management/libdnf/releases)
- [Commits](028bc355b9...0aa50cca61)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-14 04:15:43 -05: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
171e80fe41 Release 2020.10 2020-12-11 13:56:19 -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
0c7de65f8e Port rpmostree-kernel to C++
Prep for reworking `core.rs` to use cxx-rs

(Notable in this is the dropping of `goto out` by writing
 a small struct with a destructor to handle the cleanup `unlinkat()` for us)
2020-12-11 06:58:53 -05:00
Colin Walters
9c9188ceae rust: Add deny(unused_must_use)
We're maintaining the operating system, let's hard require
that errors are checked.
2020-12-11 06:58:45 -05:00
Colin Walters
4ce1cd2342 Release 2020.9
A lot of stuff here; new livefs is a big one.  Plus a lot
of internal cleanups, the introduction of C++ and
the 32 bit package script fix etc.
2020-12-10 22:12:39 -05:00
Colin Walters
a93dc55afd Remove unused build cruft (Vagrantfile, old Dockerfile etc)
None of this stuff is maintained or used.
2020-12-10 21:29:19 -05:00
Timothée Ravier
b7fa99e408 rust: Fix various clippy warnings 2020-12-10 15:07:11 -05:00