Skip to content

Commit

Permalink
Merge pull request RobotLocomotion#14608 from jamiesnape/unbreak-big-sur
Browse files Browse the repository at this point in the history
Allow for new macOS versioning scheme and sync minimum compiler and CMake versions for macOS
  • Loading branch information
jamiesnape authored Feb 3, 2021
2 parents 176ebf6 + ea2d28f commit d53de64
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ endif()

# The minimum compiler versions should match those listed in both
# doc/developers.rst and tools/workspace/cc/repository.bzl.
set(MINIMUM_APPLE_CLANG_VERSION 11)
set(MINIMUM_APPLE_CLANG_VERSION 12)
set(MINIMUM_CLANG_VERSION 9)
set(MINIMUM_GNU_VERSION 7.5)

Expand Down
4 changes: 2 additions & 2 deletions doc/developers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ Drake requires a compiler running in C++17 mode.
| Ubuntu 20.04 LTS (Focal Fossa) | | 3.16 | | GCC 9.3 (default) | | 3.8 |
| | | | | Clang 9 | | |
+----------------------------------+ +-------+---------------------+-------------------+ |
| macOS Catalina (10.15) | | 3.18 | | Apple LLVM 12.0.0 | | AdoptOpenJDK 15 | |
| | | | | (Xcode 12.2) | | (HotSpot JVM) | |
| macOS Catalina (10.15) | | 3.19 | | Apple LLVM 12.0.0 | | AdoptOpenJDK 15 | |
| | | | | (Xcode 12.4) | | (HotSpot JVM) | |
+----------------------------------+-------+-------+---------------------+-------------------+--------+

CPython is the only Python implementation supported. On Ubuntu, amd64
Expand Down
5 changes: 0 additions & 5 deletions tools/macos.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
# N.B. Ensure this is consistent with `execute.bzl`.
build --action_env=PATH=/usr/local/bin:/usr/bin:/bin

# Work around alignment-related issues when compiling code that uses
# Eigen <= 3.3.7 with Apple LLVM 11.0.0. Most are fixed in the 3.3 branch of
# Eigen as of commit a5c3d12.
build --copt=-fno-stack-check

# Suppress numerous "'_FORTIFY_SOURCE' macro redefined" warnings when using
# sanitizers.
build:asan --copt=-Wno-macro-redefined
Expand Down
4 changes: 2 additions & 2 deletions tools/workspace/cc/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ def _impl(repository_ctx):
# even if they happen to support the necessary compiler flags.

if compiler_id == "AppleClang":
if compiler_version_major < 11:
fail("AppleClang compiler version {}.{} is less than 11.0.".format(
if compiler_version_major < 12:
fail("AppleClang compiler version {}.{} is less than 12.0.".format(
compiler_version_major,
compiler_version_minor,
))
Expand Down
14 changes: 9 additions & 5 deletions tools/workspace/os.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,16 @@ def _determine_macos(repository_ctx):
return _make_result(error = error_prologue + sw_vers.error)

major_minor_versions = sw_vers.stdout.strip().split(".")[:2]
macos_release = ".".join(major_minor_versions)
if int(major_minor_versions[0]) < 11:
macos_release = ".".join(major_minor_versions)
else:
macos_release = major_minor_versions[0]

# Match supported macOS release(s).
if macos_release in ["10.15", "11.0"]:
if macos_release == "11.0":
if macos_release in ["10.15", "11"]:
if macos_release == "11":
print(
"WARNING: macOS Big Sur 11.0 is NOT yet supported. " +
"WARNING: macOS Big Sur 11.x is NOT yet supported. " +
"Compilation, tests, and/or other functionality may fail.",
)
return _make_result(macos_release = macos_release)
Expand All @@ -135,7 +138,8 @@ def determine_os(repository_ctx):
- error: str iff any error occurred, else None
- distribution: str either "ubuntu" or "macos" if no error
- is_macos: True iff on a supported macOS release, else False
- macos_release: str like "10.15" iff on a supported macOS, else None
- macos_release: str like "10.15" or "11" iff on a supported macOS,
else None
- is_ubuntu: True iff on a supported Ubuntu version, else False
- ubuntu_release: str like "18.04" iff on a supported ubuntu, else None
"""
Expand Down

0 comments on commit d53de64

Please sign in to comment.