Skip to content

Commit

Permalink
Merge pull request #55391 from ClickHouse/backport/23.3/51435
Browse files Browse the repository at this point in the history
Backport #51435 to 23.3: Build artifact with sources with submodules in Darwin special build
  • Loading branch information
alexey-milovidov committed Oct 9, 2023
2 parents 1d50b47 + a23369c commit 4379758
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
13 changes: 10 additions & 3 deletions docker/packager/binary/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,16 @@ ccache_status () {

[ -O /build ] || git config --global --add safe.directory /build

mkdir -p /build/cmake/toolchain/darwin-x86_64
tar xJf /MacOSX11.0.sdk.tar.xz -C /build/cmake/toolchain/darwin-x86_64 --strip-components=1
ln -sf darwin-x86_64 /build/cmake/toolchain/darwin-aarch64
if [ "$EXTRACT_TOOLCHAIN_DARWIN" = "1" ]; then
mkdir -p /build/cmake/toolchain/darwin-x86_64
tar xJf /MacOSX11.0.sdk.tar.xz -C /build/cmake/toolchain/darwin-x86_64 --strip-components=1
ln -sf darwin-x86_64 /build/cmake/toolchain/darwin-aarch64

if [ "$EXPORT_SOURCES_WITH_SUBMODULES" = "1" ]; then
cd /build
tar --exclude-vcs-ignores --exclude-vcs --exclude build --exclude build_docker --exclude debian --exclude .git --exclude .github --exclude .cache --exclude docs --exclude tests/integration -c . | pigz -9 > /output/source_sub.tar.gz
fi
fi

# Uncomment to debug ccache. Don't put ccache log in /output right away, or it
# will be confusingly packed into the "performance" package.
Expand Down
3 changes: 3 additions & 0 deletions docker/packager/packager
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ def parse_env_variables(
cmake_flags.append(
"-DCMAKE_TOOLCHAIN_FILE=/build/cmake/darwin/toolchain-x86_64.cmake"
)
result.append("EXTRACT_TOOLCHAIN_DARWIN=1")
result.append("EXPORT_SOURCES_WITH_SUBMODULES=1")
elif is_cross_darwin_arm:
cc = compiler[: -len(DARWIN_ARM_SUFFIX)]
cmake_flags.append("-DCMAKE_AR:FILEPATH=/cctools/bin/aarch64-apple-darwin-ar")
Expand All @@ -183,6 +185,7 @@ def parse_env_variables(
cmake_flags.append(
"-DCMAKE_TOOLCHAIN_FILE=/build/cmake/darwin/toolchain-aarch64.cmake"
)
result.append("EXTRACT_TOOLCHAIN_DARWIN=1")
elif is_cross_arm:
cc = compiler[: -len(ARM_SUFFIX)]
cmake_flags.append(
Expand Down

0 comments on commit 4379758

Please sign in to comment.