Commit Graph

93 Commits

Author SHA1 Message Date
Colin Walters
4b2aa02e50 Release 2021.3 2021-03-17 13:16:06 +00:00
Timothée Ravier
3929e38ac0 Remove rpm-ostree sysusers config 2021-03-16 19:07:20 -04:00
Colin Walters
8dd5583ae9 Remove cbindgen
We have fully transitioned to cxx-rs!  This drops a lot of now
dead code; only one binding system to think about generating
source code.  For example, a notable advantage of cxx-rs
is it doesn't scan the whole source code, so running `make`
doesn't spew errors from cbindgen not understanding bits.
2021-03-03 16:51:38 -05:00
Timothée Ravier
101d531f3b Install rpm-ostree sysusers config and countme units
Install the systemd unit, timer and sysusers configuration for Count Me
support. We do not enable or pull as a dependency those units by default
as this is a decision that should be taken at the distribution level and
needs support on the infrastructure side.

To enable those units in a disctribution package, you can add the
following symlink:
$ ln -snf /usr/lib/systemd/system/rpm-ostree-countme.timer /usr/lib/systemd/system/rpm-ostreed.service.wants/

or add the following config snippet to the rpm-ostreed.service unit:
Wants=rpm-ostree-countme.timer
2021-02-25 16:58:14 +01:00
Colin Walters
047f931746 Release 2021.2 2021-02-17 15:17:33 -05:00
Colin Walters
c48e8bfad3 ci: Rework build/test dependency install
Now that `ci/installdeps.sh` gracefully exits if run as non-root,
we can fold the cargo bits into the our build scripts and avoid
invoking both of them.

However, now we need to split test deps to separate file because
we won't have `cargo` in the main cosa pod.  This also fixes a FIXME.

Steal the `grep` invocation from cosa and make it a declarative
text file so we can have comments per package etc.
2021-02-16 18:18:27 -05:00
Colin Walters
f065c0dd32 Add --enable-sanitizers (not on by default yet)
This way we at least get unit test coverage (which...
our unit test coverage doesn't do much because our
main code paths require privileges or virt).

One main blocker to this is that rustc doesn't expose
first-class support for this yet:
https://github.com/rust-lang/rust/issues/39699

At a practical level this works when building in release
mode but fails with `cargo test` for some reason; linker
arguments being pruned?  Not sure.

So I was able to use this when composing to find a bug,
but then for some other reason the client
side apparently infinite loops inside libsolv.

So we're not enabling this yet for those reasons, but
let's land the build infrastructure now.

