You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@teaclave.apache.org by ms...@apache.org on 2020/04/23 01:08:32 UTC

[incubator-teaclave] 02/07: Track edl changes in build.rs

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-teaclave.git

commit a25f02ec9f091bccffac4852beb0e339e28099ba
Author: Mingshen Sun <bo...@mssun.me>
AuthorDate: Wed Apr 22 12:25:13 2020 -0700

    Track edl changes in build.rs
---
 binder/build.rs                                    |  4 +++-
 services/access_control/app/build.rs               |  3 +++
 services/authentication/app/build.rs               |  3 +++
 services/execution/app/build.rs                    |  3 +++
 services/frontend/app/build.rs                     |  3 +++
 services/management/app/build.rs                   |  3 +++
 services/scheduler/app/build.rs                    |  3 +++
 services/storage/app/build.rs                      |  3 +++
 services/utils/service_enclave_utils/src/macros.rs | 17 +++++++++++++++++
 tests/functional/app/build.rs                      |  3 +++
 tests/integration/app/build.rs                     |  3 +++
 tests/unit/app/build.rs                            |  3 +++
 12 files changed, 50 insertions(+), 1 deletion(-)

diff --git a/binder/build.rs b/binder/build.rs
index 4dd8dfc..028b90e 100644
--- a/binder/build.rs
+++ b/binder/build.rs
@@ -29,7 +29,9 @@ fn choose_sgx_dylib(is_sim: bool) {
 
 fn main() {
     let sdk_dir = env::var("SGX_SDK").unwrap_or("/opt/intel/sgxsdk".into());
-    println!("cargo:rerun-if-changed=Enclave.edl");
+    if let Ok(edl_dir) = env::var("TEACLAVE_EDL_DIR") {
+        println!("cargo:rerun-if-changed={}/Enclave_common.edl", edl_dir);
+    }
     println!("cargo:rustc-link-search=native={}/lib64", sdk_dir);
     println!("cargo:rustc-link-lib=static=sgx_uprotected_fs");
 
diff --git a/services/access_control/app/build.rs b/services/access_control/app/build.rs
index dfb54b2..dff52fd 100644
--- a/services/access_control/app/build.rs
+++ b/services/access_control/app/build.rs
@@ -36,6 +36,9 @@ fn main() {
     let out_dir = &PathBuf::from(out_path);
 
     println!("cargo:rustc-link-search=native={}", out_dir.display());
+    if let Ok(edl_dir) = env::var("TEACLAVE_EDL_DIR") {
+        println!("cargo:rerun-if-changed={}/Enclave_common.edl", edl_dir);
+    }
     println!("cargo:rustc-link-lib=static=Enclave_common_u");
 
     let is_sim = match env::var("SGX_MODE") {
diff --git a/services/authentication/app/build.rs b/services/authentication/app/build.rs
index dfb54b2..dff52fd 100644
--- a/services/authentication/app/build.rs
+++ b/services/authentication/app/build.rs
@@ -36,6 +36,9 @@ fn main() {
     let out_dir = &PathBuf::from(out_path);
 
     println!("cargo:rustc-link-search=native={}", out_dir.display());
+    if let Ok(edl_dir) = env::var("TEACLAVE_EDL_DIR") {
+        println!("cargo:rerun-if-changed={}/Enclave_common.edl", edl_dir);
+    }
     println!("cargo:rustc-link-lib=static=Enclave_common_u");
 
     let is_sim = match env::var("SGX_MODE") {
diff --git a/services/execution/app/build.rs b/services/execution/app/build.rs
index 3881e6a..168e837 100644
--- a/services/execution/app/build.rs
+++ b/services/execution/app/build.rs
@@ -36,6 +36,9 @@ fn main() {
     let out_dir = &PathBuf::from(out_path);
 
     println!("cargo:rustc-link-search=native={}", out_dir.display());
+    if let Ok(edl_dir) = env::var("TEACLAVE_EDL_DIR") {
+        println!("cargo:rerun-if-changed={}/Enclave_fa.edl", edl_dir);
+    }
     println!("cargo:rustc-link-lib=static=Enclave_fa_u");
 
     let is_sim = match env::var("SGX_MODE") {
diff --git a/services/frontend/app/build.rs b/services/frontend/app/build.rs
index dfb54b2..dff52fd 100644
--- a/services/frontend/app/build.rs
+++ b/services/frontend/app/build.rs
@@ -36,6 +36,9 @@ fn main() {
     let out_dir = &PathBuf::from(out_path);
 
     println!("cargo:rustc-link-search=native={}", out_dir.display());
+    if let Ok(edl_dir) = env::var("TEACLAVE_EDL_DIR") {
+        println!("cargo:rerun-if-changed={}/Enclave_common.edl", edl_dir);
+    }
     println!("cargo:rustc-link-lib=static=Enclave_common_u");
 
     let is_sim = match env::var("SGX_MODE") {
diff --git a/services/management/app/build.rs b/services/management/app/build.rs
index dfb54b2..dff52fd 100644
--- a/services/management/app/build.rs
+++ b/services/management/app/build.rs
@@ -36,6 +36,9 @@ fn main() {
     let out_dir = &PathBuf::from(out_path);
 
     println!("cargo:rustc-link-search=native={}", out_dir.display());
+    if let Ok(edl_dir) = env::var("TEACLAVE_EDL_DIR") {
+        println!("cargo:rerun-if-changed={}/Enclave_common.edl", edl_dir);
+    }
     println!("cargo:rustc-link-lib=static=Enclave_common_u");
 
     let is_sim = match env::var("SGX_MODE") {
diff --git a/services/scheduler/app/build.rs b/services/scheduler/app/build.rs
index dfb54b2..dff52fd 100644
--- a/services/scheduler/app/build.rs
+++ b/services/scheduler/app/build.rs
@@ -36,6 +36,9 @@ fn main() {
     let out_dir = &PathBuf::from(out_path);
 
     println!("cargo:rustc-link-search=native={}", out_dir.display());
+    if let Ok(edl_dir) = env::var("TEACLAVE_EDL_DIR") {
+        println!("cargo:rerun-if-changed={}/Enclave_common.edl", edl_dir);
+    }
     println!("cargo:rustc-link-lib=static=Enclave_common_u");
 
     let is_sim = match env::var("SGX_MODE") {
diff --git a/services/storage/app/build.rs b/services/storage/app/build.rs
index dfb54b2..dff52fd 100644
--- a/services/storage/app/build.rs
+++ b/services/storage/app/build.rs
@@ -36,6 +36,9 @@ fn main() {
     let out_dir = &PathBuf::from(out_path);
 
     println!("cargo:rustc-link-search=native={}", out_dir.display());
+    if let Ok(edl_dir) = env::var("TEACLAVE_EDL_DIR") {
+        println!("cargo:rerun-if-changed={}/Enclave_common.edl", edl_dir);
+    }
     println!("cargo:rustc-link-lib=static=Enclave_common_u");
 
     let is_sim = match env::var("SGX_MODE") {
diff --git a/services/utils/service_enclave_utils/src/macros.rs b/services/utils/service_enclave_utils/src/macros.rs
index ef1877c..6f38324 100644
--- a/services/utils/service_enclave_utils/src/macros.rs
+++ b/services/utils/service_enclave_utils/src/macros.rs
@@ -1,3 +1,20 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
 #[macro_export]
 macro_rules! bail {
     ($err:expr $(,)?) => {
diff --git a/tests/functional/app/build.rs b/tests/functional/app/build.rs
index dfb54b2..dff52fd 100644
--- a/tests/functional/app/build.rs
+++ b/tests/functional/app/build.rs
@@ -36,6 +36,9 @@ fn main() {
     let out_dir = &PathBuf::from(out_path);
 
     println!("cargo:rustc-link-search=native={}", out_dir.display());
+    if let Ok(edl_dir) = env::var("TEACLAVE_EDL_DIR") {
+        println!("cargo:rerun-if-changed={}/Enclave_common.edl", edl_dir);
+    }
     println!("cargo:rustc-link-lib=static=Enclave_common_u");
 
     let is_sim = match env::var("SGX_MODE") {
diff --git a/tests/integration/app/build.rs b/tests/integration/app/build.rs
index dfb54b2..dff52fd 100644
--- a/tests/integration/app/build.rs
+++ b/tests/integration/app/build.rs
@@ -36,6 +36,9 @@ fn main() {
     let out_dir = &PathBuf::from(out_path);
 
     println!("cargo:rustc-link-search=native={}", out_dir.display());
+    if let Ok(edl_dir) = env::var("TEACLAVE_EDL_DIR") {
+        println!("cargo:rerun-if-changed={}/Enclave_common.edl", edl_dir);
+    }
     println!("cargo:rustc-link-lib=static=Enclave_common_u");
 
     let is_sim = match env::var("SGX_MODE") {
diff --git a/tests/unit/app/build.rs b/tests/unit/app/build.rs
index 3881e6a..168e837 100644
--- a/tests/unit/app/build.rs
+++ b/tests/unit/app/build.rs
@@ -36,6 +36,9 @@ fn main() {
     let out_dir = &PathBuf::from(out_path);
 
     println!("cargo:rustc-link-search=native={}", out_dir.display());
+    if let Ok(edl_dir) = env::var("TEACLAVE_EDL_DIR") {
+        println!("cargo:rerun-if-changed={}/Enclave_fa.edl", edl_dir);
+    }
     println!("cargo:rustc-link-lib=static=Enclave_fa_u");
 
     let is_sim = match env::var("SGX_MODE") {


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