Skip to content

Commit f227d9f

Browse files
authored
Merge pull request #6 from ORNL/1633-refactor-protobuf-use-wget-in-place-of-clone
refactor: replace clone of protobuf with wget package download.
2 parents dc593fc + af88543 commit f227d9f

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

scripts/dependency_install_functions.sh

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -205,16 +205,22 @@ install_protobuf() {
205205
# sudo required because of egg file
206206
"$SUDO_CMD" rm -rf "${PROJECT_ROOT}/external/protobuf"
207207
fi
208-
# Here we are using clone instead of submodule update, because submodule
209-
# requires the .git folder exist and the current folder be considered a repo
210-
# this creates problems in docker because each time a commit is made the
211-
# .git folder contents are changed causing a fresh rebuild of all containers
212-
git clone "https://github.com/protocolbuffers/protobuf.git" \
213-
"${PROJECT_ROOT}/external/protobuf"
214208

209+
# History
210+
#
211+
# 1. Here we were using clone instead of submodule update, because
212+
# submodule requires the .git folder exist and the current folder be
213+
# considered a repo this creates problems in docker because each time a
214+
# commit is made the .git folder contents are changed causing a fresh
215+
# rebuild of all containers.
216+
# 2. Clone was dropped in favor of wget due to
217+
# download times taking to long as well as the disk space used to pull in
218+
# the git repositories history which is not needed.
219+
220+
wget "https://github.com/protocolbuffers/protobuf/releases/download/v${DATAFED_PROTOBUF_VERSION}/protobuf-${DATAFED_PROTOBUF_VERSION}.tar.gz"
221+
mkdir -p "${PROJECT_ROOT}/external/protobuf"
222+
tar -xvzf "protobuf-${DATAFED_PROTOBUF_VERSION}.tar.gz" -C "${PROJECT_ROOT}/external/protobuf" --strip-components=1
215223
cd "${PROJECT_ROOT}/external/protobuf"
216-
git checkout "v${DATAFED_PROTOBUF_VERSION}"
217-
git submodule update --init --recursive
218224
# Build static library, cannot build shared library at same time apparently
219225
# there cannot be a shared libsodium file in the
220226
# DATAFED_DEPENDENCIES_INSTALL_PREFIX if you want to have everything static

0 commit comments

Comments
 (0)