Skip to content

Propagate configurations to execution dependencies #900

Closed
@yxdai-nju

Description

@yxdai-nju

I'm trying to implement Rust's bootstrap process with Buck2.

I've set up three target platforms (also serving as execution platforms) in order: :use_stage0, :use_stage1, and :use_stage2, to constrain which version of the Rust toolchain is used.

For example, when using :use_stage1 as the target platform, it uses the stage1 version of the Rust toolchain.

The problem is: if I have a build target :a with an execution dependency :b, configured like this to use the stage1 toolchain:

configured_alias(name = "a", actual = ":_a", platform = ":use_stage1")

my_target(name = "_a", exec_deps = [":b"])

Buck2 independently resolves the execution platform for :b, and will still select :use_stage0 by default, which is not the behavior I'd expect.

Is there a way to make :b use the same platform as :a?


This occurs when building Rust projects, for example with a project containing build.rs. If the build target is :my_crate, the dependency chain looks like:

:my_crate
-[dep]->
:my_crate-build-script-run
-[exec_dep]->
:my_crate-build-script-build

Solving this is critical for bootstrapping, because even if I specify using the stageX toolchain to build :my_crate, when building :my_crate-build-script-build, it might still select a toolchain other than stageX.

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