```
(lldb) thread backtrace
* thread #4, name = 'pool-/usr/bin/r'
  * frame #0: 0x00007fd61b97200f libc.so.6`__memcpy_sse2_unaligned_erms + 623
    frame #1: 0x00007fd61cbc88e6 libasan.so.6`__asan::asan_realloc(void*, unsigned long, __sanitizer::BufferedStackTrace*) + 214
    frame #2: 0x00007fd61cc4b725 libasan.so.6`__interceptor_realloc + 245
    frame #3: 0x00007fd61baec43e libsolv.so.1`solv_realloc + 30
    frame #4: 0x00007fd61baf0414 libsolv.so.1`repodata_add_dirstr + 276
    frame #5: 0x00007fd61bb6f755 libsolvext.so.1`end_element + 53
    frame #6: 0x00007fd61b05855d libxml2.so.2`xmlParseEndTag1.constprop.0 + 317
    frame #7: 0x00007fd61b063548 libxml2.so.2`xmlParseTryOrFinish.isra.0 + 888
    frame #8: 0x00007fd61af7ed20 libxml2.so.2`xmlParseChunk + 560
    frame #9: 0x00007fd61bb727e7 libsolvext.so.1`solv_xmlparser_parse + 183
    frame #10: 0x00007fd61bb5ea0e libsolvext.so.1`repo_add_rpmmd + 254
    frame #11: 0x000055a4fce7a5f5 rpm-ostree`::load_filelists_cb(repo=<unavailable>, fp=<unavailable>) at dnf-sack.cpp:444:23
    frame #12: 0x000055a4fce7cad6 rpm-ostree`load_ext(_DnfSack*, libdnf::Repo*, _hy_repo_repodata, char const*, char const*, int (*)(s_Repo*, _IO_FILE*), _GError**) at dnf-sack.cpp:430:13
    frame #13: 0x000055a4fce7df60 rpm-ostree`dnf_sack_load_repo at dnf-sack.cpp:1789:26
    frame #14: 0x000055a4fce7eee9 rpm-ostree`dnf_sack_add_repo at dnf-sack.cpp:2217:28
    frame #15: 0x000055a4fce7f0fb rpm-ostree`dnf_sack_add_repos at dnf-sack.cpp:2271:32
    frame #16: 0x000055a4fce870ee rpm-ostree`dnf_context_setup_sack_with_flags at dnf-context.cpp:1796:29
    frame #17: 0x000055a4fcdf757f rpm-ostree`rpmostree_context_download_metadata at rpmostree-core.cxx:1206:44
    frame #18: 0x000055a4fcdf95c3 rpm-ostree`rpmostree_context_prepare at rpmostree-core.cxx:2001:48
    frame #19: 0x000055a4fce54ab7 rpm-ostree`rpmostree_sysroot_upgrader_prep_layering at rpmostree-sysroot-upgrader.cxx:1018:38
    frame #20: 0x000055a4fcdcb143 rpm-ostree`deploy_transaction_execute(_RpmostreedTransaction*, _GCancellable*, _GError**) at rpmostreed-transaction-types.cxx:1445:49
    frame #21: 0x000055a4fcdba4cd rpm-ostree`transaction_execute_thread(_GTask*, void*, void*, _GCancellable*) at rpmostreed-transaction.cxx:340:34
    frame #22: 0x00007fd61c58f7e2 libgio-2.0.so.0`g_task_thread_pool_thread + 114
    frame #23: 0x00007fd61c3d7e54 libglib-2.0.so.0`g_thread_pool_thread_proxy.lto_priv.0 + 116
    frame #24: 0x00007fd61c3d52b2 libglib-2.0.so.0`g_thread_proxy + 82
    frame #25: 0x00007fd61b8af3f9 libpthread.so.0`start_thread + 233
    frame #26: 0x00007fd61b9c9903 libc.so.6`__clone + 67
