Commit Graph

3758 Commits

Author SHA1 Message Date
Jonathan Lebon
5d199a60f7 .gitignore: add compose-{cache,logs} dirs
And roughly split the file into build system things and "owned" test
things.
2021-04-16 16:00:58 -04:00
Jonathan Lebon
464c368c88
Merge pull request #2753 from cgwalters/fix-cxx-rebuilds
build-sys: Avoid re-building + re-linking cxx-rs C++ bits each build
2021-04-16 14:08:09 -04:00
Luca Bruno
23d15a4a78
Merge pull request #2752 from cgwalters/origin-treefile-prep-1
core: Two minor API cleanups
2021-04-16 16:04:35 +00:00
Colin Walters
2ed1e73c06 build-sys: Avoid re-building + re-linking cxx-rs C++ bits each build
We need to do the same `cmp` dance for the generated `.cxx` file
as for the source, because `make` only works on timestamps.

Currently every time one edits the rust code and types `make`
we end up re-building that object, which also forces a re-link
of the `librpmostreeinternals.la` library.
2021-04-16 10:54:04 -04:00
Colin Walters
22a32a5757 core: Rename context_new_tree() to context_new_compose()
Makes the intention clearer.
2021-04-16 10:46:58 -04:00
Colin Walters
2b554dde64 core: Rename context_new_system() to context_new_client()
Makes the intention clearer.
2021-04-16 10:42:36 -04:00
Jonathan Lebon
b2b3795df1
Merge pull request #2750 from cgwalters/drop-git-mk
build-sys: Drop git.mk, hardcode .gitignore
2021-04-15 17:05:10 -04:00
Colin Walters
cd82724913 build-sys: Drop git.mk, hardcode .gitignore
As rpm-ostree is transitioning to a primarily-Rust project,
our dependency on running `make` to generate `.gitignore` is a
problem.

For example, just opening the project in an IDE that runs rust-analyzer,
the latter will start a build and generate files in the `target/` directory,
but because r-a doesn't know to run `make` we won't have `.gitignore` yet.

I think further what we should do is try changing the C/Automake side
to write generated files into `target/` too.
2021-04-15 11:29:25 -04:00
Jonathan Lebon
d2143986c7
Merge pull request #2742 from cgwalters/treefile-client 2021-04-15 10:45:02 -04:00
Colin Walters
834328f963 Move ref parsing into core
We went through a lot of gyrations on this one.  It's only
relevant to server side composes, so having the core parse
the treefile for it directly just makes sense.
2021-04-14 18:24:42 -04:00
Colin Walters
53b4fc8c26 Read treefile directly for releasever
More draining of treespec to treefile.
2021-04-14 18:24:42 -04:00
Colin Walters
29b63cf270 compose: Remove unused helper functions
No longer needed.
2021-04-14 18:24:42 -04:00
Colin Walters
c792587645 Read treefile directly for selinux and recommends flags
Part of removing treespec in favor of treefile.
2021-04-14 18:24:42 -04:00
Colin Walters
69a79bc8e6 Read treefile directly for documentation flag
Part of removing treespec in favor of treefile.
2021-04-14 18:24:42 -04:00
Colin Walters
6321916436 compose: Pass treefile directly in rpmostree_context_new_tree()
Since the treefile is a requirement for server side composes,
pass the treefile directly there in the setup function.

