mesatee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ms...@apache.org
Subject [incubator-mesatee] branch master updated: Vendor all rust libraries from crates-io (#101)
Date Tue, 26 Nov 2019 22:21:08 GMT
This is an automated email from the ASF dual-hosted git repository.

mssun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mesatee.git


The following commit(s) were added to refs/heads/master by this push:
     new d6a658b  Vendor all rust libraries from crates-io (#101)
d6a658b is described below

commit d6a658b06d4b96a9f8e0f38d5d23c0ba2bb279c5
Author: Mingshen Sun <bob@mssun.me>
AuthorDate: Tue Nov 26 14:21:00 2019 -0800

    Vendor all rust libraries from crates-io (#101)
---
 .gitmodules                     |  4 ++++
 cmake/scripts/setup_cmake_tomls | 14 ++++++++++++++
 third_party/crates-io           |  1 +
 3 files changed, 19 insertions(+)

diff --git a/.gitmodules b/.gitmodules
index a10cca2..ddc62aa 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -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
diff --git a/cmake/scripts/setup_cmake_tomls b/cmake/scripts/setup_cmake_tomls
index 7fe8b59..5f12ccf 100755
--- a/cmake/scripts/setup_cmake_tomls
+++ b/cmake/scripts/setup_cmake_tomls
@@ -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)
 
 
diff --git a/third_party/crates-io b/third_party/crates-io
new file mode 160000
index 0000000..b854818
--- /dev/null
+++ b/third_party/crates-io
@@ -0,0 +1 @@
+Subproject commit b854818487789791549118e038dec9b9eeca7548


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@mesatee.apache.org
For additional commands, e-mail: commits-help@mesatee.apache.org


Mime
View raw message