Commit Graph

167 Commits

Author SHA1 Message Date
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
Colin Walters
887d362906 Convert some code to compile in C++ mode
This is part of investigating using https://cxx.rs/
In order to make this really work, we need to convert some of our C
code to C++ so we can include cxx.rs-generated code.

This starts by converting just two files as a starting point.
I did the minimal porting; I didn't try to actually rewrite them
to resemble modern C++, just "C in C++ mode".
2020-12-01 22:07:49 +01:00
Colin Walters
7ed1c0b1e8 Remove coreos-rootfs command
This effectively reverts commit: c8113bde32
We never ended up using it; instead the `rdcore` bits from
`coreos-installer` have the rootfs reprovisioning logic.
2020-11-12 18:59:49 +01:00
Jonathan Lebon
4da10dc11e Add new ex initramfs-etc command
This command allows users to cheaply inject configuration files in the
initramfs stage without having to regenerate the whole initramfs (or
even a new OSTree commit). This will be useful for configuring services
involved in bringing up the root block device.

```
$ echo 'hello world' > /etc/foobar
$ rpm-ostree ex initramfs-etc --track /etc/foobar
Staging deployment... done
Run "systemctl reboot" to start a reboot
$ rpm-ostree status
State: idle
Deployments:
  ostree://fedora:fedora/x86_64/coreos/testing-devel
                   Version: 32.20200716.dev.1 (2020-07-16T02:47:29Z)
                    Commit: 9a817d75bef81b955179be6e602d1e6ae350645b6323231a62ba2ee6e5b9644b
              GPGSignature: (unsigned)
              InitramfsEtc: /etc/foobar

● ostree://fedora:fedora/x86_64/coreos/testing-devel
                   Version: 32.20200716.dev.1 (2020-07-16T02:47:29Z)
                    Commit: 9a817d75bef81b955179be6e602d1e6ae350645b6323231a62ba2ee6e5b9644b
              GPGSignature: (unsigned)
$ reboot
(boot into rd.break)
sh-5.0# cat /etc/foobar
hello world
```

See the libostree side of this at:
https://github.com/ostreedev/ostree/pull/2155

Lots more discussions in:
https://github.com/coreos/fedora-coreos-tracker/issues/94

Closes: #1930
2020-10-30 00:48:54 +01:00
Colin Walters
5650f376fb Add --enable-rojig, disable by default
We're seeing some CI failures that I think are a bug in rojig.
In the bigger picture...we never actually started using this,
and I think longer term shipping os updates via containers
probably makes more sense.

I put a *lot* of effort into this code and it's pretty cool
so it's hard to just delete it.  And *maybe* someone out there
is using it (but I doubt it).  So rather than just deleting
it entirely let's make it a build-time option.

I verified that it builds at least.
2020-10-22 15:38:50 -04:00