Repository: aurora Updated Branches: refs/heads/master 86761e81e -> 7b1e8484a
Improve the isolation in the thrift build. This improves the isolation of the thrift build by building a local pinned bison dep. For one, this gets thrift 0.9.1 building on Arch Linux, a rolling release that is otherwise too modern in its libs to successfully build thrift 0.9.1. Additionally, this change knocks out the checksumming TODO and now checks all downloaded tarballs meet their expected hashes. The hashes were generated locally after checking the sha1's where available. Testing Done: I can now run `./build-support/jenkins/build.sh` green locally. I also got a hold of an OSX 10.10.5 box and was able to run `./build-support/jenkins/build.sh` green on it using this change. Reviewed at https://reviews.apache.org/r/40323/ Project: http://git-wip-us.apache.org/repos/asf/aurora/repo Commit: http://git-wip-us.apache.org/repos/asf/aurora/commit/7b1e8484 Tree: http://git-wip-us.apache.org/repos/asf/aurora/tree/7b1e8484 Diff: http://git-wip-us.apache.org/repos/asf/aurora/diff/7b1e8484 Branch: refs/heads/master Commit: 7b1e8484a854467036174a6991d0ba01c943000e Parents: 86761e8 Author: John Sirois <[email protected]> Authored: Tue Nov 17 07:27:50 2015 -0800 Committer: Bill Farner <[email protected]> Committed: Tue Nov 17 07:27:50 2015 -0800 ---------------------------------------------------------------------- build-support/thrift/.gitignore | 4 +--- build-support/thrift/Makefile | 28 ++++++++++++++++++++++------ 2 files changed, 23 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/aurora/blob/7b1e8484/build-support/thrift/.gitignore ---------------------------------------------------------------------- diff --git a/build-support/thrift/.gitignore b/build-support/thrift/.gitignore index ad6155e..9a3adb6 100644 --- a/build-support/thrift/.gitignore +++ b/build-support/thrift/.gitignore @@ -1,3 +1 @@ -thrift-* -target -src/main/gen-java +/thrift-* http://git-wip-us.apache.org/repos/asf/aurora/blob/7b1e8484/build-support/thrift/Makefile ---------------------------------------------------------------------- diff --git a/build-support/thrift/Makefile b/build-support/thrift/Makefile index 51f37a9..11d597d 100644 --- a/build-support/thrift/Makefile +++ b/build-support/thrift/Makefile @@ -13,11 +13,15 @@ THRIFT_VERSION = 0.9.1 THRIFT_DISTNAME = thrift-$(THRIFT_VERSION) THRIFT_URL = https://archive.apache.org/dist/thrift/$(THRIFT_VERSION)/$(THRIFT_DISTNAME).tar.gz -#TODO(zmanji): Verify the MD5 of the downloaded file. +THRIFT_SHA256 = ac175080c8cac567b0331e394f23ac306472c071628396db2850cb00c41b0017 -THRIFT = ./thrift-$(THRIFT_VERSION)/compiler/cpp/thrift +# This patch is documented here: https://issues.apache.org/jira/browse/THRIFT-2386 +THRIFT_PATCH_URL = https://issues.apache.org/jira/secure/attachment/12632477/yylex.patch +THRIFT_PATCH_SHA256 = 70f20b4e5b2e004b8a0d075b80a52750bce5be02ed83efdc60adbc45ec386a6c -CONFIGURE_FLAGS = --disable-dependency-tracking \ +THRIFT = ./$(THRIFT_DISTNAME)/compiler/cpp/thrift +THRIFT_CONFIGURE_FLAGS = \ + --disable-dependency-tracking \ --disable-shared \ --without-c_glib \ --without-cpp \ @@ -38,9 +42,21 @@ CONFIGURE_FLAGS = --disable-dependency-tracking \ all: $(THRIFT) +define calculate_sha256 + openssl dgst -sha256 | cut -d' ' -f2 +endef + $(THRIFT): - curl -s $(THRIFT_URL) | tar zxv - (cd $(THRIFT_DISTNAME) && ./configure $(CONFIGURE_FLAGS) && make -j4) + sha256=$$(curl -s $(THRIFT_URL) | tee $(THRIFT_DISTNAME).tar.gz | $(calculate_sha256)) && \ + [ "$${sha256}" = "$(THRIFT_SHA256)" ] && \ + tar zxvf $(THRIFT_DISTNAME).tar.gz && \ + cd $(THRIFT_DISTNAME) && \ + sha256=$$(curl -s $(THRIFT_PATCH_URL) | tee thrift.patch | $(calculate_sha256)) && \ + [ "$${sha256}" = "$(THRIFT_PATCH_SHA256)" ] && \ + patch -p1 < thrift.patch && \ + ./configure $(THRIFT_CONFIGURE_FLAGS) && \ + make clean && \ + make -j4 clean: - rm -fr $(THRIFT_DISTNAME) + rm -fr $(THRIFT_DISTNAME)*
