Commit Graph

6033 Commits

Author SHA1 Message Date
Colin Walters 1c201d6be4 ci: Move codestyle and min build to GH actions
Part of general momentum to leave heavy lifting (e.g. VM tests)
to Jenkins and Prow and use the cheaper/faster GH actions for
plain builds.
2022-05-17 08:11:09 -04:00
Colin Walters 2106f12637
Merge pull request #2608 from cgwalters/fanalyzer-fixes
ci: Drop gcc `-fanalyzer` by default
2022-05-16 15:55:35 -04:00
Colin Walters 87cf46bbd9 ci: Drop all `runAsUser: 0` in builds
This triggers the new git warning; I think this is only
here because long ago we used coreos-assembler as a buildroot,
but that's long since fixed.
2022-05-16 12:37:15 -04:00
Colin Walters 41b9f8ff97 ci: Drop gcc `-fanalyzer` by default
There's a pile of new warnings in GCC 12 from F36, I dug into
them but most of them seem inscrutable - I am not seeing the bugs.

For now to unblock further work, stop using this flag.
2022-05-16 11:00:08 -04:00
Colin Walters 6a055f802f sysroot: Strengthen several `g_return_if_fail` into `g_assert()`
Similar to prior changes; motivated by testing out an updated
`gcc -fanalyzer`.
2022-05-16 11:00:08 -04:00
Colin Walters e27fed45fd sysroot: Quiet one gcc `-fanalyzer` warning
I don't think this can happen in practice, but add an assertion
to verify it.
2022-05-15 16:03:01 -04:00
Luca Bruno 39a953dfa5
Merge pull request #2606 from ostreedev/dependabot/submodules/libglnx-c59eb27
build(deps): bump libglnx from `c71f7ae` to `c59eb27`
2022-05-12 13:18:45 +00:00
dependabot[bot] 245666c99f
build(deps): bump libglnx from `c71f7ae` to `c59eb27`
Bumps libglnx from `c71f7ae` to `c59eb27`.

---
updated-dependencies:
- dependency-name: libglnx
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-12 12:32:06 +00:00
Joseph Marrero Corchado c141cdea09
Merge pull request #2603 from cgwalters/use-cargo-deny
ci: use cargo-deny
2022-05-10 17:43:19 -04:00
Colin Walters 9f8d026f82 ci: use cargo-deny
Copied from https://github.com/ostreedev/ostree-rs-ext/pull/291

Part of unifying our CI.
2022-05-10 17:14:01 -04:00
Colin Walters 891c7dffa7
Merge pull request #2575 from cgwalters/merge-ostree-rs
Merge ostree-rs into this repository
2022-05-09 16:41:08 -04:00
Colin Walters 73d3c16a9d
Merge pull request #2601 from cgwalters/expose-get-xattrs
Add APIs to get xattrs from disk
2022-05-09 15:00:53 -04:00
Colin Walters 4a9a2f0b44
Merge pull request #2602 from cgwalters/fix-docs-ci
ci: Work around GH actions `container:` + git + security bug
2022-05-09 15:00:00 -04:00
Colin Walters 60404565e5 rust-bindings: Remove some unused CI/test bits
We're not using Vagrant or Gitlab, and our container flow is
different.
2022-05-09 14:53:40 -04:00
Colin Walters e9141e97c1 ci: Move rust-bindings CI to toplevel
It should replace our stub one.
2022-05-09 14:52:46 -04:00
Colin Walters ee2c31badd tests/inst: Add .gitignore
Need this now that it is it's own workspace.
2022-05-09 14:52:26 -04:00
Colin Walters 9db45cad5a ci: Work around GH actions `container:` + git + security bug
See https://github.com/actions/checkout/issues/760
2022-05-09 14:46:41 -04:00
Colin Walters 558d966420 tests/inst: Fix install rules for ostree-rs merger
`tests/inst` became its own workspace.
2022-05-09 12:57:40 -04:00
Colin Walters f79b2cea91 Add APIs to get xattrs from disk
I'm aiming to do some more work on the Rust side around `fsck`
like functionality, and this is a useful primitive.  There isn't
a great Rust crate for xattrs, and I think it's better to share this
code.
2022-05-09 12:33:38 -04:00
Colin Walters d72f1684a0 cfg.mk: Don't even look at rust-bindings/
It's really tempting to remove `make syntax-check`, it has very
very rarely found any real problems.

But anyways, just exclude all the binding code because it trips
up random problems we simply don't care about like mentions of
`O_NDELAY` in the `GLib-2.0.gir`.
2022-05-06 16:46:46 -04:00
Joseph Marrero Corchado 22b8324019
Merge pull request #2600 from cgwalters/link-suse-ima
docs/ima: Also link the SUSE docs
2022-05-06 16:35:28 -04:00
Colin Walters ffb3b2bc7a docs/ima: Also link the SUSE docs
They have a lot of stuff there.
2022-05-06 14:43:58 -04:00
Colin Walters 252060906b build-sys: Adjust for merge of ostree-rs
Fix up the paths for the crates now that the Rust bindings are in
`rust/`.

We can't today include the test suite because it depends on `ostree-rs-ext`
which would make everything circular.

