Skip to content

Commit

Permalink
jom (parallel nmake) build for openssl windows
Browse files Browse the repository at this point in the history
Summary:
X-link: facebookincubator/zstrong#1084

openssl build on windows is slow due to nmake being single threaded

fortunately the Qt developers had the same problem and produced jom - a nmake compatible make that adds the /j<parallelism> flag

add a jom manifest and use it for the openssl build on windows

Reviewed By: bigfootjon

Differential Revision: D66818562

fbshipit-source-id: 88938dbc862da18ae7f75df51aa99bb669aae71a
  • Loading branch information
ahornby authored and facebook-github-bot committed Dec 5, 2024
1 parent bda3295 commit 324a308
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
14 changes: 11 additions & 3 deletions build/fbcode_builder/getdeps/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1165,9 +1165,14 @@ def _build(self, reconfigure) -> None:
perl = typing.cast(str, path_search(env, "perl", "perl"))

make_j_args = []
extra_args = []
if self.build_opts.is_windows():
make = "nmake.exe"
# jom is compatible with nmake, adds the /j argument for parallel build
make = "jom.exe"
make_j_args = ["/j%s" % self.num_jobs]
args = ["VC-WIN64A-masm", "-utf-8"]
# fixes "if multiple CL.EXE write to the same .PDB file, please use /FS"
extra_args = ["/FS"]
elif self.build_opts.is_darwin():
make = "make"
make_j_args = ["-j%s" % self.num_jobs]
Expand Down Expand Up @@ -1200,11 +1205,14 @@ def _build(self, reconfigure) -> None:
"no-unit-test",
"no-tests",
]
+ extra_args
)
# show the config produced
self._run_cmd([perl, "configdata.pm", "--dump"], env=env)
make_build = [make] + make_j_args
self._run_cmd(make_build)
self._run_cmd(make_build, env=env)
make_install = [make, "install_sw", "install_ssldirs"]
self._run_cmd(make_install)
self._run_cmd(make_install, env=env)


class Boost(BuilderBase):
Expand Down
15 changes: 15 additions & 0 deletions build/fbcode_builder/manifests/jom
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# jom is compatible with MSVC nmake, but adds the /j<number of jobs> argment which
# speeds up openssl build a lot
[manifest]
name = jom

# see https://download.qt.io/official_releases/jom/changelog.txt for latest version
[download.os=windows]
url = https://download.qt.io/official_releases/jom/jom_1_1_4.zip
sha256 = d533c1ef49214229681e90196ed2094691e8c4a0a0bef0b2c901debcb562682b

[build.os=windows]
builder = nop

[install.files.os=windows]
. = bin
1 change: 1 addition & 0 deletions build/fbcode_builder/manifests/openssl
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ builder = openssl
subdir = openssl-3.0.15

[dependencies.os=windows]
jom
perl

0 comments on commit 324a308

Please sign in to comment.