Skip to content

Distinguish target and exec configuration for build mode #37

@aherrmann

Description

@aherrmann

Ideally Bazel would have native support for this, see bazelbuild/bazel#13048.

Until then one can work around this by detecting a tool configuration as motivated in bazelbuild/bazel#14444 (comment) using the approach described in the Bazel code base here in the settings rule and switch between separate mode and exec_mode flags.

However, such a workaround breaks config_settings such as defined here. As they cannot determine whether we're in a target or exec configuration and cannot switch to the appropriate flag accordingly. One workaround to that would be to split the config_settings into target_debug and exec_debug, etc. However, this means that downstream users would have to know which setting to switch on, which doesn't work for targets used in both an exec and a target configuration.

Until a concrete need arises, it's best to wait for Bazel to have builtin support for this feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions