Skip to content

Commit

Permalink
rust: Move to a workspace
Browse files Browse the repository at this point in the history
The current Rust crate is `composefs-core` and is a relatively
thin wrapper for what is currently in the composefs tooling.

Prep for adding a new `composefs-oci`.

Signed-off-by: Colin Walters <[email protected]>
  • Loading branch information
cgwalters committed May 28, 2024
1 parent 9fd6910 commit 3549808
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 26 deletions.
39 changes: 15 additions & 24 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,27 +1,18 @@
[package]
name = "composefs"
version = "0.1.0"
edition = "2021"
description = "Rust composefs"
keywords = ["composefs", "oci", "opencontainers", "docker", "podman"]
license = "MIT"
repository = "https://github.com/containers/composefs"
rust-version = "1.70.0"
[workspace]
members = ["rust/composefs-core"]
resolver = "2"

include = [
"/COPYING",
"/README.md",
"/rust/**",
]
[profile.dev]
opt-level = 1 # No optimizations are too slow for us.

[lib]
name = "composefs"
path = "rust/src/lib.rs"
[profile.release]
lto = "thin"
# No need to support unwinding
panic = "abort"
# We assume we're being delivered via e.g. RPM which supports split debuginfo
debug = true

[dependencies]
anyhow = "1.0"
libc = "0.2"

[dev-dependencies]
tar = "0.4.38"
tempfile = "3.2.0"
[profile.releaselto]
codegen-units = 1
inherits = "release"
lto = "yes"
27 changes: 27 additions & 0 deletions rust/composefs-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[package]
name = "composefs"
version = "0.1.0"
edition = "2021"
description = "Rust composefs"
keywords = ["composefs", "oci", "opencontainers", "docker", "podman"]
license = "MIT"
repository = "https://github.com/containers/composefs"
rust-version = "1.70.0"

include = [
"/COPYING",
"/README.md",
"/rust/composefs-core/**",
]

[lib]
name = "composefs"
path = "src/lib.rs"

[dependencies]
anyhow = "1.0"
libc = "0.2"

[dev-dependencies]
tar = "0.4.38"
tempfile = "3.2.0"
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ mod tests {

#[test]
fn test_parse() {
const CONTENT: &str = include_str!("../../tests/assets/special.dump");
const CONTENT: &str = include_str!("../../../tests/assets/special.dump");
for line in CONTENT.lines() {
// Test a full round trip by parsing, serialize, parsing again
let e = Entry::parse(line).unwrap();
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ fn test_mkcomposefs() -> Result<()> {
let outpath = &td.join("out");
let o = File::create(outpath)?;
let (send, recv) = mpsc::sync_channel(5);
const CONTENT: &str = include_str!("../../tests/assets/special.dump");
const CONTENT: &str = include_str!("../../../tests/assets/special.dump");
std::thread::scope(|s| {
let producer = s.spawn(move || {
for line in CONTENT.lines() {
Expand Down

0 comments on commit 3549808

Please sign in to comment.