8a62ad9f3d
When we started using cxxrs, most of the glib-rs objects like `OstreeRepo`/`OstreeSysroot` were owned by C++ and passed down into Rust. That motivated the addition of the special bridging infrastructure to re-create a glib-rs wrapper type from what cxxrs wants (a `Pin<&mut T>`). But now that we're adding more in Rust, we have the need to pass these objects back into C++. In fact this will hopefully soon because the default case as more of the binary entrypoint becomes Rust. Add another trait with a method `gobj_rewrap()` that converts in the other direction. This implementation took me a number of tries before I finally settled on simply using `mem::transmute()`. There are a *lot* of caveats listed on the docs for that function, but I think it really is what we want here. See the link for pending work on a Rust RFC to enable safe transmutes for some cases, and I believe that would cover this use case: https://internals.rust-lang.org/t/pre-rfc-v2-safe-transmute/11431 I've verified this works in a separate patch, but this commit also adds a simple test case - this goes all the way from: Rust glib-rs `ostree::Repo` (holding strong ref) -> Rust `Pin<&mut ostree_sys::OstreeRepo>` -> (internal cxx-rs C bridge) -> C++ `OstreeRepo&` reference -> C `OstreeRepo*` pointer Which is quite the dance if you think about it! |
||
---|---|---|
.github | ||
api-doc | ||
buildutil | ||
ci | ||
completion | ||
design | ||
docs | ||
experiments-and-demos/skopeo2ostree | ||
libdnf@27ac9873ea | ||
libglnx@4c9055ac08 | ||
man | ||
packaging | ||
rust | ||
src | ||
tests | ||
.cci.jenkinsfile | ||
.dir-locals.el | ||
.editorconfig | ||
.gitmodules | ||
.vimrc | ||
autogen.sh | ||
build.rs | ||
cargo-vendor-config | ||
Cargo.lock | ||
Cargo.toml | ||
cbindgen.toml | ||
configure.ac | ||
CONTRIBUTING.md | ||
COPYING.GPL | ||
COPYING.LGPL | ||
git.mk | ||
HACKING.md | ||
LICENSE | ||
Makefile-bash.am | ||
Makefile-daemon.am | ||
Makefile-decls.am | ||
Makefile-extra.inc | ||
Makefile-lib-defines.am | ||
Makefile-lib.am | ||
Makefile-libpriv.am | ||
Makefile-man.am | ||
Makefile-rpm-ostree.am | ||
Makefile-tests.am | ||
Makefile.am | ||
Makefile.bindings | ||
OWNERS | ||
README.md | ||
RELEASE.md |
rpm-ostree: A true hybrid image/package system
rpm-ostree is a hybrid image/package system. It combines libostree as a base image format, and accepts RPM on both the client and server side, sharing code with the dnf project; specifically libdnf. and thus bringing many of the benefits of both together.
+-----------------------------------------+
| |
| rpm-ostree (daemon + CLI) |
+------> <---------+
| | status, upgrade, rollback, | |
| | pkg layering, initramfs --enable | |
| | | |
| +-----------------------------------------+ |
| |
| |
| |
+-----------------|-------------------------+ +-----------------------|-----------------+
| | | |
| libostree (image system) | | libdnf (pkg system) |
| | | |
| C API, hardlink fs trees, system repo, | | ties together libsolv (SAT solver) |
| commits, atomic bootloader swap | | with librepo (RPM repo downloads) |
| | | |
+-------------------------------------------+ +-----------------------------------------+
Features:
- Transactional, background image-based (versioned/checksummed) upgrades
- OS rollback without affecting user data (
/usr
but not/etc
,/var
) via libostree - Client-side package layering (and overrides)
- Easily make your own:
rpm-ostree compose tree
and CoreOS Assembler
Documentation
For more information, see the project documentation or the project documentation website.
License
rpm-ostree includes code licensed under GPLv2+, LGPLv2+, (Apache 2.0 OR MIT). For more information, see LICENSE.