From 88ada1bdf7c0a3d14f9a283edb350bc50ea902c0 Mon Sep 17 00:00:00 2001 From: Daniel Wong Date: Mon, 27 Feb 2023 20:20:53 -0500 Subject: [PATCH 1/5] Explicitly mark Git repo as safe Workaround for Debian Docker bug. --- .github/workflows/build-cachelib-debian-10.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-cachelib-debian-10.yml b/.github/workflows/build-cachelib-debian-10.yml index 56fb576298..ef62bddaa9 100644 --- a/.github/workflows/build-cachelib-debian-10.yml +++ b/.github/workflows/build-cachelib-debian-10.yml @@ -52,6 +52,9 @@ jobs: g++ - || true - name: "checkout sources" uses: actions/checkout@v2 + - name: "Add Git safe directory" + # Workaround for Docker image bug (GitHub issue #199). + run: git config --system --add safe.directory /__w/CacheLib/CacheLib - name: "Install Prerequisites" run: ./contrib/build.sh -S -B - name: "Test: update-submodules" From 8d1b65fb29f013a0d2458b56acf7887df89ef8b8 Mon Sep 17 00:00:00 2001 From: Daniel Wong Date: Tue, 28 Feb 2023 13:40:52 -0500 Subject: [PATCH 2/5] Pin zstd at 8420502e Pin zstd at commit that fixes cmake error (after 1.5.4) --- contrib/build-package.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/contrib/build-package.sh b/contrib/build-package.sh index 6e7acac5c2..89e64c453c 100755 --- a/contrib/build-package.sh +++ b/contrib/build-package.sh @@ -108,6 +108,7 @@ test "$#" -eq 0 \ external_git_clone= external_git_branch= external_git_tag= +external_git_commit= update_submodules= cmake_custom_params= @@ -175,7 +176,7 @@ case "$1" in REPODIR=cachelib/external/$NAME SRCDIR=$REPODIR/build/cmake external_git_clone=yes - external_git_branch=release + external_git_commit=8420502e if test "$build_tests" = "yes" ; then cmake_custom_params="-DZSTD_BUILD_TESTS=ON" else @@ -307,8 +308,12 @@ if test "$source" ; then fi - # switch to specific branch/tag if needed - if test "$external_git_branch" ; then + # switch to specific branch/tag/commit if needed + if test "$external_git_commit" ; then + ( cd "$REPODIR" \ + && git checkout --force "$external_git_commit" ) \ + || die "failed to checkout commit $external_git_commit in $REPODIR" + elif test "$external_git_branch" ; then ( cd "$REPODIR" \ && git checkout --force "origin/$external_git_branch" ) \ || die "failed to checkout branch $external_git_branch in $REPODIR" From 15bdec37fcd2119b3114bb4ea577c26fd2668c0d Mon Sep 17 00:00:00 2001 From: Daniel Wong Date: Tue, 28 Feb 2023 19:42:16 -0500 Subject: [PATCH 3/5] Incorporate requested changes Used external_git_tag instead, added comments, fixed a typo. --- contrib/build-package.sh | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/contrib/build-package.sh b/contrib/build-package.sh index 89e64c453c..96f11766ea 100755 --- a/contrib/build-package.sh +++ b/contrib/build-package.sh @@ -102,13 +102,12 @@ test "$#" -eq 0 \ && die "missing dependancy name to build. See -h for help" ###################################### -## Check which dependecy was requested +## Check which dependency was requested ###################################### external_git_clone= external_git_branch= external_git_tag= -external_git_commit= update_submodules= cmake_custom_params= @@ -176,7 +175,10 @@ case "$1" in REPODIR=cachelib/external/$NAME SRCDIR=$REPODIR/build/cmake external_git_clone=yes - external_git_commit=8420502e + # Previously, we pinned to release branch. v1.5.4 needed + # CMake >= 3.18, later reverted. While waiting for v1.5.5, + # pin to the fix: https://github.com/facebook/zstd/pull/3510 + external_git_tag=8420502e if test "$build_tests" = "yes" ; then cmake_custom_params="-DZSTD_BUILD_TESTS=ON" else @@ -308,12 +310,9 @@ if test "$source" ; then fi - # switch to specific branch/tag/commit if needed - if test "$external_git_commit" ; then - ( cd "$REPODIR" \ - && git checkout --force "$external_git_commit" ) \ - || die "failed to checkout commit $external_git_commit in $REPODIR" - elif test "$external_git_branch" ; then + # switch to specific branch/tag if needed + # external_git_tag can also be used for commits + if test "$external_git_branch" ; then ( cd "$REPODIR" \ && git checkout --force "origin/$external_git_branch" ) \ || die "failed to checkout branch $external_git_branch in $REPODIR" From 892a74a73d8146b30818eb70b7d8db3543934f30 Mon Sep 17 00:00:00 2001 From: Daniel Wong Date: Wed, 1 Mar 2023 19:53:22 +0000 Subject: [PATCH 4/5] Move commit to L110 as suggested --- contrib/build-package.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/build-package.sh b/contrib/build-package.sh index 96f11766ea..755933bd44 100755 --- a/contrib/build-package.sh +++ b/contrib/build-package.sh @@ -107,6 +107,7 @@ test "$#" -eq 0 \ external_git_clone= external_git_branch= +# external_git_tag can also be used for commit hashes external_git_tag= update_submodules= cmake_custom_params= @@ -311,7 +312,6 @@ if test "$source" ; then # switch to specific branch/tag if needed - # external_git_tag can also be used for commits if test "$external_git_branch" ; then ( cd "$REPODIR" \ && git checkout --force "origin/$external_git_branch" ) \ From c97b8e7c303d890bf2e63f0d1ae8caaeb6902553 Mon Sep 17 00:00:00 2001 From: Daniel Wong Date: Wed, 1 Mar 2023 18:57:08 -0500 Subject: [PATCH 5/5] Use GITHUB_WORKSPACE instead of hardcoding --- .github/workflows/build-cachelib-debian-10.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-cachelib-debian-10.yml b/.github/workflows/build-cachelib-debian-10.yml index ef62bddaa9..7f0ab29a6c 100644 --- a/.github/workflows/build-cachelib-debian-10.yml +++ b/.github/workflows/build-cachelib-debian-10.yml @@ -54,7 +54,7 @@ jobs: uses: actions/checkout@v2 - name: "Add Git safe directory" # Workaround for Docker image bug (GitHub issue #199). - run: git config --system --add safe.directory /__w/CacheLib/CacheLib + run: git config --system --add safe.directory $GITHUB_WORKSPACE - name: "Install Prerequisites" run: ./contrib/build.sh -S -B - name: "Test: update-submodules"