mirror of
https://github.com/ostreedev/ostree.git
synced 2025-08-30 05:49:24 +03:00
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:
17
.github/workflows/rust.yml
vendored
17
.github/workflows/rust.yml
vendored
@ -11,7 +11,7 @@ on:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
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
|
# TODO: Automatically query this from the C side
|
||||||
LATEST_LIBOSTREE: "v2022_5"
|
LATEST_LIBOSTREE: "v2022_5"
|
||||||
# Minimum supported Rust version (MSRV)
|
# Minimum supported Rust version (MSRV)
|
||||||
@ -47,8 +47,19 @@ jobs:
|
|||||||
default: true
|
default: true
|
||||||
- name: Cache Dependencies
|
- name: Cache Dependencies
|
||||||
uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
|
uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
|
||||||
- name: cargo build
|
- name: cargo check
|
||||||
run: cargo build --features=${{ env['CARGO_PROJECT_FEATURES'] }}
|
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:
|
build-git-libostree:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: quay.io/coreos-assembler/fcos-buildroot:testing-devel
|
container: quay.io/coreos-assembler/fcos-buildroot:testing-devel
|
||||||
|
@ -8,7 +8,7 @@ license = "MIT"
|
|||||||
name = "ostree"
|
name = "ostree"
|
||||||
readme = "rust-bindings/README.md"
|
readme = "rust-bindings/README.md"
|
||||||
repository = "https://github.com/ostreedev/ostree"
|
repository = "https://github.com/ostreedev/ostree"
|
||||||
version = "0.14.0"
|
version = "0.15.0"
|
||||||
|
|
||||||
exclude = [
|
exclude = [
|
||||||
"/*.am", "/apidoc", "/autogen.sh", "/bash", "/bsdiff",
|
"/*.am", "/apidoc", "/autogen.sh", "/bash", "/bsdiff",
|
||||||
@ -38,8 +38,8 @@ members = [".", "rust-bindings/sys"]
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bitflags = "1.2.1"
|
bitflags = "1.2.1"
|
||||||
cap-std = { version = "0.24", optional = true}
|
cap-std = { version = "0.25", optional = true}
|
||||||
io-lifetimes = { version = "0.5", optional = true}
|
io-lifetimes = { version = "0.7", optional = true}
|
||||||
ffi = { package = "ostree-sys", path = "rust-bindings/sys", version = "0.10.0" }
|
ffi = { package = "ostree-sys", path = "rust-bindings/sys", version = "0.10.0" }
|
||||||
gio = "0.14"
|
gio = "0.14"
|
||||||
glib = "0.14.4"
|
glib = "0.14.4"
|
||||||
@ -53,7 +53,7 @@ thiserror = "1.0.20"
|
|||||||
maplit = "1.0.2"
|
maplit = "1.0.2"
|
||||||
openat = "0.1.19"
|
openat = "0.1.19"
|
||||||
tempfile = "3"
|
tempfile = "3"
|
||||||
cap-tempfile = "0.24"
|
cap-tempfile = "0.25"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
cap-std-apis = ["cap-std", "io-lifetimes", "v2017_10"]
|
cap-std-apis = ["cap-std", "io-lifetimes", "v2017_10"]
|
||||||
|
@ -153,14 +153,16 @@ impl Repo {
|
|||||||
|
|
||||||
/// Borrow the directory file descriptor for this repository.
|
/// Borrow the directory file descriptor for this repository.
|
||||||
#[cfg(feature = "cap-std-apis")]
|
#[cfg(feature = "cap-std-apis")]
|
||||||
pub fn dfd_borrow<'a>(&'a self) -> io_lifetimes::BorrowedFd<'a> {
|
pub fn dfd_borrow(&self) -> io_lifetimes::BorrowedFd {
|
||||||
unsafe { io_lifetimes::BorrowedFd::borrow_raw_fd(self.dfd()) }
|
unsafe { io_lifetimes::BorrowedFd::borrow_raw(self.dfd()) }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return a new `cap-std` directory reference for this repository.
|
/// Return a new `cap-std` directory reference for this repository.
|
||||||
#[cfg(feature = "cap-std-apis")]
|
#[cfg(feature = "cap-std-apis")]
|
||||||
pub fn dfd_as_dir(&self) -> std::io::Result<cap_std::fs::Dir> {
|
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.
|
/// Find all objects reachable from a commit.
|
||||||
|
Reference in New Issue
Block a user