Commit 3b29cdba authored by Lukas Piatkowski's avatar Lukas Piatkowski Committed by Facebook GitHub Bot

rust-shed: add secure_utils to the shed

Reviewed By: StanislavGlebik

Differential Revision: D21549859

fbshipit-source-id: 0e143354a60578732ae1eed8c3c71b9f859e3958
parent 19443ec0
...@@ -952,6 +952,7 @@ class CargoBuilder(BuilderBase): ...@@ -952,6 +952,7 @@ class CargoBuilder(BuilderBase):
def run_cargo(self, install_dirs, operation, args=None): def run_cargo(self, install_dirs, operation, args=None):
args = args or [] args = args or []
env = self._compute_env(install_dirs) env = self._compute_env(install_dirs)
self.add_openssl_to_env(env, install_dirs)
# Enable using nightly features with stable compiler # Enable using nightly features with stable compiler
env["RUSTC_BOOTSTRAP"] = "1" env["RUSTC_BOOTSTRAP"] = "1"
cmd = [ cmd = [
...@@ -962,6 +963,17 @@ class CargoBuilder(BuilderBase): ...@@ -962,6 +963,17 @@ class CargoBuilder(BuilderBase):
] + args ] + args
self._run_cmd(cmd, cwd=self.workspace_dir(), env=env) 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): def build_source_dir(self):
return os.path.join(self.build_dir, "source") return os.path.join(self.build_dir, "source")
......
...@@ -25,5 +25,13 @@ tools/rust/ossconfigs = . ...@@ -25,5 +25,13 @@ tools/rust/ossconfigs = .
[dependencies] [dependencies]
fbthrift 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] [dependencies.fb=on]
rust rust
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment