Skip to content

Commit c4d5c44

Browse files
ahornbyfacebook-github-bot
authored andcommitted
make openssl install less confusing, align openssl version
Summary: X-link: facebookincubator/fizz#152 X-link: facebook/openzl#1073 On linux getdeps uses system openssl, on macOS we mostly use the homebrew one on github CI. Both of these are openssl3.x, however the fallback build from source version is still set as openssl1.1. This can be confusing, giving the impression getdeps based builds need openssl1.1 * Update the openssl manifest source url to openssl-3.0.15, this version picked to match the ubuntu 22.04 LTS system packages. The other potentially confusing part was that the openssl source tarball was downloaded even when on on a platform like Linux where openssl is always taken from the system packages. * Make the download configurable so that does nothing if satisfied from system packages, and no need to check the cache. Reviewed By: ckwalsh Differential Revision: D66495352 fbshipit-source-id: 4d24bb82bfabe44c7764b819de7f4a05f80daed1
1 parent d3fa776 commit c4d5c44

File tree

3 files changed

+26
-14
lines changed

3 files changed

+26
-14
lines changed

build/fbcode_builder/getdeps.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,12 @@ def run_project_cmd(self, args, loader, manifest):
333333

334334
cache = cache_module.create_cache()
335335
for m in projects:
336+
fetcher = loader.create_fetcher(m)
337+
if isinstance(fetcher, SystemPackageFetcher):
338+
# We are guaranteed that if the fetcher is set to
339+
# SystemPackageFetcher then this item is completely
340+
# satisfied by the appropriate system packages
341+
continue
336342
cached_project = CachedProject(cache, loader, m)
337343
if cached_project.download():
338344
continue
@@ -348,7 +354,6 @@ def run_project_cmd(self, args, loader, manifest):
348354
continue
349355

350356
# We need to fetch the sources
351-
fetcher = loader.create_fetcher(m)
352357
fetcher.update()
353358

354359

build/fbcode_builder/getdeps/manifest.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -430,23 +430,27 @@ def _create_fetcher(self, build_options, ctx):
430430
# We can use the code from fbsource
431431
return ShipitTransformerFetcher(build_options, self.shipit_project)
432432

433+
# If both of these are None, the package can only be coming from
434+
# preinstalled toolchain or system packages
435+
repo_url = self.get_repo_url(ctx)
436+
url = self.get("download", "url", ctx=ctx)
437+
433438
# Can we satisfy this dep with system packages?
434-
if build_options.allow_system_packages:
439+
if (repo_url is None and url is None) or build_options.allow_system_packages:
435440
if self._is_satisfied_by_preinstalled_environment(ctx):
436441
return PreinstalledNopFetcher()
437442

438-
packages = self.get_required_system_packages(ctx)
439-
package_fetcher = SystemPackageFetcher(build_options, packages)
440-
if package_fetcher.packages_are_installed():
441-
return package_fetcher
443+
if build_options.host_type.get_package_manager():
444+
packages = self.get_required_system_packages(ctx)
445+
package_fetcher = SystemPackageFetcher(build_options, packages)
446+
if package_fetcher.packages_are_installed():
447+
return package_fetcher
442448

443-
repo_url = self.get_repo_url(ctx)
444449
if repo_url:
445450
rev = self.get("git", "rev")
446451
depth = self.get("git", "depth")
447452
return GitFetcher(build_options, self, repo_url, rev, depth)
448453

449-
url = self.get("download", "url", ctx=ctx)
450454
if url:
451455
# We need to defer this import until now to avoid triggering
452456
# a cycle when the facebook/__init__.py is loaded.
@@ -464,7 +468,8 @@ def _create_fetcher(self, build_options, ctx):
464468
)
465469

466470
raise KeyError(
467-
"project %s has no fetcher configuration matching %s" % (self.name, ctx)
471+
"project %s has no fetcher configuration or system packages matching %s"
472+
% (self.name, ctx)
468473
)
469474

470475
def create_fetcher(self, build_options, loader, ctx):

build/fbcode_builder/manifests/openssl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ name = openssl
55
libssl-dev
66

77
[homebrew]
8-
openssl@1.1
8+
openssl
99
# on homebrew need the matching curl and ca-
1010

1111
[rpms]
@@ -16,17 +16,19 @@ openssl-libs
1616
[pps]
1717
openssl
1818

19-
[download]
20-
url = https://www.openssl.org/source/openssl-1.1.1l.tar.gz
21-
sha256 = 0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1
19+
# no need to download on the systems where we always use the system libs
20+
[download.not(any(os=linux, os=freebsd))]
21+
# match the openssl version packages in ubuntu LTS folly current supports
22+
url = https://www.openssl.org/source/openssl-3.0.15.tar.gz
23+
sha256 = 23c666d0edf20f14249b3d8f0368acaee9ab585b09e1de82107c66e1f3ec9533
2224

2325
# We use the system openssl on these platforms even without --allow-system-packages
2426
[build.any(os=linux, os=freebsd)]
2527
builder = nop
2628

2729
[build.not(any(os=linux, os=freebsd))]
2830
builder = openssl
29-
subdir = openssl-1.1.1l
31+
subdir = openssl-3.0.15
3032

3133
[dependencies.os=windows]
3234
perl

0 commit comments

Comments
 (0)