From 9992a031196322e629b0a882f69d72e7d98c16d7 Mon Sep 17 00:00:00 2001 From: Chad Austin Date: Thu, 3 Feb 2022 14:59:58 -0800 Subject: [PATCH] upgrade boost to 1.78.0 Summary: Boost 1.69 does not build on Fedora 35, so upgrade to Boost 1.78. Reviewed By: ahornby Differential Revision: D33855670 fbshipit-source-id: 85469a835a1dab1a7d5222413b1f1349bdcff280 --- build/fbcode_builder/getdeps.py | 2 +- build/fbcode_builder/getdeps/builder.py | 7 +++++-- build/fbcode_builder/getdeps/manifest.py | 5 ++++- build/fbcode_builder/manifests/boost | 20 +++++++++++++++----- build/fbcode_builder/manifests/folly | 1 + 5 files changed, 26 insertions(+), 9 deletions(-) diff --git a/build/fbcode_builder/getdeps.py b/build/fbcode_builder/getdeps.py index b7610d74f..647513fa5 100755 --- a/build/fbcode_builder/getdeps.py +++ b/build/fbcode_builder/getdeps.py @@ -947,7 +947,7 @@ jobs: # https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/ out.write(" - name: Export boost environment\n") out.write( - ' run: "echo BOOST_ROOT=%BOOST_ROOT_1_69_0% >> %GITHUB_ENV%"\n' + ' run: "echo BOOST_ROOT=%BOOST_ROOT_1_78_0% >> %GITHUB_ENV%"\n' ) out.write(" shell: cmd\n") diff --git a/build/fbcode_builder/getdeps/builder.py b/build/fbcode_builder/getdeps/builder.py index e97c68e46..c6bbbd656 100644 --- a/build/fbcode_builder/getdeps/builder.py +++ b/build/fbcode_builder/getdeps/builder.py @@ -984,14 +984,17 @@ class Boost(BuilderBase): args.append("--user-config=%s" % user_config) for link in linkage: + bootstrap_args = self.manifest.get_section_as_args( + "bootstrap.args", self.ctx + ) if self.build_opts.is_windows(): bootstrap = os.path.join(self.src_dir, "bootstrap.bat") - self._run_cmd([bootstrap], cwd=self.src_dir, env=env) + self._run_cmd([bootstrap] + bootstrap_args, cwd=self.src_dir, env=env) args += ["address-model=64"] else: bootstrap = os.path.join(self.src_dir, "bootstrap.sh") self._run_cmd( - [bootstrap, "--prefix=%s" % self.inst_dir], + [bootstrap, "--prefix=%s" % self.inst_dir] + bootstrap_args, cwd=self.src_dir, env=env, ) diff --git a/build/fbcode_builder/getdeps/manifest.py b/build/fbcode_builder/getdeps/manifest.py index 8bff37eb9..99e848f7d 100644 --- a/build/fbcode_builder/getdeps/manifest.py +++ b/build/fbcode_builder/getdeps/manifest.py @@ -6,6 +6,7 @@ import configparser import io import os +from typing import List from .builder import ( AutoconfBuilder, @@ -81,6 +82,7 @@ SCHEMA = { "rpms": {"optional_section": True}, "debs": {"optional_section": True}, "preinstalled.env": {"optional_section": True}, + "bootstrap.args": {"optional_section": True}, "b2.args": {"optional_section": True}, "make.build_args": {"optional_section": True}, "make.install_args": {"optional_section": True}, @@ -101,6 +103,7 @@ ALLOWED_EXPR_SECTIONS = [ "dependencies", "make.build_args", "make.install_args", + "bootstrap.args", "b2.args", "download", "git", @@ -259,7 +262,7 @@ class ManifestParser(object): return dep_list - def get_section_as_args(self, section, ctx=None): + def get_section_as_args(self, section, ctx=None) -> List[str]: """Intended for use with the make.[build_args/install_args] and autoconf.args sections, this method collects the entries and returns an array of strings. diff --git a/build/fbcode_builder/manifests/boost b/build/fbcode_builder/manifests/boost index 490c0c385..b9ab0bf22 100644 --- a/build/fbcode_builder/manifests/boost +++ b/build/fbcode_builder/manifests/boost @@ -2,15 +2,15 @@ name = boost [download.not(os=windows)] -url = https://versaweb.dl.sourceforge.net/project/boost/boost/1.69.0/boost_1_69_0.tar.bz2 -sha256 = 8f32d4617390d1c2d16f26a27ab60d97807b35440d45891fa340fc2648b04406 +url = https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.tar.gz +sha256 = 94ced8b72956591c4775ae2207a9763d3600b30d9d7446562c552f0a14a63be7 [download.os=windows] -url = https://versaweb.dl.sourceforge.net/project/boost/boost/1.69.0/boost_1_69_0.zip -sha256 = d074bcbcc0501c4917b965fc890e303ee70d8b01ff5712bae4a6c54f2b6b4e52 +url = https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.zip +sha256 = f22143b5528e081123c3c5ed437e92f648fe69748e95fa6e2bd41484e2986cc3 [preinstalled.env] -BOOST_ROOT_1_69_0 +BOOST_ROOT_1_78_0 [debs] libboost-all-dev @@ -86,5 +86,15 @@ job_weight_mib = 512 --with-type_erasure --with-wave +[bootstrap.args.os=darwin] +# Not really gcc, but CI puts a broken clang in the PATH, and saying gcc +# here selects the correct one from Xcode. +--with-toolset=gcc + +[b2.args.os=linux] +# RHEL hardened gcc is not compatible with PCH +# https://bugzilla.redhat.com/show_bug.cgi?id=1806545 +pch=off + [b2.args.os=darwin] toolset=clang diff --git a/build/fbcode_builder/manifests/folly b/build/fbcode_builder/manifests/folly index 7bb4e240f..a866443a6 100644 --- a/build/fbcode_builder/manifests/folly +++ b/build/fbcode_builder/manifests/folly @@ -51,6 +51,7 @@ fbcode/folly = folly [cmake.defines] BUILD_SHARED_LIBS=OFF +BOOST_LINK_STATIC=ON [cmake.defines.test=on] BUILD_TESTS=ON