Skip to content

Commit

Permalink
Merge branch 'main' into bump_validator
Browse files Browse the repository at this point in the history
  • Loading branch information
jcdubois committed Jul 1, 2024
2 parents 4c25e71 + 03b4b5b commit 8a81417
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 38 deletions.
37 changes: 15 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
license = "Apache-2.0"
readme = "README.md"
repository = "https://github.com/esrlabs/northstar"
rust-version = "1.65.0"
rust-version = "1.70.0"

[workspace]
members = [
Expand Down
3 changes: 1 addition & 2 deletions cargo-npk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ rust-version.workspace = true

[dependencies]
anyhow = "1.0.80"
atty = "0.2.14"
cargo-subcommand = { version = "0.12.0", features = ["clap"] }
cargo_metadata = "0.15.3"
cargo_metadata = "0.18.1"
clap = { version = "4.4.18", features = ["derive"] }
human_bytes = "0.4.3"
humantime = "2.1.0"
Expand Down
4 changes: 2 additions & 2 deletions cargo-npk/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl Display for Compression {
#[group(skip)]
#[allow(clippy::large_enum_variant)]
pub enum NpkSubCommand {
/// Compile the current package and create an apk
/// Compile the current package and create a npk
Pack {
#[clap(flatten)]
args: Args,
Expand All @@ -91,6 +91,6 @@ pub enum NpkSubCommand {
#[clap(long("out"))]
out: Option<PathBuf>,
},
/// Print the version of cargo-apk
/// Print the version of cargo-npk
Version,
}
4 changes: 3 additions & 1 deletion cargo-npk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ use northstar_runtime::npk::npk::{NpkBuilder, SquashfsOptions};

use crate::metadata::Metadata;

use std::io::IsTerminal;

mod cli;
mod metadata;

Expand Down Expand Up @@ -307,7 +309,7 @@ fn stdout(choice: ColorChoice) -> StandardStream {
ColorChoice::Always => termcolor::ColorChoice::Always,
ColorChoice::Never => termcolor::ColorChoice::AlwaysAnsi,
ColorChoice::Auto => {
if atty::is(atty::Stream::Stdout) {
if std::io::stdout().is_terminal() {
termcolor::ColorChoice::Auto
} else {
termcolor::ColorChoice::Never
Expand Down
2 changes: 1 addition & 1 deletion examples/inspect/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "Apache-2.0"

[dependencies]
caps = "0.5.5"
nix = { version = "0.28.0", default-features = false, features = [ "process", "user", "signal" ] }
nix = { version = "0.29.0", default-features = false, features = [ "process", "user", "signal" ] }

[package.metadata.npk]
manifest = "manifest.yaml"
Expand Down
2 changes: 1 addition & 1 deletion examples/test-container/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license = "Apache-2.0"
anyhow = { version = "1.0.80", features = ["backtrace"] }
caps = "0.5.5"
clap = { version = "4.4.18", features = ["derive"] }
nix = { version = "0.28.0", default-features = false, features = ["process", "user"] }
nix = { version = "0.29.0", default-features = false, features = ["process", "user"] }
socket2 = { version = "0.5.6", features = ["all"] }

[package.metadata.npk]
Expand Down
4 changes: 2 additions & 2 deletions northstar-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ hex = { version = "0.4.3", optional = true }
hmac = { version = "0.12.1", features = ["reset"], optional = true }
humanize-rs = { version = "0.1.5", optional = true }
humantime-serde = { version = "1.1.1", optional = true }
inotify = { version = "0.10.0", features = ["stream"], optional = true }
inotify = { version = "0.10.2", features = ["stream"], optional = true }
itertools = { version = "0.12.1", optional = true }
lazy_static = { version = "1.4.0", optional = true }
libc = { version = "0.2.155", optional = true }
Expand All @@ -37,7 +37,7 @@ memchr = "2.6.2"
memfd = { version = "0.6.4", optional = true }
memoffset = { version = "0.9.0", optional = true }
nanoid = { version = "0.4.0", optional = true }
nix = { version = "0.28.0", default-features = false, features = ["fs", "sched", "ioctl", "mount", "term", "uio", "socket", "net", "signal", "user"], optional = true }
nix = { version = "0.29.0", default-features = false, features = ["fs", "sched", "ioctl", "mount", "term", "uio", "socket", "net", "signal", "user"], optional = true }
pkg-version = { version = "1.0.0", optional = true }
rand_core = { version = "0.6.4", features = ["getrandom"], optional = true }
rlimit = { version = "0.10.1", optional = true }
Expand Down
7 changes: 4 additions & 3 deletions northstar-runtime/src/runtime/cgroups.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,18 +319,19 @@ impl MemoryMonitor {
// This task stops when the main loop receiver closes
let task = {
let stop = token.clone();
let mut inotify = Inotify::init().expect("Error while initializing inotify instance");
let inotify = Inotify::init().expect("Error while initializing inotify instance");

inotify
.add_watch(&path, WatchMask::MODIFY)
.watches()
.add(&path, WatchMask::MODIFY)
.expect("failed to add file watch");

task::spawn(async move {
debug!("Listening for v2 oom events of {}", container);

let mut buffer = [0; 1024];
let mut stream = inotify
.event_stream(&mut buffer)
.into_event_stream(&mut buffer)
.expect("failed to initialize inotify event stream");

'outer: loop {
Expand Down
2 changes: 1 addition & 1 deletion northstar-runtime/src/runtime/ipc/framed_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl FramedUnixStream {

let message =
recvmsg::<SockaddrIn6>(fd, iov, control_message_buffer, FLAGS).map_err(os_err)?;
recv_control_msg::<T>(message.cmsgs().next(), num)
recv_control_msg::<T>(message.cmsgs()?.next(), num)
}

/// Into UnixStream
Expand Down
2 changes: 1 addition & 1 deletion northstar-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ lazy_static = "1.4.0"
log = "0.4.21"
memfd = "0.6.4"
nanoid = "0.4.0"
nix = { version = "0.28.0", features = ["sched"], default-features = false }
nix = { version = "0.29.0", features = ["sched"], default-features = false }
northstar-client = { path = "../northstar-client" }
northstar-runtime = { path = "../northstar-runtime", features = ["api", "runtime"] }
northstar-tests-derive = { path = "northstar-tests-derive" }
Expand Down
2 changes: 1 addition & 1 deletion northstar/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ rust-version.workspace = true
anyhow = { version = "1.0.80", features = ["backtrace"] }
clap = { version = "4.4.18", features = ["derive"] }
log = { version = "0.4.21", features = ["std"] }
nix = { version = "0.28.0", default-features = false, features = ["sched", "mount"] }
nix = { version = "0.29.0", default-features = false, features = ["sched", "mount"] }
northstar-runtime = { version = "^0.9.2-pre", path = "../northstar-runtime", features = ["runtime", "rexec"] }
tokio = { version = "1.32.0", features = ["rt-multi-thread", "macros", "signal"] }
toml = "0.8.14"
Expand Down

0 comments on commit 8a81417

Please sign in to comment.