Skip to content

Commit

Permalink
Build Abseil on macOS
Browse files Browse the repository at this point in the history
CI build types: macos-x86_64
  • Loading branch information
mbautin committed Sep 15, 2023
1 parent 2ac0d79 commit 46c925f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/macos_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -euo pipefail

brew install autoconf automake pkg-config shellcheck
brew install autoconf automake pkg-config shellcheck bazelisk
dirs=( /opt/yb-build/{thirdparty,brew,tmp} )
sudo mkdir -p "${dirs[@]}"
sudo chmod 777 "${dirs[@]}"
Expand Down
15 changes: 12 additions & 3 deletions python/yugabyte_db_thirdparty/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
YB_THIRDPARTY_DIR,
add_path_entry,
shlex_join,
which_executable,
)
from yugabyte_db_thirdparty.file_system_layout import FileSystemLayout
from yugabyte_db_thirdparty import file_system_layout
Expand Down Expand Up @@ -372,8 +373,9 @@ def populate_dependencies(self) -> None:
['libunistring', 'gettext'] if is_macos() else []
) + [
'ncurses',
'abseil',
] + (
[] if is_macos() else ['libkeyutils', 'libverto', 'abseil', 'tcmalloc']
[] if is_macos() else ['libkeyutils', 'libverto', 'tcmalloc']
) + [
'libedit',
'icu4c',
Expand Down Expand Up @@ -793,8 +795,15 @@ def build_with_bazel(
should_clean: bool = True,
targets: List[str] = []) -> None:
log_prefix = self.log_prefix(dep)
bazel_path = which_executable('bazel')
if not bazel_path:
bazel_path = which_executable('bazelisk')
if not bazel_path:
raise IOError("Could not find bazel or bazelisk executable")
log("Using bazelisk wrapper instead of bazel: %s", bazel_path)

if should_clean:
self.log_output(log_prefix, ['bazel', 'clean', '--expunge'])
self.log_output(log_prefix, [bazel_path, 'clean', '--expunge'])

# Need to remove the space after isystem so replacing the space separators with colons
# works properly.
Expand All @@ -803,7 +812,7 @@ def build_with_bazel(
bazel_linkopts = os.environ["LDFLAGS"].replace(" ", ":")

# Build without curses for more readable build output.
build_command = ["bazel", "build", "--curses=no"]
build_command = [bazel_path, "build", "--curses=no"]
if verbose_output:
build_command.append("--subcommands")
build_command += ["--action_env", f"BAZEL_CXXOPTS={bazel_cxxopts}"]
Expand Down

0 comments on commit 46c925f

Please sign in to comment.