1
0
mirror of https://github.com/containers/youki synced 2024-11-23 01:11:58 +01:00
youki/crates/libcontainer
Eric Fang 6162618e7a
Refactor the libcgroups interface (#2168)
* fix notify_listener

- fix the name to notify listener
- fix the structure to be clone-able

Signed-off-by: yihuaf <yihuaf@unkies.org>

* changed the libcgroup creation interface

Changed the libcgroup creation interface to use config struct rather
than variables. The creation will also own/consume the config struct.
In this way, we don't have to create the cgroup manager upfront.
Instead, we can delay the creation of cgroup manager in the process when
it is needed.

Signed-off-by: yihuaf <yihuaf@unkies.org>

* Add a notify listener test

Signed-off-by: yihuaf <yihuaf@unkies.org>

* fix clippy

Signed-off-by: yihuaf <yihuaf@unkies.org>

* fix spellcheck

Signed-off-by: yihuaf <yihuaf@unkies.org>

---------

Signed-off-by: yihuaf <yihuaf@unkies.org>
2023-07-19 22:09:43 +09:00
..
src Refactor the libcgroups interface (#2168) 2023-07-19 22:09:43 +09:00
Cargo.toml
README.md

libcontainer

Building with musl

In order to build with musl you must first remove the libseccomp dependency as it will reference shared libraries (libdbus and libseccomp) which cannot be built with musl.

Do this by using adding flags to Cargo. Use the --no-default-features flag followed by -F and whatever features you intend to build with such as v2 as defined in Cargo.toml under features section.

Next you will also need the +nightly flags when building with rustup and cargo.

# Add rustup +nightly musl to toolchain
rustup +nightly target add $(uname -m)-unknown-linux-musl

# Build rustup +nightly stdlib with musl
rustup +nightly toolchain install nightly-$(uname -m)-unknown-linux-musl

# Build musl standard library
cargo +nightly build -Zbuild-std --target $(uname -m)-unknown-linux-musl --no-default-features -F v2

cargo +nightly build --target $(uname -m)-unknown-linux-musl --no-default-features -F v2