-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Extend LLBuildManifestWriter to let shell commands specify environment and initial working directory #3332
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
Extend LLBuildManifestWriter to let shell commands specify environment and initial working directory #3332
Conversation
…t and initial working directory
@swift-ci please smoke test |
@@ -96,13 +96,17 @@ public struct BuildManifest { | |||
inputs: [Node], | |||
outputs: [Node], | |||
args: [String], | |||
environ: [String: String] = [:], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: environ -> environment (more swifty)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I was trying to follow the style of "args" above. I could change this but would probably also want to change 'args
etc. Let's do that in a follow-up where we can clean them all up.
@@ -134,6 +134,16 @@ public final class ManifestToolStream { | |||
stream <<< " \(key): " <<< Format.asJSON(newValue) <<< "\n" | |||
} | |||
} | |||
|
|||
public subscript(key: String) -> [String: String] { | |||
get { fatalError() } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it be better to use a func instead of subscript so we don't have this potential runtime issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree in general but figured it was better to stay with the existing approach for this PR, i.e. the cognitive cost of something completely different for this one case would be more than the benefit. Seems to me that we should redo all of these at some point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couple of nit
Thanks for pointing them out. Replied about staying with the current approach for the |
Extend LLBuildManifestWriter to let shell commands specify environment and initial working directory.
Motivation:
Plugin build tool commands can specify an environment and initial working directory, and we need LLBuildManifestWriter support for this.
Modifications: