Skip to content

Add dependency configuration to export a CAS digest as an environment variable #1984

@abderrahim

Description

@abderrahim

Context: https://lists.apache.org/thread/scsz1ybc25d3x1oy33onfmm8rhr0kddg

We want to be able to export the CAS digest of certain dependencies to the sandbox. This can be used in conjunction with something like #1772 to have more correct cache keys for bazel/RECC, but can be more generally useful on its own to include this information about dependencies in its own artifacts.

This is to be implemented via a dependency configuration, similar to the already existing location. As this happens pretty late in the element lifecycle, it cannot be exported as a buildstream variable. It will instead be exported as an environment variable in the sandbox.

For example:

dependencies:
- foo.bst
- bar.bst
- filename: gcc.bst
  config:
    digest-environment: RECC_TOOLCHAIN_KEY

One thing to take into consideration implementeng this is that we don't yet have any way for a plugin to find the CAS digest of a dependency except for staging it into the sandbox. We will need to add some public API to allow this. Either public API to manipulate dependency artifacts as Directory instances directly, or a way to create a throwaway dummy sandbox, that can't run any commands but can be passed to existing APIs such as Element.stage_artifact() and Element.stage_dependency_artifacts().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions