Skip to content

Commit

Permalink
Update getHost methods to also copy host flags, for use in exec->host…
Browse files Browse the repository at this point in the history
… transitions.

Currently, the exec transition also calls getHost. As currently implemented, this means any host_* options get reset to defaults, instead of what was actually passed. In a further transition to a real host config, the expected set of flags won't be set.

This change fixes getHost so that host_* options are kept, so that exec->host transitions work as expected.

Part of work on execution transitions, bazelbuild#7935.

PiperOrigin-RevId: 248386317
  • Loading branch information
katre authored and irengrig committed Jun 18, 2019
1 parent 36fbe74 commit b7c44e1
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ public class SwiftCommandLineOptions extends FragmentOptions {
public FragmentOptions getHost() {
SwiftCommandLineOptions host = (SwiftCommandLineOptions) super.getHost();
host.copts = this.hostSwiftcoptList;

// Save host options in case of a further exec->host transition.
host.hostSwiftcoptList = hostSwiftcoptList;

return host;
}
}

0 comments on commit b7c44e1

Please # to comment.