-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
build: switch to libc++ by default #8859
Changes from all commits
4955a37
22bed80
92d06f4
7660ca4
7d43192
43be1d7
12a54de
ec8a5ac
0797cd5
feffa2a
c6b4fe4
86b0f67
1c4b8a7
68c5f0c
98ce9d9
d6ae450
8055bad
90af0f8
849325e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,32 +11,36 @@ export PPROF_PATH=/thirdparty_build/bin/pprof | |
echo "ENVOY_SRCDIR=${ENVOY_SRCDIR}" | ||
|
||
function setup_gcc_toolchain() { | ||
if [[ ! -z "${ENVOY_STDLIB}" && "${ENVOY_STDLIB}" != "libstdc++" ]]; then | ||
echo "gcc toolchain doesn't support ${ENVOY_STDLIB}." | ||
exit 1 | ||
fi | ||
if [[ -z "${ENVOY_RBE}" ]]; then | ||
export CC=gcc | ||
export CXX=g++ | ||
export BAZEL_COMPILER=gcc | ||
echo "$CC/$CXX toolchain configured" | ||
else | ||
export BAZEL_BUILD_OPTIONS="--config=rbe-toolchain-gcc ${BAZEL_BUILD_OPTIONS}" | ||
export BAZEL_BUILD_OPTIONS="--config=remote-gcc ${BAZEL_BUILD_OPTIONS}" | ||
fi | ||
} | ||
|
||
function setup_clang_toolchain() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Q: Is there any way to make this the default in the core .bazelrc options such that someone could disable it and go back to libstdcxx if they want? This would provide consistency across all builds in general, not just CI builds. I'm not sure if there is a good way to do this though? /wait-any There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, I will revise the script. |
||
ENVOY_STDLIB="${ENVOY_STDLIB:-libc++}" | ||
if [[ -z "${ENVOY_RBE}" ]]; then | ||
export BAZEL_BUILD_OPTIONS="--config=clang ${BAZEL_BUILD_OPTIONS}" | ||
else | ||
export BAZEL_BUILD_OPTIONS="--config=rbe-toolchain-clang ${BAZEL_BUILD_OPTIONS}" | ||
fi | ||
echo "clang toolchain configured" | ||
} | ||
|
||
function setup_clang_libcxx_toolchain() { | ||
if [[ -z "${ENVOY_RBE}" ]]; then | ||
export BAZEL_BUILD_OPTIONS="--config=libc++ ${BAZEL_BUILD_OPTIONS}" | ||
if [[ "${ENVOY_STDLIB}" == "libc++" ]]; then | ||
export BAZEL_BUILD_OPTIONS="--config=libc++ ${BAZEL_BUILD_OPTIONS}" | ||
else | ||
export BAZEL_BUILD_OPTIONS="--config=clang ${BAZEL_BUILD_OPTIONS}" | ||
fi | ||
else | ||
export BAZEL_BUILD_OPTIONS="--config=rbe-toolchain-clang-libc++ ${BAZEL_BUILD_OPTIONS}" | ||
if [[ "${ENVOY_STDLIB}" == "libc++" ]]; then | ||
export BAZEL_BUILD_OPTIONS="--config=remote-clang-libc++ ${BAZEL_BUILD_OPTIONS}" | ||
else | ||
export BAZEL_BUILD_OPTIONS="--config=remote-clang ${BAZEL_BUILD_OPTIONS}" | ||
fi | ||
fi | ||
echo "clang toolchain with libc++ configured" | ||
echo "clang toolchain with ${ENVOY_STDLIB} configured" | ||
} | ||
|
||
# Create a fake home. Python site libs tries to do getpwuid(3) if we don't and the CI | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think what I was wondering before is whether it's possible to just have
--config-libc++
be the default?The issue that I have found in the past is that I don't think there is a way to have a default config and then actual have a local config disable it and replace it with something else?
/wait-any
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will recommend having
--config=libc++
inuser.bazelrc
file to make it default. It is possible to override but not easy, partially because toolchains are also defaulted to libstdc++.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, should we document that somewhere?