(lldb)
```
2021-02-10 14:30:37 -05:00
Colin Walters
d218f27188 Change main entrypoint to be Rust
We now have bidirectional calling between Rust and C++,
but we are generating two static libraries that we then
link together with a tiny C++ `main.cxx`.
Let's make another huge leap towards oxdiation by
having Rust be the entrypoint.  This way cargo natively
takes care of linking the internal Rust library, and
our C++ internals become the library.

In other words, we've now fully inverted from
"C app with internal Rust library"
to "Rust binary with internal C++ library".

In order to make this work though we have to finally
kill the C unit tests.  But mostly everything covered
there is either being converted to Rust, or covered
elsewhere anyways.

Now as the doc comments in `main.rs` say...this is
a bit awkward because all the CLI code is still in C++.
Porting stuff to use e.g. `structopt` natively would
be a bit of a slog.  For now, we basically rely on
the fact that the Rust-native CLIs are all hidden
commands.

Update submodule: libdnf
2021-02-01 08:17:52 -05:00
Colin Walters
0f325b3490 Makefile.bindings: Also generate pure rust/cxx.h
This is necessary in order to use `rust::` in our header files
that are also used by bindings.
2021-01-27 19:36:34 -05:00
Jonathan Lebon
8c34dbe9d7 spec: Add BuildRequires: make
https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot

(Upstreamed from 6e99dd065d)

Really, libdnf's `cmake` BR does pull it into the buildroot anyway right
now. Though we do still need it as well.
2021-01-19 11:45:20 -05:00
Colin Walters
774923fce3 Release 2021.1 2021-01-18 19:19:09 -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
562acedbaa Move "ignored script list" to Rust, drop gperf
Rust has a nice crate for doing perfect hashing.  Move that
code into Rust and drop the dependency on `gperf`.  This also
helps move away from Autotools.
2020-12-24 16:37:04 +01:00
Jonathan Lebon
12c3b134c3 spec: Minor tweaks
Rename URLs with `projectatomic` to `coreos`, expand the `Source0`, and
move it down to be lower than `License` and `URL`.
2020-12-22 12:18:22 -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
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
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
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
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
96dea82c50 Release 2020.8
This mainly has two build-side fixes for coreos-assembler.
2020-11-13 23:03:23 +01:00
Luca BRUNO
b4e4005f56 sh: fix bash shebang
This updates a couple of shebangs for scripts using bash `pipefail`
option.
2020-11-11 16:50:43 +01:00
Jonathan Lebon
a1b35d0d75 Release 2020.7
To get https://github.com/coreos/rpm-ostree/pull/2301 out.
2020-11-02 16:47:10 +01:00
Colin Walters
607a04ae12 Release 2020.6
We have the 32 bit fix, the new initramfs command, and various
other cleanups.  I also want to see if this fixes https://bugzilla.redhat.com/show_bug.cgi?id=1865839
so let's get a release out.
2020-10-30 15:21:45 +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
Jonathan Lebon
ec940303c4 Release 2020.5
A few goodies, but mostly to get #2221 out.
2020-09-15 11:32:06 +02:00
Jeff Law
3097af804d spec: Disable LTO 2020-07-31 11:07:18 -04:00
Jonathan Lebon
bcf241d572 Release 2020.4
Thin release. Mostly for a bunch of RHCOS-relevant fixes and
enhancements: 752f4f09 (#2178), 4d836dd8 (#2151) and f608eb09 (#2158).
2020-07-29 10:41:43 -04:00
Tom Stellard
27c14d5809 spec: Use make macros
This pull request was create automatically for the f33 change:
https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro

(Upstreamed from
https://src.fedoraproject.org/rpms/rpm-ostree/pull-request/39).
2020-07-22 18:43:17 +02:00
Jonathan Lebon
f3ccd92cd7 Release 2020.3
Seems about time, but also to get the crypto-policies workaround out:
https://github.com/coreos/fedora-coreos-tracker/issues/540
2020-06-19 11:39:16 -04:00
Stephen Gallagher
541b43beaa spec: Fix up conditionals for ELN
The `rust-toolset` package does not exist in Fedora, so we cannot
use it for BuildRequires. Change the conditional to exclude ELN
from the %rhel conditional.

Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
2020-05-23 10:18:00 -04:00
Jonathan Lebon
f8667c65f7 spec: Bump version to 2020.2
This should've been part of the last release commit.
2020-05-23 10:18:00 -04:00
dependabot-preview[bot]
86f808d49c build(deps): bump envsubst from 0.1.1 to 0.2.0 in /rust
Bumps [envsubst](https://github.com/lucab/envsubst-rs) from 0.1.1 to 0.2.0.
- [Release notes](https://github.com/lucab/envsubst-rs/releases)
- [Commits](https://github.com/lucab/envsubst-rs/compare/0.1.1...v0.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-06 20:21:54 +02:00
Jonathan Lebon
7501b39cbf spec: Bump libmodulemd version requirement
This matches the latest bump in libdnf:
763ccc3e33
2020-02-25 16:48:15 +01:00
Jonathan Lebon
35818cefd5 Release 2020.1 2020-02-05 23:18:45 +01:00
Jonathan Lebon
82b27de843 Release 2019.7
Not the biggest release, but there are some decent targeted fixes and
enhancements and it's been a while.
2019-12-19 16:22:11 +01:00
Colin Walters
8e5baf5ca7 Detect whether zchunk (zck) is available at build time
We don't *actually* use this ourself, but librepo does, and libdnf gets confused
if librepo doesn't support it.  This is the case in RHEL8 currently.

Basically what breaks is trying to use the Fedora EPEL repo (has zchunk metadata)
on RHEL CoreOS.  And we have a test in kola that does this today.
2019-10-18 17:13:55 +02:00
Jonathan Lebon
ccace4c56c Release 2019.6
Last release was almost two months ago. Not a lot of groundbreaking
features, though let's get the various fixes out.

Closes: #1907
Approved by: lucab
2019-09-24 16:23:27 +00:00
worldofpeace
a8ee788e61 Move D-Bus conf file to $(datadir)/dbus-1/system.d
Since D-Bus 1.9.18 configuration files installed by third-party should
go in share/dbus-1/system.d. The old location is for sysadmin overrides.

Closes: #1903
Approved by: jlebon
2019-09-17 04:37:59 +00:00
Jonathan Lebon
680cc10077 spec: Fix documentation files
Follow-up to the recent licensing changes.

This is the first spec file change since moving it upstream.

Closes: #1900
Approved by: cgwalters
2019-09-09 23:50:32 +00:00
Jonathan Lebon
801de7fdae packaging: Adapt to cargo vendor now being built-in
From Rust v1.37, `cargo vendor` is now baked. Stop building it, and
tweak the vendoring script to adapt to the new UX.

Closes: #1900
Approved by: cgwalters
2019-09-09 23:50:32 +00:00
Jonathan Lebon
e11d426f99 packaging: Move canonical spec file here
So this is a somewhat significant change, but I'd like to try having the
canonical spec file upstream. A few reasons for this:

1. We integrate tightly with the distros we're destined for, and so
   we're in a pretty good position for knowing how the software should
   be packaged.
2. We can atomically change packaging along with the rest of the code.
   This has important ramifications, including that it'll be easier to
   integrate with continuous build services like Packit, but releases
   will also be less fraught with last-minute packaging fixes.
3. I'm playing with Jenkins pipelines and there I'd like to make RPMs
   the "artifact" that gets moved down the pipeline into later stages
   (e.g. `cosa build`). We could even eventually make it an actual
   external artifact so that anyone can easily download RPMs from any
   random PR for testing. (And in fact, with a thin yumrepo layer on
   top, it could be used to replace Packit/rdgo entirely).

Not that this approach doesn't have issues as well (e.g. on the dist-git
side, we'll need some minimal tooling to merge in the changelog), though
I think it's worth trying out.

Closes: #1900
Approved by: cgwalters
2019-09-09 23:50:32 +00:00
Jonathan Lebon
146fe31620 packaging: Fix repomanage usage
Not actually planning to use this for now. Noticed it in passing.

Closes: #1900
Approved by: cgwalters
2019-09-09 23:50:32 +00:00
Jonathan Lebon
4824410cc2 packaging: Drop support for dist-snapshot w/o compose
The build system doesn't support this anymore. Also add `-T0` for
multi-threading.

Closes: #1900
Approved by: cgwalters
2019-09-09 23:50:32 +00:00
Jonathan Lebon
206ae24d4e tests: Bump to Python 3 only
This bumps the requirement on the controlling host to Python 3 only.
It also bumps the requirement on the target host to Python 3 as well
since FCOS doesn't ship Python 2 right now.

Though we'll need to eventually drop all Python usage anyway, but at
least let's get tests passing on FCOS first. (See related previous
patch).

Closes: #1828
Approved by: cgwalters
2019-05-08 19:02:32 +00:00
Jonathan Lebon
34bdffcbd2 packaging: Don't include checksums for libtool.m4 and configure
These are more files that get mangled at `%configure` time. These two
new ones specifically, I tripped on while building on ppc64le for RHEL7.
See https://bugzilla.redhat.com/show_bug.cgi?id=1113618 for more info.

Closes: #1731
Approved by: cgwalters
2019-01-15 19:20:36 +00:00
Jonathan Lebon
5202ce06c2 packaging: Don't include checksums for ltmain.sh
And `config.guess` and `config.sub`. These files get mangled by the
`%configure` macro when it tries to insert hardening compile flags and
so the checksums no longer match. This is an ugly hack akin to #1554
that requires an incision in the cargo vendor JSON.

Fedora does package a lot of these crate sources now which we
could use to drop these hacks, but not all the crates are packaged (I
counted 4 unpackaged top-level crates), and I'm not sure what their
states are in RHEL7/8 either.

Closes: #1715
Approved by: cgwalters
2018-12-15 14:21:19 +00:00
Jonathan Lebon
5fb5effbd2 packaging: Nuke more vendored sources
Nuke systemd source files for the same reasons as libcurl (see #1554).
Also noticed that libz-sys was doing this, though it's not new to this
patch.

For reference, see: https://github.com/projectatomic/rpm-ostree/pull/1554

Closes: #1601
Approved by: cgwalters
2018-10-16 17:41:09 +00:00
Colin Walters
f50f9e8d7e Split cbindgen to separate build, support external version
The problem is building bindgen as part of our single run
locks serde to way old versions, and I want to use newer versions.

Since Fedora will now again ship a `cbindgen` package, let's
also support using it if we find it, saving ourselves
the cost of building it.

For distros that don't ship it (e.g. CentOS) for CI purposes
we build it.  For downstream builds that are offline, rather
than vendor the cbindgen sources like we do with our main Rust,
let's just vendor the `rpmostree-rust.h` file as was suggested
in https://bugzilla.redhat.com/show_bug.cgi?id=1608670

Closes: https://github.com/projectatomic/rpm-ostree/issues/1557

Closes: #1573
Approved by: jlebon
2018-09-25 20:29:21 +00:00