Skip to content

Commit

Permalink
Merge pull request #2656 from cgwalters/bump-cap-std
Browse files Browse the repository at this point in the history
rust: Bump semver to 0.15 && bump cap-std 0.25
  • Loading branch information
cgwalters authored Jun 23, 2022
2 parents 6fda711 + 6349974 commit ee5b3c7
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
Expand All @@ -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"]
Expand Down
8 changes: 5 additions & 3 deletions rust-bindings/src/repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit ee5b3c7

Please sign in to comment.