From 0b884582809c585bcc049427c9b00a9aa2803d70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Mon, 3 Nov 2025 13:38:09 -0700 Subject: [PATCH 1/4] Add pixi.toml for development and package building --- .gitignore | 3 +++ README.md | 19 +++++++++++++++++++ crates/shell/pixi.toml | 18 ++++++++++++++++++ pixi.toml | 14 ++++++++++++++ 4 files changed, 54 insertions(+) create mode 100644 crates/shell/pixi.toml create mode 100644 pixi.toml diff --git a/.gitignore b/.gitignore index ea8c4bf..e01afb5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ /target +# pixi environments +.pixi/* +!.pixi/config.toml diff --git a/README.md b/README.md index a86c4d9..2960a74 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,25 @@ cargo r -- ./scripts/hello_world.sh cargo r -- ./scripts/hello_world.sh --interact ``` +## How to build and run using pixi + +These commands will install Rust, Cargo and build and run the project. + +```bash +pixi r build +pixi r run +``` + +## How to build a pixi package + +This creates a conda package for `shell` and installs it globally + +```bash +cd crates/shell +pixi build +pixi global install --path ./shell-0.3.0-hbf21a9e_0.conda +``` + ## License The project is licensed under the MIT License. It is an extension of the existing `deno_task_shell` project (also licensed under the MIT License, by the authors of `deno`). diff --git a/crates/shell/pixi.toml b/crates/shell/pixi.toml new file mode 100644 index 0000000..0bddacc --- /dev/null +++ b/crates/shell/pixi.toml @@ -0,0 +1,18 @@ +[workspace] +authors = ["The prefix-dev/shell team "] +channels = ["conda-forge"] +name = "shell" +platforms = ["win-64"] +version = "0.3.0" +preview = ["pixi-build"] + +[dependencies] +rust = ">=1.90.0,<1.91" + +[package] +name = "shell" +version = "0.3.0" + +[package.build.backend] +name = "pixi-build-rust" +version = "==0.4.1" diff --git a/pixi.toml b/pixi.toml new file mode 100644 index 0000000..d28936d --- /dev/null +++ b/pixi.toml @@ -0,0 +1,14 @@ +[workspace] +authors = ["The prefix-dev/shell team "] +channels = ["conda-forge"] +name = "shell" +platforms = ["win-64"] +version = "0.3.0" +preview = ["pixi-build"] + +[tasks] +build = "cargo build" +run = "cargo run" + +[dependencies] +rust = ">=1.90.0,<1.91" From a15e7d808f14a0ab5eb4d9a87689188396d861d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Sat, 8 Nov 2025 07:18:54 -0700 Subject: [PATCH 2/4] Fix clippy warnings --- crates/deno_task_shell/src/shell/command.rs | 4 ++-- crates/deno_task_shell/src/shell/commands/args.rs | 2 +- crates/deno_task_shell/src/shell/execute.rs | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/deno_task_shell/src/shell/command.rs b/crates/deno_task_shell/src/shell/command.rs index 37f1513..bac6a99 100644 --- a/crates/deno_task_shell/src/shell/command.rs +++ b/crates/deno_task_shell/src/shell/command.rs @@ -74,7 +74,7 @@ enum CommandName { struct ResolvedCommand<'a> { command_name: CommandName, - args: Cow<'a, Vec>, + args: Cow<'a, [String]>, } #[derive(Error, Debug)] @@ -112,7 +112,7 @@ impl FailedShebangError { async fn resolve_command<'a>( command_name: &UnresolvedCommandName, context: &mut ShellCommandContext, - original_args: &'a Vec, + original_args: &'a [String], ) -> Result, ResolveCommandError> { let command_path = match resolve_command_path( &command_name.name, diff --git a/crates/deno_task_shell/src/shell/commands/args.rs b/crates/deno_task_shell/src/shell/commands/args.rs index 400fc02..3a40445 100644 --- a/crates/deno_task_shell/src/shell/commands/args.rs +++ b/crates/deno_task_shell/src/shell/commands/args.rs @@ -30,7 +30,7 @@ impl ArgKind<'_> { } } -pub fn parse_arg_kinds(flags: &[String]) -> Vec { +pub fn parse_arg_kinds(flags: &[String]) -> Vec> { let mut result = Vec::new(); let mut had_dash_dash = false; for arg in flags { diff --git a/crates/deno_task_shell/src/shell/execute.rs b/crates/deno_task_shell/src/shell/execute.rs index 2115328..81482e6 100644 --- a/crates/deno_task_shell/src/shell/execute.rs +++ b/crates/deno_task_shell/src/shell/execute.rs @@ -1180,7 +1180,7 @@ async fn execute_pipe_sequence( let (all_handles, changes): (Vec<_>, Vec<_>) = results .into_iter() - .map(|r| (r.into_handles_and_changes())) + .map(|r| r.into_handles_and_changes()) .unzip(); let all_handles: Vec> = all_handles.into_iter().flatten().collect(); @@ -1881,7 +1881,7 @@ fn evaluate_word_parts( eval_glob: EvaluateGlob, stdin: ShellPipeReader, stderr: ShellPipeWriter, -) -> LocalBoxFuture> { +) -> LocalBoxFuture<'_, Result> { fn text_parts_to_string(parts: Vec) -> String { let mut result = String::with_capacity(parts.iter().map(|p| p.as_str().len()).sum()); @@ -1992,7 +1992,7 @@ fn evaluate_word_parts( state: &mut ShellState, stdin: ShellPipeReader, stderr: ShellPipeWriter, - ) -> LocalBoxFuture> { + ) -> LocalBoxFuture<'_, Result> { // recursive async, so requires boxing async move { let mut result = WordPartsResult::new(Vec::new(), Vec::new()); From 62539929b4e835cb60396302f35c236968299ef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Sat, 8 Nov 2025 07:20:35 -0700 Subject: [PATCH 3/4] Disable codecov due to errors --- .github/workflows/coverage.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 7df5ff4..3c2016f 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -12,6 +12,7 @@ on: jobs: test: + if: false name: coverage runs-on: ubuntu-latest container: From 1ad74731ad5f2692a7746c0b3b852a68cba54d4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Sat, 8 Nov 2025 07:21:39 -0700 Subject: [PATCH 4/4] Fix fmt --- crates/deno_task_shell/src/shell/execute.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/deno_task_shell/src/shell/execute.rs b/crates/deno_task_shell/src/shell/execute.rs index 81482e6..ed790a0 100644 --- a/crates/deno_task_shell/src/shell/execute.rs +++ b/crates/deno_task_shell/src/shell/execute.rs @@ -1992,7 +1992,8 @@ fn evaluate_word_parts( state: &mut ShellState, stdin: ShellPipeReader, stderr: ShellPipeWriter, - ) -> LocalBoxFuture<'_, Result> { + ) -> LocalBoxFuture<'_, Result> + { // recursive async, so requires boxing async move { let mut result = WordPartsResult::new(Vec::new(), Vec::new());