Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #14683: Download the rust compiler when not present on the builder #1864

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions packages.makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ ifeq ($(ARCHI),x86_64)
JDKURL := https://repository.rudder.io/build-dependencies/java/jdk-8u101-linux-x86_64.rpm
endif

PROXY_ENV = $(if $(PROXY), http_proxy=$(PROXY))
# Usage: $(GET) <destination_file> <url> <hash>
PROXY_ENV = $(if $(PROXY), http_proxy=$(PROXY) ftp_proxy=$(PROXY))
# No accept encoding to prevent the webserver form altering the distributed file
# Pass an empty string to skip hash check
# grep 'GET=' */SOURCES/Makefile to patch everywhere
GET=get() { $(PROXY_ENV) curl -s -L -o "$$1.part" "$$2" && { openssl dgst -sha256 "$$1.part" | grep -q "$$3" || { echo "Wrong checksum, aborting"; exit 1; }; } && mv "$$1.part" "$$1"; }; get

RUST_RELEASE = 1.34.0
RUST_PACKAGE = rust-$(RUST_RELEASE)-x86_64-unknown-linux-gnu
RUST_SHA256 = 170647ed41b497dc937a6b2556700210bc4be187b1735029ef9ccf52e2cb5ab8

buildpackage-rpm-common-prep-suse:
# Accept expired GPG Key for zypper on old SLES versions
if [ "${OS}" = "SLES" -a "${OSVERSION}" = "10" ];then echo -e "y\ny" | zypper ref || true;fi
Expand All @@ -48,11 +60,23 @@ buildpackage-rpm-common-prep-suse:
# alternatives doesn't exist on sles11 but it is a rewrite of update-alternatives so this works
ln -s /usr/sbin/update-alternatives /usr/sbin/alternatives || true
if [ "$(JAVAREQUIRES)" = "jdk" ] && [ $$(rpm -qa $(JDKPACKAGE)|wc -l) -eq 0 ]; then wget -q -O /tmp/jdk.rpm $(JDKURL); rpm -ivh /tmp/jdk.rpm; fi
if [ "${OS}" = "SLES" -a \( "${OSVERSION}" = "12" -o "${OSVERSION}" = "15" \) ];then \
$(GET) $(RUST_PACKAGE).tar.gz https://repository.rudder.io/build-dependencies/rust/$(RUST_PACKAGE).tar.gz $(RUST_SHA256) &&\
rm -rf $(RUST_PACKAGE) &&\
tar -xzf $(RUST_PACKAGE).tar.gz &&\
cd $(RUST_PACKAGE) && ./install.sh --components=cargo,rustc,rust-std-x86_64-unknown-linux-gnu ;\
fi

buildpackage-rpm-common-prep-rhel:
# Add basic package to have macros for rpm and be able to know which part of .spec file concerns rhel 5
if [ "${OS}" = "RHEL" -a "${OSVERSION}" = "5" ];then yum -y install buildsys-macros;fi
if [ ! -z "${BUILDREQUIRESRHEL}" ];then yum -y install ${BUILDREQUIRESRHEL};fi
if [ "${OS}" = "RHEL" -a "${OSVERSION}" = "7" ];then \
$(GET) $(RUST_PACKAGE).tar.gz https://repository.rudder.io/build-dependencies/rust/$(RUST_PACKAGE).tar.gz $(RUST_SHA256) &&\
rm -rf $(RUST_PACKAGE) &&\
tar -xzf $(RUST_PACKAGE).tar.gz &&\
cd $(RUST_PACKAGE) && ./install.sh --components=cargo,rustc,rust-std-x86_64-unknown-linux-gnu ;\
fi

buildpackage-rpm-common-prep-aix:
# Dependencies on AIX are currently not managed automatically but installed manually
Expand Down