Skip to content

Commit

Permalink
Revert changes to openssl.py; fix brew package installation
Browse files Browse the repository at this point in the history
CI build types: *macos*
  • Loading branch information
mbautin committed Sep 25, 2024
1 parent 09c7fe2 commit 4cb3dd7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
12 changes: 10 additions & 2 deletions build_and_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ if [[ $OSTYPE == darwin* ]]; then
fi

brew_path=$homebrew_prefix/bin/brew
if [[ ! -f $brew_path ]]; then
if [[ -f $brew_path ]]; then
log "Homebrew found at $brew_path"
else
log "Homebrew not found at $brew_path, attempting to install"

/bin/bash -c "$(
Expand All @@ -97,7 +99,13 @@ if [[ $OSTYPE == darwin* ]]; then
log "Homebrew packages explicitly installed by the user:"
"$brew_path" leaves --installed-on-request

homebrew_packages=( install autoconf automake pkg-config )
homebrew_packages=(
autoconf
automake
cmake
libtool
pkg-config
)
log "Installing Homebrew packages"
time ( set -x; "$brew_path" install "${homebrew_packages[@]}" )
log "Homebrew packages installed"
Expand Down
15 changes: 3 additions & 12 deletions python/build_definitions/openssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
from yugabyte_db_thirdparty.build_definition_helpers import * # noqa


ARM64_HOMEBREW_BASH_PATH = '/opt/homebrew/bin/bash'


def use_arm64_bash_in_script(script_path: str) -> None:
with open(script_path) as script_file:
lines = [line.rstrip() for line in script_file]
Expand All @@ -28,7 +25,7 @@ def use_arm64_bash_in_script(script_path: str) -> None:
return
if not lines[0].startswith('#!') and lines[0].endswith('bash'):
return
lines[0] = '#!' + ARM64_HOMEBREW_BASH_PATH
lines[0] = '#!/opt/homebrew/bin/bash'
with open(script_path, 'w') as output_file:
output_file.write('\n'.join(lines) + '\n')

Expand All @@ -52,15 +49,9 @@ def build(self, builder: BuilderInterface) -> None:
common_configure_options = ['shared', 'no-tests', 'enable-fips']
install_path = os.path.join(
builder.fs_layout.tp_installed_common_dir, "lib")
configure_cmd = ['./config'] + common_configure_options
if is_macos_arm64_build():
if os.path.exists(ARM64_HOMEBREW_BASH_PATH):
use_arm64_bash_in_script('config')
else:
log(f"{ARM64_HOMEBREW_BASH_PATH} not found, cannot modify OpenSSL configure script"
" to use it. Using the arch command instead.")
configure_cmd = ['arch', '-arm64'] + configure_cmd

use_arm64_bash_in_script('config')
configure_cmd = ['./config'] + common_configure_options
if not is_macos():
configure_cmd += ['-Wl,-rpath=' + install_path]

Expand Down

0 comments on commit 4cb3dd7

Please sign in to comment.