You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@teaclave.apache.org by yu...@apache.org on 2023/04/24 03:03:38 UTC

[incubator-teaclave-trustzone-sdk] branch master updated (61b22c5 -> b2fbfb0)

This is an automated email from the ASF dual-hosted git repository.

yuanz pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave-trustzone-sdk.git


    from 61b22c5  Remove Cargo.lock for optee-utee and optee-teec
     new 5198497  setup.sh: fix up whitespace
     new 5147b27  setup.sh: quote variable expansions
     new 5684033  setup.sh: function from any working directory
     new e70763f  CI: use home directory workaround for tests too
     new a2b7bb0  Rework rustup/toolchain installation
     new b2fbfb0  CI: don't do things setup.sh does for us

The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .github/workflows/ci.yml                        | 11 ++--
 .licenserc.yaml                                 |  1 -
 rust-toolchain                                  |  1 -
 examples/aes-rs/Makefile => rust-toolchain.toml | 11 ++--
 setup.sh                                        | 70 +++++++++++++++----------
 5 files changed, 51 insertions(+), 43 deletions(-)
 delete mode 100644 rust-toolchain
 copy examples/aes-rs/Makefile => rust-toolchain.toml (82%)


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


[incubator-teaclave-trustzone-sdk] 06/06: CI: don't do things setup.sh does for us

Posted by yu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

yuanz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave-trustzone-sdk.git

commit b2fbfb008d426349c5ad31bac4857174522dd89c
Author: Thomas Hebb <tc...@meta.com>
AuthorDate: Fri Apr 21 15:44:57 2023 -0400

    CI: don't do things setup.sh does for us
---
 .github/workflows/ci.yml | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index a4f02ed..04f21b5 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -43,9 +43,6 @@ jobs:
 #          source environment &&
 #          make optee &&
 #          . ~/.cargo/env &&
-#          rustup component add rust-src &&
-#          rustup target install aarch64-unknown-linux-gnu arm-unknown-linux-gnueabihf &&
-#          rustup default nightly-2021-09-20 &&
 #          make examples
 #      - name: Run tests and examples
 #        run: |
@@ -70,9 +67,6 @@ jobs:
           source environment &&
           make optee &&
           . ~/.cargo/env &&
-          rustup component add rust-src &&
-          rustup target install aarch64-unknown-linux-gnu arm-unknown-linux-gnueabihf &&
-          rustup default nightly-2021-09-20 &&
           (cd optee-utee && xargo build --target aarch64-unknown-optee-trustzone -vv) &&
           (cd optee-teec && cargo build --target aarch64-unknown-linux-gnu -vv)
   build-and-run-examples-in-OPTEE-repo:


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


[incubator-teaclave-trustzone-sdk] 04/06: CI: use home directory workaround for tests too

Posted by yu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

yuanz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave-trustzone-sdk.git

commit e70763f1f48dd5d28c3e9953eda5195c362cf338
Author: Thomas Hebb <tc...@meta.com>
AuthorDate: Fri Apr 21 18:55:29 2023 -0400

    CI: use home directory workaround for tests too
    
    I'm not entirely sure why this step is needed, but I'm guessing it's a
    result of actions/runner#863 clashing with the Docker container we build
    in[1]. The "build-utee-teec" job already does this; this commit just
    copies it over to the "build-and-run-examples-in-OPTEE-repo" job.
    
    Without the step, the container's preinstalled rustup fails to work
    properly. We'll soon be using the preinstalled version of rustup if it's
    present, so we need this fix to keep the job passing.
    
    [1] https://hub.docker.com/r/teaclave/teaclave-trustzone-sdk-build
---
 .github/workflows/ci.yml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 20191fc..a4f02ed 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -92,6 +92,11 @@ jobs:
           mkdir -p ~/optee-qemuv8 && cd ~/optee-qemuv8 &&
           repo init -u https://github.com/OP-TEE/manifest.git -m qemu_v8.xml &&
           repo sync -j4 --no-clone-bundle
+      - name: Setting up $HOME
+        run: |
+          cp /root/.bashrc $HOME/.bashrc &&
+          ln -sf /root/.rustup ~/.rustup &&
+          ln -sf /root/.cargo ~/.cargo
       - name: Build images and run tests
         run: |
           apt update && apt install libslirp-dev -y


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


