Skip to content

wrapper_clang should be compiled with DEVELOPER_DIR in the environment #11716

Closed
@brentleyjones

Description

@brentleyjones

Description of the problem / feature request:

wrapper_clang should pass DEVELOPER_DIR to xcrun invocation. Without this, xcode-select needs to be set globally, which impacts multiple workspaces.

xcrun_result = repository_ctx.execute([
"env",
"-i",
"xcrun",
"--sdk",
"macosx",
"clang",
"-mmacosx-version-min=10.9",
"-std=c++11",
"-lc++",
"-o",
"wrapped_clang",
wrapped_clang_src_path,
], 30)

When using DEVELOPER_DIR as an --action_env to set the Xcode version to compile with, the current behavior results in cache misses that involve wrapper_clang, since different versions of Xcode could have been used to compile it.

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

wrapper_clang being compiled with the correct version of Xcode, based on --action_env=DEVELOPER_DIR`.

What operating system are you running Bazel on?

macOS 10.15.5

What's the output of bazel info release?

release 3.3.0

Have you found anything relevant by searching the web?

#11635
#8902

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2We'll consider working on this in future. (Assignee optional)team-Rules-CPPIssues for C++ rulestype: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions