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

Executing pipelines #62

Closed
19 tasks done
Tracked by #51
magicant opened this issue Jul 8, 2021 · 1 comment
Closed
19 tasks done
Tracked by #51

Executing pipelines #62

magicant opened this issue Jul 8, 2021 · 1 comment
Labels
tracker List of subtasks
Projects

Comments

@magicant
Copy link
Owner

magicant commented Jul 8, 2021

  • Opening a pipe
  • Duplicating an FD
  • Closing an FD
  • Put pipeline commands in Rc Executing pipeline #66
  • Running subshells simultaneously (starting a subshell asynchronously) Executing pipeline #66
  • Complete partially unimplemented test (pipe_connects_commands_in_pipeline) Selecting in child processes #70
    • Requires select in cat_builtin_main
    • SharedSystem::select should wait until the condition is met (rather than immediately returning 0). Pipes should have some condition variable to wake it up.
      • Can we make System::select async for that?
    • Calling a parent Env's select should also select in child Envs
      • Keep child SharedSystems in parent SharedSystem or in parent VirtualSystem?
      • Call select repeatedly in DummyChildProcess::run?
  • Handle Divert in subshell cfa9849
  • Convert signal number to exit status for signaled child process
  • Handle all wait statuses 856a30d
  • Inverting the exit status with the ! keyword
  • Method to test I/O on pipes with VirtualSystem
    • System::read
    • System::write
    • Virtual pipe
    • Virtual open file description (pipe reader)
    • Virtual open file description (pipe writer)
    • Virtual open file description (file reader/writer)
    • Virtual file descriptor
    • Default stdin/stdout
    • Dummy cat built-in or something alike

In the minimum implementation of pipeline execution, the shell is not required to wait for all the subshells of a pipeline. It suffices to waiting only for the last subshell, so it is out of scope of this issue to manage all the child processes of a pipeline in the environment. (Do we need to add a pid parameter to System::wait_sync so we can wait for a particular child process?)

@magicant magicant added this to To do in Main via automation Jul 8, 2021
@magicant magicant moved this from To do to In progress in Main Jul 8, 2021
@magicant magicant moved this from In progress to To do in Main Jul 10, 2021
@magicant magicant moved this from To do to In progress in Main Jul 21, 2021
@magicant
Copy link
Owner Author

Pipeline commands are run in a subshell concurrently, so the command cannot be just borrowed and passed to the subshell. Probably Pipeline should be redefined as:

pub struct Pipeline<H = HereDoc> {
    pub commands: Rc<Vec<Command<H>>>,
    pub negation: bool,
}

@magicant magicant mentioned this issue Jul 25, 2021
6 tasks
@magicant magicant moved this from In progress to To do in Main Aug 13, 2021
@magicant magicant added the tracker List of subtasks label Oct 6, 2021
@magicant magicant closed this as completed May 8, 2022
Main automation moved this from To do to Done May 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tracker List of subtasks
Projects
Status: Done
Main
  
Done
Development

No branches or pull requests

1 participant