Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion src/remote/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,13 @@ func (c *Client) Build(target *core.BuildTarget) (*core.BuildMetadata, error) {
if err := c.Download(target); err != nil {
return metadata, err
}
// TODO(peterebden): Should this not just be part of Download()?
// TODO(peterebden): Should these not just be part of Download()?
Comment thread
toastwaffle marked this conversation as resolved.
if err := c.downloadData(target); err != nil {
return metadata, err
}
if err := c.downloadRuntimeDependencies(target); err != nil {
return metadata, err
}
}
return metadata, nil
}
Expand All @@ -376,6 +379,22 @@ func (c *Client) downloadData(target *core.BuildTarget) error {
return g.Wait()
}

// downloadRuntimeDependencies downloads all the runtime dependencies for a target.
func (c *Client) downloadRuntimeDependencies(target *core.BuildTarget) error {
var g errgroup.Group
for runDep := range target.IterAllRuntimeDependencies(c.state.Graph) {
l, _ := runDep.Label()
t := c.state.Graph.TargetOrDie(l)
g.Go(func() error {
if err := c.Download(t); err != nil {
return err
}
return nil
})
}
return g.Wait()
}

// Run runs a target on the remote executors.
func (c *Client) Run(target *core.BuildTarget) error {
if err := c.CheckInitialised(); err != nil {
Expand Down
Loading