1
0
mirror of https://github.com/facebook/proxygen.git synced 2025-08-05 19:55:47 +03:00

rust-shed: add secure_utils to the shed

Reviewed By: StanislavGlebik

Differential Revision: D21549859

fbshipit-source-id: 0e143354a60578732ae1eed8c3c71b9f859e3958
This commit is contained in:
Lukas Piatkowski
2020-06-03 13:05:44 -07:00
committed by Facebook GitHub Bot
parent 67cd5b19f1
commit f717e5ed41
2 changed files with 20 additions and 0 deletions

View File

@@ -952,6 +952,7 @@ class CargoBuilder(BuilderBase):
def run_cargo(self, install_dirs, operation, args=None):
args = args or []
env = self._compute_env(install_dirs)
self.add_openssl_to_env(env, install_dirs)
# Enable using nightly features with stable compiler
env["RUSTC_BOOTSTRAP"] = "1"
cmd = [
@@ -962,6 +963,17 @@ class CargoBuilder(BuilderBase):
] + args
self._run_cmd(cmd, cwd=self.workspace_dir(), env=env)
def add_openssl_to_env(self, env, install_dirs):
openssl_candidates = [d for d in install_dirs if "openssl" in d]
if len(openssl_candidates) > 1:
raise Exception(
"Found more than one candidate for openssl directory: {}.".format(
openssl_candidates
)
)
elif len(openssl_candidates) == 1:
env["OPENSSL_DIR"] = openssl_candidates[0]
def build_source_dir(self):
return os.path.join(self.build_dir, "source")

View File

@@ -25,5 +25,13 @@ tools/rust/ossconfigs = .
[dependencies]
fbthrift
# macOS doesn't expose the openssl api so we need to build our own.
[dependencies.os=darwin]
openssl
# Windows doesn't have openssl, so we get to provide it
[dependencies.os=windows]
openssl
[dependencies.fb=on]
rust