bazel icon indicating copy to clipboard operation
bazel copied to clipboard

macos c++ support regression on 7.2.0

Open pchilds opened this issue 1 year ago • 3 comments
trafficstars

Description of the bug:

c++17 features unavailable after latest release (std::get) possibly it is built against a legacy OS version

error: 'get<...snip...>' is unavailable: introduced in macOS 10.13

I'm on Mac 12.6.5, Apple M1 Max chip

Which category does this issue belong to?

C++ Rules

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

No response

Which operating system are you running Bazel on?

MacOS

What is the output of bazel info release?

release 7.2.0

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

N.A.

What's the output of git remote get-url origin; git rev-parse HEAD ?

N.A.

If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.

No response

Have you found anything relevant by searching the web?

No

Any other information, logs, or outputs that you want to share?

No response

pchilds avatar Jul 25 '24 21:07 pchilds

Building with -s shows my compiler flags are including -mmacosx-version-min=10.11 I am on version 12.6.5, clang++ indicates a monterey target, had it working fine before it updated ~ 8 hours ago. Workaround is to add command line argument to override the version-min. Can see no reason why it would select 10.11, never had any v10 code on it. First install was v12 and haven't engaged in anything targeting older versions

pchilds avatar Jul 26 '24 04:07 pchilds

Please report the issue on rules_apple. cc @keith

comius avatar Aug 23 '24 14:08 comius

if you'd like to target a specific C++ version you should make sure to pass --cxxopt=-std=c++17 in your .bazelrc or BUILD files. If you would like to make sure you target a specific macOS version you should pass the --macos_minimum_os and --host_macos_minimum_os flags. I'm not sure what would have changed with an OS update either but these will make your build consistent and should avoid that type of issue

keith avatar Aug 23 '24 18:08 keith