Skip to content

Commit

Permalink
Reset to specific tags / revisions
Browse files Browse the repository at this point in the history
This just ensures that the way we manipulate the dependencies' git
repositories is consistent.
  • Loading branch information
Paul Groudas committed Apr 30, 2021
1 parent fc04355 commit c2a07bc
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 9 deletions.
11 changes: 10 additions & 1 deletion mcrouter/scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ set -ex

function die { printf "%s: %s\n" "$0" "$@"; exit 1; }

# Ensures a git repository working tree is set to the specific commit
function gitEnsureTreeish {
# In the case of a commit or tag, this will put the repo into DETACHED HEAD state
git checkout "$1" --
# Ensures that there are edited files in git index or working directory
git reset --hard HEAD
}

[ -n "$1" ] || die "PKG_DIR missing"
[ -n "$2" ] || die "INSTALL_DIR missing"

Expand All @@ -16,8 +24,9 @@ INSTALL_AUX_DIR="$3"
shift $#

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
export SCRIPT_DIR

mkdir -p "$PKG_DIR" "$INSTALL_DIR"
mkdir -p "$PKG_DIR" "$INSTALL_DIR"

if [ -n "$3" ]; then
mkdir -p "$INSTALL_AUX_DIR"
Expand Down
2 changes: 1 addition & 1 deletion mcrouter/scripts/recipes/fbthrift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fi
cd "$PKG_DIR/fbthrift" || die "cd fail"

# Use a known compatible version
git checkout v2021.04.26.00
gitEnsureTreeish v2021.04.26.00

cd "$PKG_DIR/fbthrift/build" || die "cd fbthrift failed"

Expand Down
2 changes: 1 addition & 1 deletion mcrouter/scripts/recipes/fizz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fi
cd "$PKG_DIR/fizz" || die "cd fail"

# Use a known compatible version
git checkout v2021.04.26.00
gitEnsureTreeish v2021.04.26.00

cd "$PKG_DIR/fizz/fizz/" || die "cd fail"

Expand Down
2 changes: 1 addition & 1 deletion mcrouter/scripts/recipes/fmtlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fi
cd "$PKG_DIR/fmt" || die "cd failed"

# Use a known compatible version
git checkout 7.1.3
gitEnsureTreeish 7.1.3

mkdir "$PKG_DIR/fmt/build"
cd "$PKG_DIR/fmt/build" || die "cd fmt failed"
Expand Down
2 changes: 1 addition & 1 deletion mcrouter/scripts/recipes/folly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fi
cd "$PKG_DIR/folly" || die "cd fail"

# Use a known compatible version
git checkout v2021.04.26.00
gitEnsureTreeish v2021.04.26.00

# There is an issue when compiling folly on aarch64 when libunwind is available.
# The build configuration does expose a direct way to avoid using libunwind, and we
Expand Down
2 changes: 1 addition & 1 deletion mcrouter/scripts/recipes/gflags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cd "$PKG_DIR/gflags" || die "cd fail"
# Use a known compatible version
# There hasn't been a release in years, this is just the (currently) most
# recent commit.
git checkout 827c769e5fc98e0f2a34c47cef953cc6328abced
gitEnsureTreeish 827c769e5fc98e0f2a34c47cef953cc6328abced

LDFLAGS="-Wl,-rpath=$INSTALL_DIR/lib,--enable-new-dtags -L$INSTALL_DIR/lib $LDFLAGS" \
CPPFLAGS="-I$INSTALL_DIR/include -DGOOGLE_GLOG_DLL_DECL='' $CPPFLAGS" \
Expand Down
2 changes: 1 addition & 1 deletion mcrouter/scripts/recipes/glog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ cd "$PKG_DIR/glog" || die "cd fail"

# Use a known compatible version
# N.B. More recent versions (v0.5.0.rcx) failed to work with mcrouter.
git reset --hard v0.4.0
gitEnsureTreeish v0.4.0

autoreconf --install
LDFLAGS="-Wl,-rpath=$INSTALL_DIR/lib,--enable-new-dtags -L$INSTALL_DIR/lib $LDFLAGS" \
Expand Down
2 changes: 1 addition & 1 deletion mcrouter/scripts/recipes/wangle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fi
cd "$PKG_DIR/wangle" || die "cd fail"

# Use a known compatible version
git reset --hard v2021.04.26.00
gitEnsureTreeish v2021.04.26.00

cd "$PKG_DIR/wangle/wangle/" || die "cd fail"

Expand Down
2 changes: 1 addition & 1 deletion mcrouter/scripts/recipes/zstd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fi
cd "$PKG_DIR/zstd" || die "cd fail"

# Use a known compatible version
git checkout v1.4.9
gitEnsureTreeish v1.4.9

cmake -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" build/cmake/
make -j "$(nproc)" && make install

0 comments on commit c2a07bc

Please sign in to comment.