just a simple fix to avoid recompiling protobuf all the time (#12790)
* just a simple fix to avoid recompiling protobuf all the time on our development environments * added quotes * remove bashism
Costa Tsaousis committed
May 2, 2022 at 14:32 UTC
f389f8c7f0f24b3cde2f56cfd8dc771020fbf7d3
1 file changed
+8
netdata-installer.sh
+8
@@ -618,6 +618,13 @@ bundle_protobuf() {
618
619
PROTOBUF_PACKAGE_VERSION="$(cat packaging/protobuf.version)"
620
621
+ if [ -f "${PWD}/externaldeps/protobuf/.version" ] && [ "${PROTOBUF_PACKAGE_VERSION}" = "$(cat "${PWD}/externaldeps/protobuf/.version")" ]
622
+ then
623
+ echo >&2 "Found compiled protobuf, same version, not compiling it again. Remove file '${PWD}/externaldeps/protobuf/.version' to recompile."
624
+ NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS} --with-bundled-protobuf"
625
+ return 0
626
+ fi
627
+
628
tmp="$(mktemp -d -t netdata-protobuf-XXXXXX)"
629
PROTOBUF_PACKAGE_BASENAME="protobuf-cpp-${PROTOBUF_PACKAGE_VERSION}.tar.gz"
630
@@ -629,6 +636,7 @@ bundle_protobuf() {
636
if run tar --no-same-owner -xf "${tmp}/${PROTOBUF_PACKAGE_BASENAME}" -C "${tmp}" &&
637
build_protobuf "${tmp}/protobuf-${PROTOBUF_PACKAGE_VERSION}" &&
638
copy_protobuf "${tmp}/protobuf-${PROTOBUF_PACKAGE_VERSION}" &&
639
+ echo "${PROTOBUF_PACKAGE_VERSION}" >"${PWD}/externaldeps/protobuf/.version" &&
640
rm -rf "${tmp}"; then
641
run_ok "protobuf built and prepared."
642
NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS} --with-bundled-protobuf"