diff options
author | Brentley Jones <github@brentleyjones.com> | 2023-09-08 13:04:44 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-08 13:04:44 -0500 |
commit | 0940b1718857ae685fc4ce844f073e9abfab046d (patch) | |
tree | 3ebb2af08da2c5d99c3ff34bae0fb3f3b94b411d | |
parent | 97ac904a18a394ccac49952761277c012e3a3e6e (diff) | |
download | bazelbuild-apple_support-0940b1718857ae685fc4ce844f073e9abfab046d.tar.gz |
Improve error message for unknown CPUs (#255)
Signed-off-by: Brentley Jones <github@brentleyjones.com>
-rw-r--r-- | crosstool/cc_toolchain_config.bzl | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/crosstool/cc_toolchain_config.bzl b/crosstool/cc_toolchain_config.bzl index 6ff64f8..9ecc400 100644 --- a/crosstool/cc_toolchain_config.bzl +++ b/crosstool/cc_toolchain_config.bzl @@ -86,7 +86,12 @@ def _impl(ctx): elif (ctx.attr.cpu == "watchos_x86_64"): target_system_name = "x86_64-apple-watchos{}-simulator".format(target_os_version) else: - fail("Unreachable") + fail("""\ +Unknown CPU: {cpu}. Please update 'apple_support' to the latest version. If \ +you are sure you are on the latest version, try 'bazel shutdown' to work \ +around a Bazel staleness bug. Finally, if you still encounter this error, \ +please file an issue at https://github.com/bazelbuild/apple_support/issues/new +""".format(cpu = ctx.attr.cpu)) if ctx.attr.cpu.startswith("darwin_"): target_libc = "macosx" @@ -727,7 +732,12 @@ def _impl(ctx): ], ) else: - fail("Unreachable") + fail("""\ +Unknown CPU: {cpu}. Please update 'apple_support' to the latest version. If \ +you are sure you are on the latest version, try 'bazel shutdown' to work \ +around a Bazel staleness bug. Finally, if you still encounter this error, \ +please file an issue at https://github.com/bazelbuild/apple_support/issues/new +""".format(cpu = ctx.attr.cpu)) runtime_root_flags_feature = feature( name = "runtime_root_flags", |