Skip to content

Commit

Permalink
build: with 'release-static' profile
Browse files Browse the repository at this point in the history
update pack_zetasql_parser.sh
  • Loading branch information
aceforeverd committed Sep 14, 2024
1 parent fa247ff commit 1ef7c5b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
5 changes: 1 addition & 4 deletions build_zetasql_parser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fi
echo "build with python: $(python -V), python3: $(python3 -V)"

TARGET='//zetasql/parser/...'
BUILD_ARGV=(--config=static)
BUILD_ARGV=(--config=release-static)

bazel build "$TARGET" "${BUILD_ARGV[@]}"
bazel test "$TARGET" "${BUILD_ARGV[@]}"
Expand All @@ -42,8 +42,5 @@ bazel build "@com_googleapis_googleapis//:all" "${BUILD_ARGV[@]}"
bazel query "@com_google_file_based_test_driver//..." | xargs bazel build "${BUILD_ARGV[@]}"
bazel build "@com_googlesource_code_re2//:re2" "${BUILD_ARGV[@]}"

unset BAZEL_LINKLIBS
unset BAZEL_LINKOPTS

popd
popd
18 changes: 9 additions & 9 deletions pack_zetasql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ install_lib() {
local file
file=$1
local libname
libname=lib$(echo "$file" | tr '/' '_' | sed -e 's/lib//')
libname=lib$(echo "$file" | tr '/' '_' | sed -e 's/lib//' | sed -e 's/\.pic\.a$/.a/')

if [[ "$OSTYPE" == "linux-gnu"* ]]
then
INSTALL_BIN="install"
else
INSTALL_BIN="ginstall"
fi
${INSTALL_BIN} -D "$file" "$ROOT/tmp-lib/$libname"
${INSTALL_BIN} -Dv "$file" "$ROOT/tmp-lib/$libname"
}

install_gen_include_file() {
Expand All @@ -91,21 +91,21 @@ install_gen_include_file() {
else
INSTALL_BIN="ginstall"
fi
${INSTALL_BIN} -D "$file" "$PREFIX/include/$outfile"
${INSTALL_BIN} -Dv "$file" "$PREFIX/include/$outfile"
}

install_external_lib() {
local file
file=$1
local libname
libname=$(basename "$file")
libname=$(basename "$file" | sed -e 's/\.pic\.a$/.a/')
if [[ "$OSTYPE" == "linux-gnu"* ]]
then
INSTALL_BIN="install"
else
INSTALL_BIN="ginstall"
fi
${INSTALL_BIN} -D "$file" "$PREFIX/lib/$libname"
${INSTALL_BIN} -Dv "$file" "$PREFIX/lib/$libname"
}

export -f install_gen_include_file
Expand All @@ -121,7 +121,7 @@ else
fi

pushd bazel-bin/
find zetasql -type f -iname '*.a' -exec bash -c 'install_lib $0' {} \;
find zetasql -type f -iname '*.pic..a' -exec bash -c 'install_lib $0' {} \;

# external lib headers
pushd "$(realpath .)/../../../../../external/com_googlesource_code_re2"
Expand All @@ -140,9 +140,9 @@ popd
pushd external

find icu -type f -iname '*.a' -exec bash -c 'install_external_lib $0' {} \;
find com_googlesource_code_re2 -type f -iname '*.a' -exec bash -c 'install_external_lib $0' {} \;
find com_googleapis_googleapis -type f -iname '*.a' -exec bash -c 'install_external_lib $0' {} \;
find com_google_file_based_test_driver -type f -iname '*.a' -exec bash -c 'install_external_lib $0' {} \;
find com_googlesource_code_re2 -type f -iname '*.pic.a' -exec bash -c 'install_external_lib $0' {} \;
find com_googleapis_googleapis -type f -iname '*.pic.a' -exec bash -c 'install_external_lib $0' {} \;
find com_google_file_based_test_driver -type f -iname '*.pic.a' -exec bash -c 'install_external_lib $0' {} \;

popd

Expand Down

0 comments on commit 1ef7c5b

Please sign in to comment.