Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert default cpu value on x86 macOS to "darwin" #12918

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ public class AutoCpuConverter implements Converter<String> {
public String convert(String input) throws OptionsParsingException {
if (input.isEmpty()) {
// TODO(philwo) - replace these deprecated names with more logical ones (e.g. k8 becomes
// linux-x86_64 ...).
// linux-x86_64, darwin includes the CPU architecture, ...).
switch (OS.getCurrent()) {
case DARWIN:
switch (CPU.getCurrent()) {
case X86_64:
return "darwin_x86_64";
return "darwin";
case AARCH64:
return "darwin_arm64";
default:
Expand Down
2 changes: 1 addition & 1 deletion tools/cpp/lib_cc_configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def get_cpu_value(repository_ctx):
if os_name.startswith("mac os"):
# Check if we are on x86_64 or arm64 and return the corresponding cpu value.
result = repository_ctx.execute(["uname", "-m"])
return "darwin_" + result.stdout.strip()
return "darwin" + ("_arm64" if result.stdout.strip() == "arm64" else "")
if os_name.find("freebsd") != -1:
return "freebsd"
if os_name.find("openbsd") != -1:
Expand Down