Skip to content

Commit

Permalink
Build Abseil on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
mbautin committed Sep 15, 2023
1 parent b1a2b4f commit c99735b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 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
12 changes: 10 additions & 2 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 @@ -794,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 @@ -804,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 c99735b

Please sign in to comment.