Skip to content

Commit

Permalink
Set an SDK and a minimum macOS version when invoking clang directly.
Browse files Browse the repository at this point in the history
This should make the binaries we build via a genrule not subject to
the system environment, which should make them deterministic.

RELNOTES: None.
PiperOrigin-RevId: 237105700
  • Loading branch information
A Googler authored and sergiocampama committed Mar 8, 2019
1 parent 0b1aa53 commit 86ce425
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/realpath/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ apple_genrule(
name = "realpath_genrule",
srcs = ["realpath.c"],
outs = ["realpath"],
cmd = "/usr/bin/xcrun clang -o $@ $<",
cmd = """
/usr/bin/xcrun --sdk macosx clang -mmacosx-version-min=10.9 -o $@ $<
""",
# Used by the rule implementations, so it needs to be public; but
# should be considered an implementation detail of the rules and
# not used by other things.
Expand Down

0 comments on commit 86ce425

Please sign in to comment.