Prep for dropping "treespec".
2021-04-14 18:24:42 -04:00
Luca BRUNO
8e231b5aad composepost: uniform results and visibility for cxxbridge
This aligns the result types and visibility for all post-processing
functions that are bridged to C++.
2021-04-13 11:15:52 -04:00
Luca Bruno
a700b2e74b
Merge pull request #2736 from bgilbert/edit
docs: fix "Edit this page on GitHub" links
2021-04-13 12:14:27 +00:00
Stefan Berger
29440346f1 Support hardcoded user.ima to security.ima translation
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-04-12 21:16:46 -04:00
Jonathan Lebon
4179cbadd2 Release 2021.4 2021-04-12 15:36:20 -04:00
Luca Bruno
358865675a
Merge pull request #2737 from cgwalters/treefile-client-prep
Treefile client prep
2021-04-12 16:04:07 +00:00
dependabot[bot]
9a7ffb2b0c build(deps): bump libdnf from 31a8b8b to 930f258
Bumps [libdnf](https://github.com/rpm-software-management/libdnf) from `31a8b8b` to `930f258`.
- [Release notes](https://github.com/rpm-software-management/libdnf/releases)
- [Commits](31a8b8bcec...930f2582f9)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-12 11:52:49 -04:00
dependabot[bot]
aa662e8faa build(deps): bump openat-ext from 0.1.13 to 0.2.0
Bumps [openat-ext](https://github.com/coreos/openat-ext) from 0.1.13 to 0.2.0.
- [Release notes](https://github.com/coreos/openat-ext/releases)
- [Commits](https://github.com/coreos/openat-ext/compare/v0.1.13...v0.2.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-12 10:58:23 -04:00
dependabot[bot]
89d4e2dcf1 build(deps): bump cxx from 1.0.41 to 1.0.43
Bumps [cxx](https://github.com/dtolnay/cxx) from 1.0.41 to 1.0.43.
- [Release notes](https://github.com/dtolnay/cxx/releases)
- [Commits](https://github.com/dtolnay/cxx/compare/1.0.41...1.0.43)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-12 10:58:08 -04:00
dependabot[bot]
33e317ca23 build(deps): bump libc from 0.2.92 to 0.2.93
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.92 to 0.2.93.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.92...0.2.93)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-12 08:50:56 -04:00
Colin Walters
fb7514240f treefile: derive(Default)
So that it's easy to construct without deserializing.  Prep
for converting from origins.
2021-04-10 11:14:24 -04:00
Colin Walters
fab62ac9fc treefile: Make all members pub(crate)
We've been doing this piecemeal so far, let's do it all at once
now.  Prep for converting origin files to treefiles in `origin.rs`.
2021-04-10 11:12:48 -04:00
Colin Walters
92c79dc647 core: Fix the "is_system" variable
The intention here was to distinguish between server composes
and client side layering.  But that doesn't work today because
we we call`_new_system()`; probably a result of refactoring.
Doesn't matter too much because we only checked it to
throw an error if we failed to load the policy.

And now add a check for `is_system` instead of checking whether
a treefile is present.

This is prep for converting the origin to a treefile and
using that as our standard format.
2021-04-10 14:21:52 +00:00
Benjamin Gilbert
2388be6dcb docs: fix "Edit this page on GitHub" links 2021-04-09 22:55:16 -04:00
Luca Bruno
ff617e56eb
Merge pull request #2734 from stefanberger/stefanberger/fix_memory_leak
libpriv: Remove unnecessary builder causing memory leak
2021-04-09 13:09:16 +00:00
Luca Bruno
de7574f764
Merge pull request #2732 from cgwalters/postprocess-rs-more
Oxidize more of postprocess.cxx
2021-04-09 12:47:35 +00:00
Stefan Berger
c1a869666a libpriv: Remove unnecessary builder causing memory leak
Remove the unnecessary builder causing memory leaks like this one:

Direct leak of 8 byte(s) in 1 object(s) allocated from:
    #0 0x7f60bd2fe3cf in __interceptor_malloc (/lib64/libasan.so.6+0xab3cf)
    #1 0x7f60bca6cbb8 in g_malloc (/lib64/libglib-2.0.so.0+0x5bbb8)
    #2 0x7f60bcaa54f2 in g_variant_type_copy (/lib64/libglib-2.0.so.0+0x944f2)
    #3 0x7f60bcaa3384 in g_variant_builder_init (/lib64/libglib-2.0.so.0+0x92384)
    #4 0x55e5bb3120d3 in filter_xattrs_cb src/libpriv/rpmostree-postprocess.cxx:1493
    #5 0x7f60bc89cb38  (/lib64/libostree-1.so.1+0x49b38)
    #6 0x7f60bc8a5e1a  (/lib64/libostree-1.so.1+0x52e1a)
    #7 0x7f60bc8a622b in ostree_repo_write_dfd_to_mtree (/lib64/libostree-1.so.1+0x5322b)
    #8 0x55e5bb307e6e in write_dfd_thread src/libpriv/rpmostree-postprocess.cxx:1551
    #9 0x7f60bca92401  (/lib64/libglib-2.0.so.0+0x81401)
    #10 0x7f60bc12d3f8 in start_thread (/lib64/libpthread.so.0+0x93f8)
    #11 0x7f60bc05ab52 in __GI___clone (/lib64/libc.so.6+0x101b52)

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-04-09 08:02:38 -04:00
Jonathan Lebon
9af4e8256f
Merge pull request #2733 from cgwalters/client-check-container
client: Provide more useful error if we're in a container
2021-04-08 15:59:29 -04:00
Colin Walters
2407b9850f client: Provide more useful error if we're in a container
Let's make this more obvious - in particular today I ran
a command in the wrong terminal and the error made me pause
for a second.
2021-04-08 18:33:38 +00:00
Colin Walters
66c764fb38 Oxidize more of postprocess.cxx
Figuring out that we can't `fchmod()` on an `O_PATH` descriptor
took me a while =(

As part of that I discovered the `nix` crate grew a `Dir`
abstraction too.  But I think we still probably want to be using
https://docs.rs/cap-std/0.13.7/cap_std/fs/index.html
2021-04-08 16:33:47 +00:00
Luca Bruno
5725eb023a
Merge pull request #2730 from cgwalters/client-methods
rust/client: Make status be a method
2021-04-08 13:31:30 +00:00
Luca Bruno
05c1e160d3
Merge pull request #2731 from cgwalters/remove-test-introspection
tests: Stop running test-lib-introspection.sh
2021-04-08 09:28:16 +00:00
Colin Walters
1541ed4312 tests: Stop running test-lib-introspection.sh
Even more fallout of the buildroot change to stop deriving from
cosa.  The new buildroot doesn't have `pygobject3`.

We could convert this to an installed test but...blah.
Not worth it.
2021-04-07 22:11:56 +00:00
Colin Walters
182cae05d6 rust/client: Make status be a method
In trying to use the API in ostree's tests, this feels like an obvious
change.
2021-04-07 18:56:59 +00:00
Jonathan Lebon
45a59fc7f8
Merge pull request #2698 from cgwalters/prow-ci-buildroot
ci/prow: Update to use new buildroot image
2021-04-07 13:14:00 -04:00
Jonathan Lebon
cb99db232f
Merge pull request #2725 from coreos/dependabot/cargo/cxx-build-1.0.42
build(deps): bump cxx-build from 1.0.41 to 1.0.42
2021-04-07 13:00:38 -04:00
Colin Walters
4daed91a7a ci/prow: Update to use new buildroot image
Matching CCI.
2021-04-07 16:08:31 +00:00
Luca Bruno
bc1e596014
Merge pull request #2727 from cgwalters/composepost-cleanup
postprocess: Move more code into Rust
2021-04-07 14:38:51 +00:00
Luca Bruno
78f3e794f7
Merge pull request #2718 from coreos/dependabot/cargo/ostree-sys-0.7.2
build(deps): bump ostree-sys from 0.7.1 to 0.7.2
2021-04-07 13:22:19 +00:00
Colin Walters
46728cfd99 postprocess: Move more code into Rust
Previously we carefully ported functionality bit by bit here.
Now take the last step and move it all in to Rust.

A reason I didn't do this in one go before is around the
incredibly twisted handling of the `/etc` vs `/usr/etc`.

I think longer term we should aim to basically have all
of our code keep it as `/etc` up until the very end.  For
now we just do a rename dance around some of the add/remove
files code.
2021-04-07 11:32:40 +00:00
Colin Walters
86f9612395 composeutil: Clarify which dev failed to create 2021-04-07 11:32:08 +00:00
Jonathan Lebon
4624c3bdf8 app/db: Add db diff --advisories
This will be used by at least coreos-assembler to store in `meta.json`
so it's easy to tell new advisories that appeared in a given build.
2021-04-06 17:04:51 -04:00
Jonathan Lebon
136a3ea7e9 app/db: Add db list --advisories
This makes it easy to see the advisories stored in commit metadata.
2021-04-06 17:04:51 -04:00
Jonathan Lebon
427fe683a8 compose: Bake advisory information into commit metadata
There are a lot of use cases for this, notably:
- This allows us to display advisories without fetching updateinfo
  metadata in the pure OSTree case.
- It allows pipelines to fetch and display this information to
  sanity-check builds.
- It makes it much easier to fix the "intermediate CVEs" issue described
  in https://github.com/coreos/rpm-ostree/issues/1696#issuecomment-443861107.

This patch just adds the advisory information to the commit metadata.
There's follow-up work to make the client-side of rpm-ostree use this
data.

Also, remove the newly added metadata from the output of `rpm-ostree
status --json` for the same reason we remove the rpmdb. A follow-up
patch will teach `rpm-ostree db list/diff` to output advisories.

Closes: #1696
2021-04-06 17:04:51 -04:00
dependabot[bot]
23e53bc492
build(deps): bump ostree-sys from 0.7.1 to 0.7.2
Bumps [ostree-sys](https://gitlab.com/fkrull/ostree-rs) from 0.7.1 to 0.7.2.
- [Release notes](https://gitlab.com/fkrull/ostree-rs/tags)
- [Commits](https://gitlab.com/fkrull/ostree-rs/compare/ostree-sys/0.7.1...ostree-sys/0.7.2)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-06 16:57:21 +00:00
Luca BRUNO
17d80dc566 passwd: aling all bridge functions to return CxxResult
This updates all bridged functions in order to return CxxResult in
a uniform way.
2021-04-05 13:44:44 -04:00