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:
committed by
Facebook GitHub Bot
parent
67cd5b19f1
commit
f717e5ed41
@@ -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):
|
|||||||
] + 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 = .
|
|||||||
[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
|
||||||
|
Reference in New Issue
Block a user