[incubator-teaclave-trustzone-sdk] 03/06: setup.sh: function from any working directory

Posted by yu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

yuanz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave-trustzone-sdk.git

commit 56840333edbb1f027e547689d3be97a493c8b759
Author: Thomas Hebb <tc...@meta.com>
AuthorDate: Fri Apr 21 14:53:03 2023 -0400

    setup.sh: function from any working directory
    
    All the commands in this script assume they're run from the project
    root, but we don't enforce that. Fix it by changing to the script's
    directory before doing anything else.
---
 setup.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/setup.sh b/setup.sh
index ff3265e..4f8586a 100755
--- a/setup.sh
+++ b/setup.sh
@@ -19,6 +19,10 @@
 
 set -xe
 
+##########################################
+# move to project root
+cd "$(dirname "$0")"
+
 ##########################################
 # install Rust and select a proper version
 curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly-2021-09-20


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


[incubator-teaclave-trustzone-sdk] 05/06: Rework rustup/toolchain installation

Posted by yu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

yuanz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave-trustzone-sdk.git

commit a2b7bb078e14da856b382bdcbe6dcd8590032331
Author: Thomas Hebb <tc...@meta.com>
AuthorDate: Fri Apr 21 15:32:33 2023 -0400

    Rework rustup/toolchain installation
    
    Migrate "rust-toolchain", which sets a rustup toolchain override for the
    directory, to the newer "rust-toolchain.toml" format[1] and rewrite the
    toolchain-related logic in setup.sh. This has several benefits:
    
     - If the user already has rustup installed, we won't run the
       installation script again. That prevents us from messing with
       environments that set the rustup $PATH in a non-default way.
     - We no longer change rustup's system-wide default toolchain, which
       similarly prevents us from messing with the user's environment.
     - Thanks to the expanded capabilities of rust-toolchain.toml, users who
       build without first running "setup.sh" will get the components and
       targets they need in addition to the toolchain itself.
     - We now have a single source of truth for our preferred toolchain.
       setup.sh now just installs whatever's in rust-toolchain.toml instead
       of hardcoding a toolchain name.
    
    [1] https://rust-lang.github.io/rustup/overrides.html#the-toolchain-file
---
 .licenserc.yaml                        |  1 -
 rust-toolchain                         |  1 -
 .licenserc.yaml => rust-toolchain.toml | 24 +++++-------------------
 setup.sh                               | 22 +++++++++++++++-------
 4 files changed, 20 insertions(+), 28 deletions(-)

diff --git a/.licenserc.yaml b/.licenserc.yaml
index ccce5cc..c65f735 100644
--- a/.licenserc.yaml
+++ b/.licenserc.yaml
@@ -26,7 +26,6 @@ header:
     - '**/*.md'
     - 'LICENSE'
     - 'NOTICE'
-    - 'rust-toolchain'
     - '**/Cargo.lock'
     - '**/*.lds'
     - 'aarch64-unknown-optee-trustzone.json'
diff --git a/rust-toolchain b/rust-toolchain
deleted file mode 100644
index 513fbad..0000000
--- a/rust-toolchain
+++ /dev/null
@@ -1 +0,0 @@
-nightly-2021-09-20
diff --git a/.licenserc.yaml b/rust-toolchain.toml
similarity index 64%
copy from .licenserc.yaml
copy to rust-toolchain.toml
index ccce5cc..d482968 100644
--- a/.licenserc.yaml
+++ b/rust-toolchain.toml
@@ -15,23 +15,9 @@
 # specific language governing permissions and limitations
 # under the License.
 
-header:
-  license:
-    spdx-id: Apache-2.0
-    copyright-owner: Apache Software Foundation
+# Toolchain override for rustup
 
-  paths-ignore:
-    - 'dist'
-    - 'licenses'
-    - '**/*.md'
-    - 'LICENSE'
-    - 'NOTICE'
-    - 'rust-toolchain'
-    - '**/Cargo.lock'
-    - '**/*.lds'
-    - 'aarch64-unknown-optee-trustzone.json'
-    - 'arm-unknown-optee-trustzone.json'
-    - 'KEYS'
-    - 'DISCLAIMER-WIP'
-    - '.gitmodules'
-    - 'examples/tls_server-rs/ta/test-ca/**'
+[toolchain]
+channel = "nightly-2021-09-20"
+components = ["rust-src"]
+targets = ["aarch64-unknown-linux-gnu", "arm-unknown-linux-gnueabihf"]
diff --git a/setup.sh b/setup.sh
index 4f8586a..50030b9 100755
--- a/setup.sh
+++ b/setup.sh
@@ -24,15 +24,23 @@ set -xe
 cd "$(dirname "$0")"
 
 ##########################################
-# install Rust and select a proper version
-curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly-2021-09-20
-source $HOME/.cargo/env
-rustup component add rust-src && rustup target install aarch64-unknown-linux-gnu arm-unknown-linux-gnueabihf
+# install rustup and stable Rust if needed
+if command -v rustup &>/dev/null ; then
+	rustup install stable
+else
+	curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
+	source "$HOME/.cargo/env"
+fi
+
+# Ensure the toolchain, components, and targets we've specified in
+# rust-toolchain.toml are ready to go. Since that file sets rustup's default
+# toolchain for the entire directory, all we need to do is run any
+# rustup-wrapped command to trigger installation. We've arbitrarily chosen
+# "cargo --version" since it has no other effect.
+cargo --version >/dev/null
 
 # install Xargo
-rustup default 1.56.0 && cargo +1.56.0 install xargo
-# switch to nightly
-rustup default nightly-2021-09-20
+cargo +stable install xargo
 
 ########################################################
 # initialize submodules: optee_os / optee_client / build


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


[incubator-teaclave-trustzone-sdk] 02/06: setup.sh: quote variable expansions

Posted by yu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

yuanz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave-trustzone-sdk.git

commit 5147b278c411af5a5689219d2ad7534e76f14c19
Author: Thomas Hebb <tc...@meta.com>
AuthorDate: Fri Apr 21 14:47:05 2023 -0400

    setup.sh: quote variable expansions
    
    This prevents variables with whitespace from expanding as multiple
    arguments.
---
 setup.sh | 38 +++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/setup.sh b/setup.sh
index e0b2547..ff3265e 100755
--- a/setup.sh
+++ b/setup.sh
@@ -34,17 +34,17 @@ rustup default nightly-2021-09-20
 # initialize submodules: optee_os / optee_client / build
 OPTEE_RELEASE_VERSION=3.20.0
 
-if [[ -z $OPTEE_DIR ]] || [[ $OPTEE_DIR == $PWD/optee ]]
+if [[ -z "$OPTEE_DIR" ]] || [[ "$OPTEE_DIR" == "$(pwd)/optee" ]]
 then
-	OPTEE_DIR=$PWD/optee
-	echo optee dir: $OPTEE_DIR
-	OPTEE_SUBMODULES=("optee_os" "optee_client" "build")
+	OPTEE_DIR="$(pwd)/optee"
+	echo "optee dir: $OPTEE_DIR"
+	OPTEE_SUBMODULES=(optee_os optee_client build)
 
-	if [ ! -d $OPTEE_DIR ]
+	if [ ! -d "$OPTEE_DIR" ]
 	then
-		mkdir $OPTEE_DIR
+		mkdir "$OPTEE_DIR"
 	else
-		rm -r $OPTEE_DIR/*
+		rm -r "$OPTEE_DIR"/*
 	fi
 
 	# download optee release
@@ -53,26 +53,26 @@ then
 	do
 		echo "Downloading $submodule..."
 		curl --retry 5 -s -S \
-			-L https://github.com/OP-TEE/$submodule/archive/refs/tags/$OPTEE_RELEASE_VERSION.tar.gz \
-			-o $OPTEE_DIR/$OPTEE_RELEASE_VERSION.tar.gz
+			-L "https://github.com/OP-TEE/$submodule/archive/refs/tags/$OPTEE_RELEASE_VERSION.tar.gz" \
+			-o "$OPTEE_DIR/$OPTEE_RELEASE_VERSION.tar.gz"
 		if [ ! $? -eq 0 ]
 		then
-			rm $OPTEE_DIR/$OPTEE_RELEASE_VERSION.tar.gz && \
+			rm "$OPTEE_DIR/$OPTEE_RELEASE_VERSION.tar.gz" && \
 				echo "Download failed" && \
 				exit 1
 		fi
 		echo "Uncompressing $submodule..."
-		mkdir -p $OPTEE_DIR/$submodule && \
-			tar zxf $OPTEE_DIR/$OPTEE_RELEASE_VERSION.tar.gz \
-			-C $OPTEE_DIR/$submodule --strip-components 1
+		mkdir -p "$OPTEE_DIR/$submodule" && \
+			tar zxf "$OPTEE_DIR/$OPTEE_RELEASE_VERSION.tar.gz" \
+			-C "$OPTEE_DIR/$submodule" --strip-components 1
 		if [ ! $? -eq 0 ]
 		then
-			rm $OPTEE_DIR/$OPTEE_RELEASE_VERSION.tar.gz && \
-				rm -r $OPTEE_DIR/$submodule && \
+			rm "$OPTEE_DIR/$OPTEE_RELEASE_VERSION.tar.gz" && \
+				rm -r "$OPTEE_DIR/$submodule" && \
 				echo "Downloaded file is damaged" && \
 				exit 1
 		fi
-		rm $OPTEE_DIR/$OPTEE_RELEASE_VERSION.tar.gz
+		rm "$OPTEE_DIR/$OPTEE_RELEASE_VERSION.tar.gz"
 	done
 	echo "Download finished"
 else
@@ -95,17 +95,17 @@ mkdir rust && cd rust
 
 git clone https://github.com/mesalock-linux/rust.git && \
 	(cd rust && \
-	git checkout $RUST_COMMIT_ID && \
+	git checkout "$RUST_COMMIT_ID" && \
 	git submodule update --init library/stdarch && \
 	git submodule update --init library/backtrace)
 
 git clone https://github.com/mesalock-linux/compiler-builtins.git && \
 	(cd compiler-builtins && \
-	git checkout $COMPILER_BUILTINS_COMMIT_ID && \
+	git checkout "$COMPILER_BUILTINS_COMMIT_ID" && \
 	git submodule update --init libm)
 
 git clone https://github.com/mesalock-linux/libc.git && \
 	(cd libc && \
-	git checkout $LIBC_COMMIT_ID)
+	git checkout "$LIBC_COMMIT_ID")
 
 echo "Rust submodules initialized"


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


[incubator-teaclave-trustzone-sdk] 01/06: setup.sh: fix up whitespace

Posted by yu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

yuanz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave-trustzone-sdk.git

commit 519849766768109ac4a5240cf3848873693c6c45
Author: Thomas Hebb <tc...@meta.com>
AuthorDate: Fri Apr 21 15:20:49 2023 -0400

    setup.sh: fix up whitespace
---
 setup.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/setup.sh b/setup.sh
index 9ea2408..e0b2547 100755
--- a/setup.sh
+++ b/setup.sh
@@ -65,13 +65,13 @@ then
 		mkdir -p $OPTEE_DIR/$submodule && \
 			tar zxf $OPTEE_DIR/$OPTEE_RELEASE_VERSION.tar.gz \
 			-C $OPTEE_DIR/$submodule --strip-components 1
-	        if [ ! $? -eq 0 ]
+		if [ ! $? -eq 0 ]
 		then
 			rm $OPTEE_DIR/$OPTEE_RELEASE_VERSION.tar.gz && \
 				rm -r $OPTEE_DIR/$submodule && \
 				echo "Downloaded file is damaged" && \
 				exit 1
-	        fi
+		fi
 		rm $OPTEE_DIR/$OPTEE_RELEASE_VERSION.tar.gz
 	done
 	echo "Download finished"
@@ -88,7 +88,7 @@ LIBC_COMMIT_ID=1ddfbbbc190bec0f5ec32b08e97585b34d0c6b09
 
 if [ -d rust/ ]
 then
-        rm -r rust/
+	rm -r rust/
 fi
 
 mkdir rust && cd rust


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