HomePhabricator

builder: support cross variant copying for builder.requirements

Description

builder: support cross variant copying for builder.requirements

Allow builder.requirements to use a long form similar to copies when
the user needs to copy files from one variant to another as part of the
builder stage. This allows multi-stage builds to generate some artifact
in stage "A" and then copy that artifact into stage "B" in the
PreInstall phase before running builder.command.

Usage example:

variants:
  A:
    apt:
      packages:
        - wget
    builder:
      command:
        - /bin/bash
        - -c
        - >-
          wget https://example.org/some_cool_utility.tgz
          && tar xzvf some_cool_utility.tgz
          && rm some_cool_utility.tgz
  B:
    builder:
      requirements:
        - src
        - from: A
          source: some_cool_utility
          destination: .
      command:
        - some_cool_utility --do-something-cool src/

Bug: T263597
Co-authored-by: Dan Duvall <dduvall@wikimedia.org>
Change-Id: If813829bdace6851bdba56abcdfcab1cd967df03

Details

Provenance
bd808Authored on Dec 9 2020, 12:56 AM
Parents
rGBLBRe81d1adfd007: Fix Makefile syntax for running linter & legacy errors
Branches
Unknown
Tags
Unknown
ChangeId
If813829bdace6851bdba56abcdfcab1cd967df03