-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
bazel_tools 13.14 compile error on macOS with --cxxopt="-std=c++14" #24957
Comments
6906ba6 added code that requires C++17. |
Huh, can confirm it builds with: |
OK, we've been able to move forward by setting Feel free to close this if you think it's working as intended. For me, though, it's interesting that |
C++17 specifies a non- |
@benjaminp Ah, good to know—and a bit scary, but I guess it makes sense to enable easier adaptation to legacy C APIs without |
Description of the bug:
Building the following with
rules_java
8.7.0 or 8.7.1, which usebazel_tools
13.14 (see bazelbuild/rules_java: Update rules_java to 8.7.0 and java_tools to 13.14), fails on macOS with:We hit this in our build while calling
default_java_toolchain
with dependencies on@remote_java_tools//:ijar_cc_binary
and@remote_java_tools//:singlejar_cc_bin
. Both of these apparently depend on@remote_java_tools//:filesystem
.I selected the "Core" category since I didn't see one for
bazel_tools
. Cross-reference: bazelbuild/java_tools#93 (comment)cc: @saraadams
Which category does this issue belong to?
Core
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Update
rules_java
to 8.7.0 (or 8.7.1) in any project, and import theremote_java_tools
repo:Then build on macOS using the macOS SDKs for 14.5 or 15.2:
Which operating system are you running Bazel on?
macOS 15.2 (24C101)
What is the output of
bazel info release
?release 9.0.0-pre.20250106.2
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse HEAD
?If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.
This appears due to the following change: 6906ba6#diff-83cfe165f1bd78a7736edc353ec60148796236c9076c75ed152d35e25a70077bL136-L137 (doesn't jump; search for
mkdtemp
)This changes lines 136-137 of src/main/cpp/util/file_posix.cc from:
to:
std::string.data()
returns aconst char *
, whereas the previous&result[0]
returnschar *
.Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
The full compile command:
ERROR: .../external/rules_java++toolchains+remote_java_tools/BUILD:256:11: Compiling java_tools/src/main/cpp/util/file_posix.cc [for tool] failed: (Exit 1): wrapped_clang_pp failed: error executing CppCompile command (from target @@rules_java++toolchains+remote_java_tools//:filesystem) (cd .../sandbox/darwin-sandbox/1292/execroot/_main && \ exec env - \ APPLE_SDK_PLATFORM=MacOSX \ APPLE_SDK_VERSION_OVERRIDE=15.2 \ BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 \ PATH=/bin:/usr/bin:/usr/local/bin \ XCODE_VERSION_OVERRIDE=16.2.0.16C5032a \ ZERO_AR_DATE=1 \ external/apple_support++apple_cc_configure_extension+local_config_apple_cc/wrapped_clang_pp '-D_FORTIFY_SOURCE=1' -fstack-protector -fcolor-diagnostics -Wall -Wthread-safety -Wself-assign -fno-omit-frame-pointer -g0 -O2 -DNDEBUG '-DNS_BLOCK_ASSERTIONS=1' '-std=c++14' '-fdebug-prefix-map=__BAZEL_EXECUTION_ROOT__=.' '-fdebug-prefix-map=__BAZEL_XCODE_DEVELOPER_DIR__=/PLACEHOLDER_DEVELOPER_DIR' -iquote external/rules_java++toolchains+remote_java_tools -iquote bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_java++toolchains+remote_java_tools -Ibazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_java++toolchains+remote_java_tools/_virtual_includes/filesystem -Ibazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_java++toolchains+remote_java_tools/_virtual_includes/blaze_exit_code -Ibazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_java++toolchains+remote_java_tools/_virtual_includes/errors -Ibazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_java++toolchains+remote_java_tools/_virtual_includes/logging -Ibazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_java++toolchains+remote_java_tools/_virtual_includes/strings -Ibazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_java++toolchains+remote_java_tools/_virtual_includes/port -MD -MF bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_java++toolchains+remote_java_tools/_objs/filesystem/file_posix.d -DBLAZE_OPENSOURCE '-frandom-seed=bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_java++toolchains+remote_java_tools/_objs/filesystem/file_posix.o' -isysroot __BAZEL_XCODE_SDKROOT__ -F__BAZEL_XCODE_SDKROOT__/System/Library/Frameworks -F__BAZEL_XCODE_DEVELOPER_DIR__/Platforms/MacOSX.platform/Developer/Library/Frameworks -no-canonical-prefixes -pthread '-Werror=sign-compare' -g0 '-std=c++14' -fno-exceptions '-fvisibility=hidden' '-Werror=reorder' '-Werror=unused-function' '-Werror=return-type' '-Werror=sign-compare' -g0 -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -target arm64-apple-macosx15.2 -c external/rules_java++toolchains+remote_java_tools/java_tools/src/main/cpp/util/file_posix.cc -o bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_java++toolchains+remote_java_tools/_objs/filesystem/file_posix.o) # Configuration: ... # Execution platform: @@platforms//host:host
The text was updated successfully, but these errors were encountered: