You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@teaclave.apache.org by GitBox <gi...@apache.org> on 2022/02/03 08:48:06 UTC

[GitHub] [incubator-teaclave] qinkunbao opened a new pull request #609: fix ide scripts; users can run ide.sh from any cwd

qinkunbao opened a new pull request #609:
URL: https://github.com/apache/incubator-teaclave/pull/609


   ## Description
   fix ide scripts; users can run ide.sh from any cwd
   
   
   ## Type of change (select or add applied and delete the others)
   
   - [x] Bug fix (non-breaking change which fixes an issue)
   - [ ] New feature (non-breaking change which adds functionality)
   - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
   - [ ] API change with a documentation update
   - [ ] Additional test coverage
   - [ ] Code cleanup or just sync with upstream third-party crates
   
   ## How has this been tested?
   
   ## Checklist
   
   - [ ] Fork the repo and create your branch from `master`.
   - [ ] If you've added code that should be tested, add tests.
   - [ ] If you've changed APIs, update the documentation.
   - [ ] Ensure the tests pass (see CI results).
   - [ ] Make sure your code lints/format.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-teaclave] qinkunbao commented on a change in pull request #609: fix ide scripts; users can run ide.sh from any cwd

Posted by GitBox <gi...@apache.org>.
qinkunbao commented on a change in pull request #609:
URL: https://github.com/apache/incubator-teaclave/pull/609#discussion_r798996523



##########
File path: scripts/ide.sh
##########
@@ -17,20 +17,21 @@
 # specific language governing permissions and limitations
 # under the License.
 
-TRUSTED_TOML="cmake/tomls/Cargo.sgx_trusted_lib.toml"
-UNTRUSTED_TOML="cmake/tomls/Cargo.sgx_untrusted_app.toml"
+script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)

Review comment:
       Some bash scripts under the `cmake/scripts` folder do not the following the convention.
   
   For example,
   
   https://github.com/apache/incubator-teaclave/blob/c09805e998174034e491e1b46258b7308dc0789d/cmake/scripts/sgx_link_sign.sh#L35-L38
   https://github.com/apache/incubator-teaclave/blob/c09805e998174034e491e1b46258b7308dc0789d/cmake/scripts/gen_enclave_sig.sh#L30
   
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-teaclave] mssun commented on a change in pull request #609: fix ide scripts; users can run ide.sh from any cwd

Posted by GitBox <gi...@apache.org>.
mssun commented on a change in pull request #609:
URL: https://github.com/apache/incubator-teaclave/pull/609#discussion_r798837891



##########
File path: scripts/ide.sh
##########
@@ -17,20 +17,21 @@
 # specific language governing permissions and limitations
 # under the License.
 
-TRUSTED_TOML="cmake/tomls/Cargo.sgx_trusted_lib.toml"
-UNTRUSTED_TOML="cmake/tomls/Cargo.sgx_untrusted_app.toml"
+script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)

Review comment:
       Can we use ALL_CAPS for these variables?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-teaclave] qinkunbao commented on a change in pull request #609: fix ide scripts; users can run ide.sh from any cwd

Posted by GitBox <gi...@apache.org>.
qinkunbao commented on a change in pull request #609:
URL: https://github.com/apache/incubator-teaclave/pull/609#discussion_r798992927



##########
File path: scripts/ide.sh
##########
@@ -17,20 +17,21 @@
 # specific language governing permissions and limitations
 # under the License.
 
-TRUSTED_TOML="cmake/tomls/Cargo.sgx_trusted_lib.toml"
-UNTRUSTED_TOML="cmake/tomls/Cargo.sgx_untrusted_app.toml"
+script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)

Review comment:
       > https://stackoverflow.com/questions/673055/correct-bash-and-shell-script-variable-capitalization @qinkunbao please read and see if capitalization is needed
   
   Thanks for the information. It looks like variables like `TRUSTED_TOML` and `UNTRUSTED_TOML` in this shell script should be the lower case as well, according to the convention.
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-teaclave] mssun merged pull request #609: fix ide scripts; users can run ide.sh from any cwd

Posted by GitBox <gi...@apache.org>.
mssun merged pull request #609:
URL: https://github.com/apache/incubator-teaclave/pull/609


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-teaclave] dingelish commented on a change in pull request #609: fix ide scripts; users can run ide.sh from any cwd

Posted by GitBox <gi...@apache.org>.
dingelish commented on a change in pull request #609:
URL: https://github.com/apache/incubator-teaclave/pull/609#discussion_r798856639



##########
File path: scripts/ide.sh
##########
@@ -17,20 +17,21 @@
 # specific language governing permissions and limitations
 # under the License.
 
-TRUSTED_TOML="cmake/tomls/Cargo.sgx_trusted_lib.toml"
-UNTRUSTED_TOML="cmake/tomls/Cargo.sgx_untrusted_app.toml"
+script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)

Review comment:
       https://stackoverflow.com/questions/673055/correct-bash-and-shell-script-variable-capitalization @qinkunbao please read and see if capitalization is needed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-teaclave] mssun commented on a change in pull request #609: fix ide scripts; users can run ide.sh from any cwd

Posted by GitBox <gi...@apache.org>.
mssun commented on a change in pull request #609:
URL: https://github.com/apache/incubator-teaclave/pull/609#discussion_r798959157



##########
File path: scripts/ide.sh
##########
@@ -17,20 +17,21 @@
 # specific language governing permissions and limitations
 # under the License.
 
-TRUSTED_TOML="cmake/tomls/Cargo.sgx_trusted_lib.toml"
-UNTRUSTED_TOML="cmake/tomls/Cargo.sgx_untrusted_app.toml"
+script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)

Review comment:
       Do we have a shell style guides for reference? I found one: https://google.github.io/styleguide/shellguide.html. If it is worth to follow, we can put it into our docs.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-teaclave] bigdata-memory commented on a change in pull request #609: fix ide scripts; users can run ide.sh from any cwd

Posted by GitBox <gi...@apache.org>.
bigdata-memory commented on a change in pull request #609:
URL: https://github.com/apache/incubator-teaclave/pull/609#discussion_r799721752



##########
File path: scripts/ide.sh
##########
@@ -17,50 +17,51 @@
 # specific language governing permissions and limitations
 # under the License.
 
-TRUSTED_TOML="cmake/tomls/Cargo.sgx_trusted_lib.toml"
-UNTRUSTED_TOML="cmake/tomls/Cargo.sgx_untrusted_app.toml"
-TOML_DEST="Cargo.toml"
+script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
+teaclave_root=${script_dir}/..
 
-TRUSTED_LOCK="third_party/crates-sgx/Cargo.lock"
-UNTRUSTED_LOCK="third_party/crates-io/Cargo.lock"
-LOCK_DEST="Cargo.lock"
+trusted_toml="${teaclave_root}/cmake/tomls/Cargo.sgx_trusted_lib.toml"
+untrusted_toml="${teaclave_root}/cmake/tomls/Cargo.sgx_untrusted_app.toml"
+toml_dest="Cargo.toml"
 
-TRUSTED_CONFIG="third_party/crates-sgx/config"
-UNTRUSTED_CONFIG="third_party/crates-io/config"
-CONFIG_DEST=".cargo/config"
+trusted_lock="${teaclave_root}/third_party/crates-sgx/Cargo.lock"
+untrusted_lock="${teaclave_root}/third_party/crates-io/Cargo.lock"
+lock_dest="Cargo.lock"
+
+trusted_config="${teaclave_root}/third_party/crates-sgx/config"
+untrusted_config="${teaclave_root}/third_party/crates-io/config"
+config_dest=".cargo/config"
 
-script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
-teaclave_root=${script_dir}/..
 
 copy() {
     # $1: TOML
     # $2: LOCK
     # $3: CONFIG
-    mkdir ${teaclave_root}/.cargo
-    cp $1 ${teaclave_root}/${TOML_DEST}
-    cp $2 ${teaclave_root}/${LOCK_DEST}
-    cp $3 ${teaclave_root}/${CONFIG_DEST}
+    mkdir "${teaclave_root}"/.cargo
+    cp "$1" "${teaclave_root}"/${toml_dest}

Review comment:
       I could be more readable if assign a new variable name for this first argument. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-teaclave] mssun commented on a change in pull request #609: fix ide scripts; users can run ide.sh from any cwd

Posted by GitBox <gi...@apache.org>.
mssun commented on a change in pull request #609:
URL: https://github.com/apache/incubator-teaclave/pull/609#discussion_r798998341



##########
File path: scripts/ide.sh
##########
@@ -17,20 +17,21 @@
 # specific language governing permissions and limitations
 # under the License.
 
-TRUSTED_TOML="cmake/tomls/Cargo.sgx_trusted_lib.toml"
-UNTRUSTED_TOML="cmake/tomls/Cargo.sgx_untrusted_app.toml"
+script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)

Review comment:
       > Some bash scripts under the `cmake/scripts` folder do not the following the convention.
   > 
   > For example,
   > 
   > https://github.com/apache/incubator-teaclave/blob/c09805e998174034e491e1b46258b7308dc0789d/cmake/scripts/sgx_link_sign.sh#L35-L38
   > 
   > 
   > https://github.com/apache/incubator-teaclave/blob/c09805e998174034e491e1b46258b7308dc0789d/cmake/scripts/gen_enclave_sig.sh#L30
   
   Don't worry. We can improve this gradually. You can crate a new issue to track this legacy code style issue.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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