-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[build-script] Shell Module #14430
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
[build-script] Shell Module #14430
Conversation
@swift-ci please test |
I think sh.mkdir("foo")
with sh.pushd("foo"):
# something
pass Since |
@rintaro I'll override |
@swift-ci please test |
Build failed |
Build failed |
@swift-ci please test |
@swift-ci please build toolchain |
Build failed |
Build failed |
@swift-ci please test Linux |
…ndard subprocess library. Also implemented a small wrapper module around Xcrun using the new shell module.
…e unexpected failures if they still perform work.
…dded missing **kwargs to the _fake_popen method on the CommandExecutor.
I'm going to close this PR, it's no longer the direction I want to take this sort of module. |
Purpose
This PR introduces two new modules. First is the
shell
module which implements aCommandExecutor
that wraps portions of the standardsubprocess
module in a context object that tracks common state and command history. The executor is extensible with a trivial action system that allows for users to add any callable to the queue of actions performed prior to executing a command. The intended use-case here is to have a centralized shell-object that is passed around through the program to build up a history and maintain state.For example:
It's possible to hook-in custom actions like so:
Every action is performed before executing the command.
The second module is pretty small, wrapping the
xcrun
utility using theshell
module. Both have testing, albeit not much in the way ofxcrun
.This furthers the efforts for completing SR-237
rdar://25281853