Skip to content

[rule based toolchain] Supporting exec tools as part of cc_args #627

@cerisier

Description

@cerisier

clang and gcc both can both delegate various part of the build to external tools. ld and as are the most popular.

In the case of CUDA, extra binaries such as ptxas come at play.

By default clang expects to find it inside a bin folder under --cuda-path=.
Or at a custom path defined by --ptxas-path=

The issue is that cc_args to pass --ptxas-path is evaluated under cc_toolchain.args which is target configured, whereas ptxas needs to match the platform resolved for the toolchain.

An option is to wrap those binaries into rule that reexports the binary provided as cfg = "exec" but from our own experience, exec cfg isn't guaranteed to match the resolved platform for the toolchain.

Arguably, the ability to pass a custom --ld-path would suffer from the same issue.

From my understanding, only the tool_map would be guaranteed to match the resolved platform for the toolchain, and that only after #555 lands.

Has this use case ever been considered ?

cc @dzbarsky and @fmeum with whom we have regular discussion about this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3We're not considering working on this, but happy to review a PR. (No assignee)category: toolchainstype: feature requestRequest for new, generally useful functionality that is missing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions