Skip to content

osx support #5154

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

Merged
merged 4 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ build:remote --remote_timeout=7200
# Istio specific Bazel build/test options.
# ========================================

# Enable libc++ and C++20 by default.
build --config=libc++20

# Need for CI image to pickup docker-credential-gcloud, PATH is fixed in rbe-toolchain-* configs.
build:remote-ci --action_env=PATH=/usr/local/google-cloud-sdk/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/llvm/bin

Expand All @@ -25,7 +22,8 @@ build --define path_normalization_by_default=true

# Heap profiler is supported only with gperf tcmalloc, not google tcmalloc.
# See: https://github.com/istio/istio/issues/28233
build --define tcmalloc=gperftools
build:linux --define tcmalloc=gperftools
build:macos --define tcmalloc=disabled
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same - why disable gperftools?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

always fails with following error:

configure: error: in `/private/var/tmp/_bazel_zirain/351f889f26744009d08525dc5ecb1daa/sandbox/darwin-sandbox/371/execroot/io_istio_proxy/bazel-out/darwin_arm64-fastbuild/bin/external/envoy/bazel/foreign_cc/gperftools_build.build_tmpdir':
configure: error: C compiler cannot create executables

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, it's fine but you won't get heap profile and some tools. what does tcmalloc disabled mean? what malloc is it using?

Copy link
Member Author

@zirain zirain Nov 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

envoy has same line, this's a known limitation. https://github.com/envoyproxy/envoy/blob/05457bb047b87f4cc1a25635400ddcaa7fccc923/.bazelrc#L138

I won't encourage anyone use proxy on macos for production, all these line make that easier to develop on macos.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't recall, does linux configuration automatically kick-in?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if not, there must be huge problem.


# Build with embedded V8-based WebAssembly runtime.
build --define wasm=v8
Expand Down Expand Up @@ -67,3 +65,9 @@ build:clang-asan-ci --linkopt=-l:libclang_rt.ubsan_standalone_cxx.a
build:clang-tsan-ci --config=clang-tsan
build:clang-tsan-ci --linkopt=-L/opt/libcxx_tsan/lib
build:clang-tsan-ci --linkopt=-Wl,-rpath,/opt/libcxx_tsan/lib

# get from https://github.com/Homebrew/homebrew-core/blob/master/Formula/e/envoy.rb
build:macos --cxxopt=-Wno-range-loop-analysis
build:macos --host_cxxopt=-Wno-range-loop-analysis
build:macos --cxxopt=-Wno-deprecated-declarations
build:macos --host_cxxopt=-Wno-deprecated-declarations
2 changes: 2 additions & 0 deletions Makefile.core.mk
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ BAZEL_CONFIG_DEV = $(BAZEL_CONFIG)
BAZEL_CONFIG_REL = $(BAZEL_CONFIG) --config=release
BAZEL_CONFIG_ASAN = $(BAZEL_CONFIG) --config=clang-asan-ci
BAZEL_CONFIG_TSAN = $(BAZEL_CONFIG) --config=clang-tsan-ci
# Enable libc++ and C++20 by default.
BAZEL_BUILD_ARGS = --config=libc++20 $(BAZEL_BUILD_ARGS)
endif
ifeq ($(UNAME),Darwin)
BAZEL_CONFIG_DEV = # macOS always links against libc++
Expand Down
2 changes: 1 addition & 1 deletion bazel/extension_config/extensions_build_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ ISTIO_ENABLED_CONTRIB_EXTENSIONS = [
"envoy.filters.sip.router",
"envoy.tls.key_providers.cryptomb",
"envoy.tls.key_providers.qat",
"envoy.network.connection_balance.dlb",
# "envoy.network.connection_balance.dlb",
]

EXTENSIONS = dict([(k,v) for k,v in ENVOY_EXTENSIONS.items() if not k in ISTIO_DISABLED_EXTENSIONS] +
Expand Down