Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output capture on process in rune-modules is non-functional #751

Open
VorpalBlade opened this issue Jul 18, 2024 · 2 comments · May be fixed by #763
Open

Output capture on process in rune-modules is non-functional #751

VorpalBlade opened this issue Jul 18, 2024 · 2 comments · May be fixed by #763
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@VorpalBlade
Copy link
Contributor

Consider this rune code using process from rune-modules:

    let cmd = process::Command::new("ls");
    cmd.arg("-l");
    dbg(cmd);
    let child = cmd.spawn()?;
    dbg(child);
    let output = child.wait_with_output().await?;
    std::io::dbg!("output:", output.stdout);

It will print:

<Command object at 0x7ffceb01aba8>
<Child object at 0x7ffceb01aba8>

[ output of ls -l here ]

"output:"
[]

As can be seen, the output is not captured, but just sent straight to stdout/stderr. There is also no function in the API of process to enable capturing.

So the API seems a bit broken / untested?

@udoprog
Copy link
Collaborator

udoprog commented Jul 18, 2024

The documentation is lacking and there is like you say no support for configuring piped output.

Here's the documentation of the component it's based of, which Monica the behavior of std:
https://docs.rs/tokio/latest/tokio/process/struct.Child.html#method.wait_with_output

I would be happy if someone wanted to adopt these modules, cause I only use them for reference of how certain things are done and add any "std things" which I've ended up using!

@udoprog udoprog added bug Something isn't working documentation Improvements or additions to documentation labels Jul 18, 2024
@VorpalBlade
Copy link
Contributor Author

I have a need for a more fully featured process module in general. In particular I need to be able to create a pipeline of several child processes (kind of like duct except that is not async).

Not sure how to do that with tokio (does it work the same way as with normal std?).

I could definitely look into this, but I have no way of testing on platforms other than Linux (and possibly other free nixes in VMs). Also, don't expect any time frames.

@VorpalBlade VorpalBlade linked a pull request Jul 22, 2024 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants