Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,20 @@ jobs:
with:
rust: stable
- run: task check
test:
test-linux:
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: Pistonight/mono-dev/actions/setup@main
with:
rust: stable
- run: task test
test-windows:
runs-on: blacksmith-4vcpu-windows-2025
steps:
- uses: Pistonight/mono-dev/actions/setup@main
with:
rust: stable
- run: task test
doc:
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
Expand Down
14 changes: 7 additions & 7 deletions packages/copper/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pistonite-cu"
version = "0.8.2"
version = "0.8.3"
edition = "2024"
description = "Battery-included common utils to speed up development of rust tools"
repository = "https://github.com/Pistonite/cu"
Expand All @@ -15,7 +15,7 @@ pistonite-cu-proc-macros = { version = "0.2.8", path = "../copper-proc-macros" }

# --- Always enabled ---
anyhow = "1.0.102"
log = "0.4.29"
log = "0.4.30"

# --- Command Line Interface ---
oneshot = { version = "0.2.1", optional = true, features = ["std"] }
Expand All @@ -28,21 +28,21 @@ ctrlc = { version = "3.5.2", optional = true }

# --- Coroutine ---
num_cpus = { version = "1.17.0", optional = true }
tokio = { version = "1.52.1", optional = true, features = [
tokio = { version = "1.52.3", optional = true, features = [
"macros", "rt-multi-thread"
] }

# --- File System ---
dunce = {version="1.0.5", optional = true}
which = {version = "8.0.2", optional = true }
pathdiff = {version = "0.2.3", optional=true}
filetime = { version = "0.2.27", optional = true}
filetime = { version = "0.2.29", optional = true}
glob = { version = "0.3.3", optional = true }
spin = {version = "0.10.0", optional = true} # for PIO
spin = {version = "0.12.0", optional = true} # for PIO

# serde
serde = { version = "1.0.228", features = ["derive"], optional = true }
serde_json = { version = "1.0.149", optional = true }
serde_json = { version = "1.0.150", optional = true }
serde_yaml_ng = { version = "0.10.0", optional = true }
toml = { version = "1.1.2", optional = true }

Expand All @@ -58,7 +58,7 @@ windows-sys = { version = "0.61.2", features = ["Win32_Foundation", "Win32_Syste
[dev-dependencies]

[dev-dependencies.tokio]
version = "1.52.1"
version = "1.52.3"
features = [ "macros", "rt-multi-thread", "time" ]

[features]
Expand Down
7 changes: 3 additions & 4 deletions packages/copper/src/process/pio/cargo_preset.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use std::collections::BTreeSet;
use std::process::Stdio;
use std::sync::{Arc, LazyLock};

Expand Down Expand Up @@ -266,7 +265,7 @@ struct PrintState {
other_lv: Lv,
bar: Arc<ProgressBar>,
done_count: usize,
in_progress: BTreeSet<String>,
in_progress: Vec<String>, // using a vec to preserve order
buf: String,
diagnostic_hook: Option<DianogsticHook>,
stderr_printing_message_lv: Option<Lv>,
Expand Down Expand Up @@ -316,7 +315,7 @@ impl PrintState {
return;
}
self.done_count += 1;
self.in_progress.remove(target.name);
self.in_progress.retain(|x| x != target.name);
self.update_bar();
}
"compiler-message" => {
Expand Down Expand Up @@ -409,7 +408,7 @@ impl PrintState {
None => line,
Some(i) => &line[..i],
};
self.in_progress.insert(crate_name.replace('-', "_"));
self.in_progress.push(crate_name.replace('-', "_"));
self.update_bar();
}

Expand Down
4 changes: 4 additions & 0 deletions packages/copper/src/process/pio/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use super::{ChildOutConfig, ChildOutTask};
///
/// assert_eq!(b"Hello, world!\n".to_vec(), out.join()??);
/// # Ok(()) }
/// # #[cfg(not(unix))] fn main() {}
/// ```
#[inline(always)]
pub fn buffer() -> Buffer {
Expand Down Expand Up @@ -87,6 +88,7 @@ impl ChildOutTask for BufferTask {
///
/// assert_eq!("Hello, world!\n", out.join()??);
/// # Ok(()) }
/// # #[cfg(not(unix))] fn main() {}
/// ```
#[inline(always)]
pub fn string() -> BufferString {
Expand Down Expand Up @@ -175,6 +177,7 @@ async fn read_to_end(r: Result<ChildStdout, ChildStderr>) -> crate::Result<Vec<u
///
/// child.wait_nz()?;
/// # Ok(())}
/// # #[cfg(not(unix))] fn main() {}
/// ```
///
/// # Blocking
Expand Down Expand Up @@ -285,6 +288,7 @@ impl Iterator for LinesOutput {
///
/// child.co_wait_nz().await?;
/// # Ok(())}
/// # #[cfg(not(unix))] fn main() {}
/// ```
#[inline(always)]
pub fn co_lines() -> CoLines {
Expand Down
1 change: 1 addition & 0 deletions packages/copper/src/process/pio/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use super::{ChildInConfig, ChildInTask};
///
/// assert_eq!(b"foobar\n".to_vec(), out.join()??);
/// # Ok(()) }
/// # #[cfg(not(unix))] fn main() {}
/// ```
#[inline(always)]
pub fn write<B: AsRef<[u8]> + Send + 'static>(buf: B) -> Write<B> {
Expand Down
3 changes: 3 additions & 0 deletions packages/copper/src/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ pub use osstring::{OsStrExtension, OsStrExtensionOwned};
mod path;
#[cfg(feature = "fs")]
pub use path::PathExtension;

// path macro just depends on the std path functions and does not require fs
mod path_macro;
Loading