Merge pull request #2656 from cgwalters/bump-cap-std

rust: Bump semver to 0.15 && bump cap-std 0.25
This commit is contained in:
Colin Walters 2022-06-23 16:36:24 -04:00 committed by GitHub
commit ee5b3c76c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 10 deletions

View File

@ -11,7 +11,7 @@ on:
env:
CARGO_TERM_COLOR: always
CARGO_PROJECT_FEATURES: "v2021_5"
CARGO_PROJECT_FEATURES: "v2021_5,cap-std-apis"
# TODO: Automatically query this from the C side
LATEST_LIBOSTREE: "v2022_5"
# Minimum supported Rust version (MSRV)
@ -47,8 +47,19 @@ jobs:
default: true
- name: Cache Dependencies
uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
- name: cargo build
run: cargo build --features=${{ env['CARGO_PROJECT_FEATURES'] }}
- name: cargo check
run: cargo check --features=${{ env['CARGO_PROJECT_FEATURES'] }}
build-no-features:
runs-on: ubuntu-latest
container: quay.io/coreos-assembler/fcos-buildroot:testing-devel
steps:
- uses: actions/checkout@v2
- name: Cache Dependencies
uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
- name: Build
run: cargo test --no-run
- name: Run tests
run: cargo test --verbose
build-git-libostree:
runs-on: ubuntu-latest
container: quay.io/coreos-assembler/fcos-buildroot:testing-devel

View File

@ -8,7 +8,7 @@ license = "MIT"
name = "ostree"
readme = "rust-bindings/README.md"
repository = "https://github.com/ostreedev/ostree"
version = "0.14.0"
version = "0.15.0"
exclude = [
"/*.am", "/apidoc", "/autogen.sh", "/bash", "/bsdiff",
@ -38,8 +38,8 @@ members = [".", "rust-bindings/sys"]
[dependencies]
bitflags = "1.2.1"
cap-std = { version = "0.24", optional = true}
io-lifetimes = { version = "0.5", optional = true}
cap-std = { version = "0.25", optional = true}
io-lifetimes = { version = "0.7", optional = true}
ffi = { package = "ostree-sys", path = "rust-bindings/sys", version = "0.10.0" }
gio = "0.14"
glib = "0.14.4"
@ -53,7 +53,7 @@ thiserror = "1.0.20"
maplit = "1.0.2"
openat = "0.1.19"
tempfile = "3"
cap-tempfile = "0.24"
cap-tempfile = "0.25"
[features]
cap-std-apis = ["cap-std", "io-lifetimes", "v2017_10"]

View File

@ -153,14 +153,16 @@ impl Repo {
/// Borrow the directory file descriptor for this repository.
#[cfg(feature = "cap-std-apis")]
pub fn dfd_borrow<'a>(&'a self) -> io_lifetimes::BorrowedFd<'a> {
unsafe { io_lifetimes::BorrowedFd::borrow_raw_fd(self.dfd()) }
pub fn dfd_borrow(&self) -> io_lifetimes::BorrowedFd {
unsafe { io_lifetimes::BorrowedFd::borrow_raw(self.dfd()) }
}
/// Return a new `cap-std` directory reference for this repository.
#[cfg(feature = "cap-std-apis")]
pub fn dfd_as_dir(&self) -> std::io::Result<cap_std::fs::Dir> {
cap_std::fs::Dir::reopen_dir(&self.dfd_borrow())
use io_lifetimes::AsFd;
let dfd = self.dfd_borrow();
cap_std::fs::Dir::reopen_dir(&dfd.as_fd())
}
/// Find all objects reachable from a commit.