Skip to content

Document mixed/heterogeneous builds across different operating systems #487

Open
@lukts30

Description

@lukts30

Is it possible to have a BUILD step automatically run on a remote host if the local OS is not target_compatible without having to use --fake-host?

E.g I want to make something like this to work:

genrule(
    name = "hello_windows",
    out = "hello_windows.txt",
    cmd = "echo Hello from Windows >> $OUT",
    target_compatible_with = ["config//os:windows"],
)

genrule(
    name = "hello_linux",
    out = "hello_linux.txt",
    cmd = "sha1sum $(location :hello_windows) >> $OUT",
    target_compatible_with = ["config//os:linux"],
)

This is similar to the following bazel issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions