Skip to content
Permalink
Browse files

Vendor all rust libraries from crates-io (#101)

  • Loading branch information
mssun committed Nov 26, 2019
1 parent 410e3dc commit d6a658b06d4b96a9f8e0f38d5d23c0ba2bb279c5
Showing with 19 additions and 0 deletions.
  1. +4 −0 .gitmodules
  2. +14 −0 cmake/scripts/setup_cmake_tomls
  3. +1 −0 third_party/crates-io
@@ -9,3 +9,7 @@
path = third_party/mesapy
url = https://github.com/mesalock-linux/mesapy.git
branch = sgx
[submodule "third_party/crates-io"]
path = third_party/crates-io
url = https://github.com/mesalock-linux/crates-io.git
ignore = dirty
@@ -71,6 +71,19 @@ def setup_cargo_for_sgx(root_dir, build_dir):
exec_cmd(cmd)


def setup_cargo_for_unix(root_dir, build_dir):
"""setup cargo related files for sgx"""
third_party_dir = os.path.join(root_dir, 'third_party')
for target in ["unix_app", "sgx_untrusted_lib", "sgx_untrusted_app"]:
cmd = r'''mkdir -p {build_dir}/cmake_tomls/{target}/.cargo \
&& cp -f {third_party_dir}/crates-io/Cargo.lock {build_dir}/cmake_tomls/{target}/Cargo.lock \
&& cp -f {third_party_dir}/crates-io/config {build_dir}/cmake_tomls/{target}/.cargo/config \
&& sed -i 's/directory = "vendor"/directory = "third_party\/crates-io\/vendor"/' \
{build_dir}/cmake_tomls/{target}/.cargo/config'''
cmd = cmd.format(build_dir=build_dir, third_party_dir=third_party_dir, target=target)
exec_cmd(cmd)


def main():
"""setup tomls for cmake"""
if len(sys.argv) != 3:
@@ -80,6 +93,7 @@ def main():
build_dir = sys.argv[2]

create_symlinks(root_dir, build_dir)
setup_cargo_for_unix(root_dir, build_dir)
setup_cargo_for_sgx(root_dir, build_dir)


Submodule crates-io added at b85481

0 comments on commit d6a658b

Please sign in to comment.
You can’t perform that action at this time.