(Building that now requires a separate `cd tests/inst && cargo build`)
2022-05-06 12:53:57 -04:00
Colin Walters a5ef4cd5cc Add a `repo()` accessor to `TransactionGuard`
I want to write APIs that *require* the caller to have set up
an ostree transaction.  It's natural to require passing a guard
to do so.  But then we want an accessor for the repo.
2022-05-06 12:53:57 -04:00
Colin Walters 1541c5eb2e lib: Run `cargo fmt`
Prep for merge into ostree, where we want to run `cargo fmt` checks
in CI.
2022-05-06 12:53:57 -04:00
Luca BRUNO d1fad37d1a ostree: release 0.13.7 2022-05-06 12:53:57 -04:00
Luca BRUNO 04c8e3e9f3 ostree: manually patch generated files
This manually adds a missing `ToGlibPtr` import, which seems to be result
of some bugs in `gir` code-generation.
2022-05-06 12:53:57 -04:00
Luca BRUNO dd0cfc6d4b ostree: refresh after gir bump 2022-05-06 12:53:57 -04:00
Luca BRUNO 3fc55a524b ostree/cargo: bump to ostree-sys 0.9.2 2022-05-06 12:53:57 -04:00
Luca BRUNO 61b4629b37 ostree-sys: release 0.9.2 2022-05-06 12:53:57 -04:00
Luca BRUNO cf5462178c ostree-sys: refresh after gir bump 2022-05-06 12:53:57 -04:00
Luca BRUNO 1cb07e0ca5 gir-files: bump to v2022.2 2022-05-06 12:53:57 -04:00
Colin Walters 887f5b09be repo: Add `query_file` API
The underlying `ostree_repo_load_file()` API has the caller pass
`NULL` for output arguments it doesn't want.  This isn't sanely
bindable in Rust - what the generator does is always request
all values, but maps them all to `Option<T>`.

The main cases are where a user wants either metadata, or both
metadata and content.  This API gives just metadata; it's a
bit more efficient as we don't need to open the file, and doesn't
require the caller to `unwrap()`.
2022-05-06 12:53:57 -04:00
Colin Walters 1199ae9bbc Add manual bindings for MutableTree reading
I'm trying to debug a problem in ostree-rs-ext, and it's
handy to be able to do `dbg!(mtree.copy_files())`.
2022-05-06 12:53:57 -04:00
Colin Walters 46b4a12b23 Release 0.13.6 2022-05-06 12:53:57 -04:00
Colin Walters ecbe3ba0f8 Fast-track fix for `ostree_gpg_verify_result_get_all()`
This cherry picks just the changes from
https://github.com/ostreedev/ostree/pull/2537

We don't need to wait to respin a new ostree release just
for this.
2022-05-06 12:53:57 -04:00
Colin Walters dde1a7b43f Release 0.13.5 2022-05-06 12:53:57 -04:00
Colin Walters 9250effa8f Add `COMMIT_META_CONTAINER_CMD` constant
Today we hardcode `/bin/bash` in
2088d24884/src/cmd-build (L405)

But that breaks the concept of a bidirectional bridge between
container image and ostree commit because this little bit of
knowledge is encoded at the buildsystem side.

This metadata key is intended to be written into an ostree commit,
and then we will use it automatically in `container encapsulate`.

The "source of truth" for this key will hence be able live in the same
place that's generating the ostree commit.

The more "proper" place for this is probably alongside the other
constants in the libostree core C code.  But that's tedious and
slow to release.  And Rust is the future.  And we've been slowly
adding more "core ostree" functionality here.
2022-05-06 12:53:57 -04:00
Colin Walters 19224a411a repo: Add two more cap-std APIs
Followup to the previous PR.  I realized now with `io_lifetimes`
we can offer a safe `dfd_borrow()` that *borrows* the file descriptor
for the repository.  (In contrast to the current `.dfd()` that returns
the raw version)

Building on that, add another API that re-acquires a `Dir` instance.
(In the future in theory we could optimize this more by knowing
 whether or not the repo was constructed via cap-std, and perhaps
 in theory synthesize a `&Dir` reference, but I don't think we
 need that now)
2022-05-06 12:53:57 -04:00
Colin Walters 6940896c4e Add a `cap-std-apis` feature with open/create
I'm trying to make more use of `cap-std` in our stack, and
this will be a key enabling API.

Actually a notable side benefit of this is that we don't need
to teach the ostree C code itself to use `openat2`, we inherit
cap-std's setup.

All of the internal ostree code using the prior `openat()` should
continue to work.

I only did basic sanity checking of this; there may be bugs
in other APIs.
2022-05-06 12:53:57 -04:00
Colin Walters 4f7eea6aa7 Release 0.13.4 2022-05-06 12:53:57 -04:00
Colin Walters d1731d0ea8 repo: Add an API to read and parse directory metadata
The fact that the uid/gid/mode are big endian bit me when I was
trying to parse this "by hand" in ostree-rs-ext.

Let's add a footgun-free API for this.

(And yeah, we should probably do the same for the other variant types)
2022-05-06 12:53:57 -04:00
Luca BRUNO f01c847a68 ci: add jobs for MSRV checks and linting
This adds two jobs in order to check minimum toolchain compatibility,
and for overall linting.
2022-05-06 12:53:57 -04:00
Luca BRUNO 83b03d2996 lib: run rustfmt 2022-05-06 12:53:57 -04:00
Luca BRUNO 810e86d4fb lib: fix new clippy warnings
This fixes the following warnings highlighted by clippy:
 * https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
 * https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
 * https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports
2022-05-06 12:53:57 -04:00
Luca BRUNO 86295e3bfe sys/cargo: refresh manifest
This updates stale dependencies and remove leftover settings.
2022-05-06 12:53:57 -04:00
Manuel Stühn 1bd6e2fc06 Update impl Display, omit to_string, change wording 2022-05-06 12:53:57 -04:00
Manuel Stühn 2ab55beb98 add ObjectDetails-struct and use it in list_objects-function 2022-05-06 12:53:57 -04:00
Manuel Stühn 81ea92566f update result type 2022-05-06 12:53:57 -04:00
Manuel Stühn f6c1e0cb82 switch from if-else to match 2022-05-06 12:53:57 -04:00