You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@teaclave.apache.org by "DemesneGH (via GitHub)" <gi...@apache.org> on 2024/10/15 09:06:15 UTC

[PR] Add std-only examples and polish doc for `main` [incubator-teaclave-trustzone-sdk]

DemesneGH opened a new pull request, #144:
URL: https://github.com/apache/incubator-teaclave-trustzone-sdk/pull/144

   - Add examples: `serde`, `message_passing_interface`, `tcp_client`, `udp_socket`, `tls_client`, `tls_server`
   - Add test scripts and CI for those examples
   - Add migration guide from `master` branch
   - Polish README in main page


-- 
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: dev-unsubscribe@teaclave.apache.org

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


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


Re: [PR] Add std-only examples and polish doc for `main` [incubator-teaclave-trustzone-sdk]

Posted by "b49020 (via GitHub)" <gi...@apache.org>.
b49020 commented on PR #144:
URL: https://github.com/apache/incubator-teaclave-trustzone-sdk/pull/144#issuecomment-2421541589

   Apart from few comments above, the overall cleanup looks good to me.


-- 
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: dev-unsubscribe@teaclave.apache.org

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


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


Re: [PR] Add std-only examples and polish doc for `main` [incubator-teaclave-trustzone-sdk]

Posted by "DemesneGH (via GitHub)" <gi...@apache.org>.
DemesneGH commented on code in PR #144:
URL: https://github.com/apache/incubator-teaclave-trustzone-sdk/pull/144#discussion_r1806230446


##########
examples/message_passing_interface-rs/Makefile:
##########
@@ -0,0 +1,33 @@
+# 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.
+
+# If _HOST or _TA specific compiler/target are not specified, then use common
+# compiler/target for both
+CROSS_COMPILE_HOST ?= aarch64-linux-gnu-
+CROSS_COMPILE_TA ?= aarch64-linux-gnu-
+TARGET_HOST ?= aarch64-unknown-linux-gnu
+TARGET_TA ?= aarch64-unknown-linux-gnu
+
+all:
+	$(q)make -C host TARGET_HOST=$(TARGET_HOST) \
+		CROSS_COMPILE_HOST=$(CROSS_COMPILE_HOST)
+	$(q)make -C ta TARGET_TA=$(TARGET_TA) \
+		CROSS_COMPILE_TA=$(CROSS_COMPILE_TA)
+

Review Comment:
   done



-- 
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: dev-unsubscribe@teaclave.apache.org

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


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


Re: [PR] Add std-only examples and polish doc for `main` [incubator-teaclave-trustzone-sdk]

Posted by "DemesneGH (via GitHub)" <gi...@apache.org>.
DemesneGH commented on code in PR #144:
URL: https://github.com/apache/incubator-teaclave-trustzone-sdk/pull/144#discussion_r1804812142


##########
examples/message_passing_interface-rs/Makefile:
##########
@@ -0,0 +1,33 @@
+# 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.
+
+# If _HOST or _TA specific compiler/target are not specified, then use common
+# compiler/target for both
+CROSS_COMPILE_HOST ?= aarch64-linux-gnu-
+CROSS_COMPILE_TA ?= aarch64-linux-gnu-
+TARGET_HOST ?= aarch64-unknown-linux-gnu
+TARGET_TA ?= aarch64-unknown-linux-gnu
+
+all:
+	$(q)make -C host TARGET_HOST=$(TARGET_HOST) \
+		CROSS_COMPILE_HOST=$(CROSS_COMPILE_HOST)
+	$(q)make -C ta TARGET_TA=$(TARGET_TA) \
+		CROSS_COMPILE_TA=$(CROSS_COMPILE_TA)
+

Review Comment:
   > The sub-level Makefiles could rely on the variables passed down from the top-level Makefile and use more generic variable names, such as TARGET and CROSS_COMPILE, similar as the `@CROSS_COMPILE` usage for building ring.
   
   That makes sense because the `CROSS_COMPILE` is needed for building inner C libraries for TA. But I have some consideration for independent building.
   Keeping the `CROSS_COMPILE_{HOST, TA}` suffix helps to build CA or TA independently. The scenario is common, like the CA is finished and we're developing TA and willing to rebuild it.
   
   Currently, the `CROSS_COMPILE_{HOST, TA}` is set by `source environment` on env setup stage of our SDK (https://github.com/DemesneGH/rust-optee-trustzone-sdk/blob/a84e96d4199289844285d545ac5916fb35f1e9fb/environment) .
   After setup we can build only TA for one example: e.g. run `make -C examples/hello_world-rs/ta`. 
   
   If changed to this:
   
   > @make -C host TARGET=$(TARGET_HOST) CROSS_COMPILE=$(CROSS_COMPILE_HOST)
   > @make -C ta TARGET=$(TARGET_TA) CROSS_COMPILE=$(CROSS_COMPILE_TA)
   
   The `example/*/ta/Makefile` needs to read `CROSS_COMPILE` set by `example/*/Makefile`. 
   If we want to build TA only, we have to build the entire example (using `example/*/Makefile`) to set correct CROSS_COMPILE, or set the CROSS_COMPILE explicitly.
   



-- 
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: dev-unsubscribe@teaclave.apache.org

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


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


Re: [PR] Add std-only examples and polish doc for `main` [incubator-teaclave-trustzone-sdk]

Posted by "m4sterchain (via GitHub)" <gi...@apache.org>.
m4sterchain commented on code in PR #144:
URL: https://github.com/apache/incubator-teaclave-trustzone-sdk/pull/144#discussion_r1804939158


##########
examples/message_passing_interface-rs/Makefile:
##########
@@ -0,0 +1,33 @@
+# 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.
+
+# If _HOST or _TA specific compiler/target are not specified, then use common
+# compiler/target for both
+CROSS_COMPILE_HOST ?= aarch64-linux-gnu-
+CROSS_COMPILE_TA ?= aarch64-linux-gnu-
+TARGET_HOST ?= aarch64-unknown-linux-gnu
+TARGET_TA ?= aarch64-unknown-linux-gnu
+
+all:
+	$(q)make -C host TARGET_HOST=$(TARGET_HOST) \
+		CROSS_COMPILE_HOST=$(CROSS_COMPILE_HOST)
+	$(q)make -C ta TARGET_TA=$(TARGET_TA) \
+		CROSS_COMPILE_TA=$(CROSS_COMPILE_TA)
+

Review Comment:
   `make host`, `make ta` should be the recommended way for independent building. 



-- 
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: dev-unsubscribe@teaclave.apache.org

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


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


Re: [PR] Add std-only examples and polish doc for `main` [incubator-teaclave-trustzone-sdk]

Posted by "m4sterchain (via GitHub)" <gi...@apache.org>.
m4sterchain commented on code in PR #144:
URL: https://github.com/apache/incubator-teaclave-trustzone-sdk/pull/144#discussion_r1804322948


##########
examples/message_passing_interface-rs/Makefile:
##########
@@ -0,0 +1,33 @@
+# 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.
+
+# If _HOST or _TA specific compiler/target are not specified, then use common
+# compiler/target for both
+CROSS_COMPILE_HOST ?= aarch64-linux-gnu-
+CROSS_COMPILE_TA ?= aarch64-linux-gnu-
+TARGET_HOST ?= aarch64-unknown-linux-gnu
+TARGET_TA ?= aarch64-unknown-linux-gnu
+
+all:
+	$(q)make -C host TARGET_HOST=$(TARGET_HOST) \
+		CROSS_COMPILE_HOST=$(CROSS_COMPILE_HOST)
+	$(q)make -C ta TARGET_TA=$(TARGET_TA) \
+		CROSS_COMPILE_TA=$(CROSS_COMPILE_TA)
+

Review Comment:
   I see that at the top level, TARGET_HOST and TARGET_TA are used to differentiate between the build parameters for the host and trusted application (TA), which makes sense. However, at the sub-level (host/Makefile and ta/Makefile), it may be unnecessary to keep differentiating these parameters. The sub-level Makefiles could rely on the variables passed down from the top-level Makefile and use more generic variable names, such as TARGET and CROSS_COMPILE, similar as the `@CROSS_COMPILE` usage for building ring.
   
   Instead of maintaining the separate TARGET_HOST and TARGET_TA at each level, we could streamline the build process by using:
   ```
   @make -C host TARGET=$(TARGET_HOST) CROSS_COMPILE=$(CROSS_COMPILE_HOST)
   @make -C ta TARGET=$(TARGET_TA) CROSS_COMPILE=$(CROSS_COMPILE_TA)
   ```
   



##########
docs/migrating-to-new-building-env.md:
##########
@@ -0,0 +1,57 @@
+---
+permalink: /trustzone-sdk-docs/migrating-to-new-building-env.md
+---
+
+## Migration Guide: Moving from `master` to `main` Branch (Post-Oct 2024)
+
+Since the `main` branch (after October 2024) introduces breaking changes 
+to the build environment, if users of the legacy `master` branch want to 
+keep upstream or use a new version of the Rust toolchain, they will need 
+to follow these steps to migrate their TA to the new environment.
+
+### Step 1: Migrate Old Code to the New Environment
+
+To migrate an example project (e.g., `tls_server-rs` in `examples/`), you 

Review Comment:
   The current migration strategy seems to ask developers to duplicate the hello-world example and manually copy their source code into the corresponding subdirectories. However, this approach doesn't clearly highlight what has actually changed and what developers need to focus on during the migration.
   
   The target audience for this section is developers currently using the master branch who have their own code repositories. The key point we need to emphasize is that no code changes are required during the migration—only the build scripts need to be updated.
   
   The message we want to convey is simple: developers should be aware that the build process has changed compared to the legacy master branch, and the build scripts will need to be replaced. Could we clearly outline the differences in the build scripts (e.g. Cargo.toml, build.rs, Makefile, etc), step-by-step, and perhaps reference a specific commit for further clarification? This way, developers can focus on adapting their build environment without being concerned about unnecessary code modifications.



##########
examples/message_passing_interface-rs/Makefile:
##########
@@ -0,0 +1,33 @@
+# 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.
+
+# If _HOST or _TA specific compiler/target are not specified, then use common
+# compiler/target for both
+CROSS_COMPILE_HOST ?= aarch64-linux-gnu-
+CROSS_COMPILE_TA ?= aarch64-linux-gnu-
+TARGET_HOST ?= aarch64-unknown-linux-gnu
+TARGET_TA ?= aarch64-unknown-linux-gnu
+
+all:
+	$(q)make -C host TARGET_HOST=$(TARGET_HOST) \
+		CROSS_COMPILE_HOST=$(CROSS_COMPILE_HOST)
+	$(q)make -C ta TARGET_TA=$(TARGET_TA) \
+		CROSS_COMPILE_TA=$(CROSS_COMPILE_TA)
+
+clean:
+	$(q)make -C host clean

Review Comment:
    I cannot find the the definition of `$q` in this commit. Is there any reference or purpose for using $(q) as prefix of the make command?



##########
examples/message_passing_interface-rs/ta/ta_static.rs:
##########
@@ -0,0 +1,102 @@
+// 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.
+
+use core::ffi::*;

Review Comment:
   As wildcard imports are discouraged, can we replace it with `use core::ffi;`, and explicit reference `ffi::` for each imported type? 



-- 
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: dev-unsubscribe@teaclave.apache.org

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


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


Re: [PR] Add std-only examples and polish doc for `main` [incubator-teaclave-trustzone-sdk]

Posted by "b49020 (via GitHub)" <gi...@apache.org>.
b49020 commented on code in PR #144:
URL: https://github.com/apache/incubator-teaclave-trustzone-sdk/pull/144#discussion_r1805919714


##########
examples/message_passing_interface-rs/host/Makefile:
##########
@@ -0,0 +1,38 @@
+# 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.
+
+NAME := message_passing_interface-rs
+
+TARGET ?= aarch64-unknown-linux-gnu
+CROSS_COMPILE ?= aarch64-linux-gnu-
+OBJCOPY := $(CROSS_COMPILE)objcopy
+LINKER_CFG := target.$(TARGET).linker=\"$(CROSS_COMPILE)gcc\"
+
+OUT_DIR := $(CURDIR)/target/$(TARGET)/release
+
+
+all: host strip

Review Comment:
   Since it's a client towards STD TA, there is no value in building it without `${STD}` enabled, so we should gate it as well as we do for STD TAs. This holds true for other STD TAs clients as well.



##########
examples/serde-rs/ta/src/main.rs:
##########
@@ -0,0 +1,101 @@
+// 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.
+
+#![no_main]
+// this is the workaround for the error:
+// error[E0658]: use of unstable library feature 'c_size_t'

Review Comment:
   Is this comment redundant now?



-- 
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: dev-unsubscribe@teaclave.apache.org

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


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


Re: [PR] Add std-only examples and polish doc for `main` [incubator-teaclave-trustzone-sdk]

Posted by "b49020 (via GitHub)" <gi...@apache.org>.
b49020 commented on code in PR #144:
URL: https://github.com/apache/incubator-teaclave-trustzone-sdk/pull/144#discussion_r1805946054


##########
docs/migrating-to-new-building-env.md:
##########
@@ -0,0 +1,57 @@
+---
+permalink: /trustzone-sdk-docs/migrating-to-new-building-env.md
+---
+
+## Migration Guide: Moving from `master` to `main` Branch (Post-Oct 2024)
+
+Since the `main` branch (after October 2024) introduces breaking changes 
+to the build environment, if users of the legacy `master` branch want to 
+keep upstream or use a new version of the Rust toolchain, they will need 
+to follow these steps to migrate their TA to the new environment.
+
+### Step 1: Migrate Old Code to the New Environment
+
+To migrate an example project (e.g., `tls_server-rs` in `examples/`), you 

Review Comment:
   IMHO, we should rather be describing the build environment for the `main` branch as to how it's structured. This will help developers writing new TAs or updating existing TAs to the build environment on `main` branch.
   
   A few words for each file under following directory structure should be sufficient:
   
   ```
   examples/acipher-rs/
   ├── host
   │   ├── Cargo.toml
   │   ├── Makefile
   │   └── src
   │       └── main.rs
   ├── Makefile
   ├── proto
   │   ├── build.rs
   │   ├── Cargo.toml
   │   └── src
   │       └── lib.rs
   ├── ta
   │   ├── build.rs
   │   ├── Cargo.toml
   │   ├── Makefile
   │   ├── src
   │   │   └── main.rs
   │   ├── ta_static.rs
   │   └── Xargo.toml
   └── uuid.txt
   
   ```



-- 
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: dev-unsubscribe@teaclave.apache.org

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


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


Re: [PR] Add std-only examples and polish doc for `main` [incubator-teaclave-trustzone-sdk]

Posted by "DemesneGH (via GitHub)" <gi...@apache.org>.
DemesneGH commented on code in PR #144:
URL: https://github.com/apache/incubator-teaclave-trustzone-sdk/pull/144#discussion_r1806162819


##########
examples/serde-rs/ta/src/main.rs:
##########
@@ -0,0 +1,101 @@
+// 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.
+
+#![no_main]
+// this is the workaround for the error:
+// error[E0658]: use of unstable library feature 'c_size_t'

Review Comment:
   removed in new commit



-- 
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: dev-unsubscribe@teaclave.apache.org

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


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


Re: [PR] Add std-only examples and polish doc for `main` [incubator-teaclave-trustzone-sdk]

Posted by "DemesneGH (via GitHub)" <gi...@apache.org>.
DemesneGH commented on code in PR #144:
URL: https://github.com/apache/incubator-teaclave-trustzone-sdk/pull/144#discussion_r1806162514


##########
examples/message_passing_interface-rs/host/Makefile:
##########
@@ -0,0 +1,38 @@
+# 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.
+
+NAME := message_passing_interface-rs
+
+TARGET ?= aarch64-unknown-linux-gnu
+CROSS_COMPILE ?= aarch64-linux-gnu-
+OBJCOPY := $(CROSS_COMPILE)objcopy
+LINKER_CFG := target.$(TARGET).linker=\"$(CROSS_COMPILE)gcc\"
+
+OUT_DIR := $(CURDIR)/target/$(TARGET)/release
+
+
+all: host strip

Review Comment:
   Good point! Updated in new commits, thanks for your comment



-- 
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: dev-unsubscribe@teaclave.apache.org

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


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


Re: [PR] Add std-only examples and polish doc for `main` [incubator-teaclave-trustzone-sdk]

Posted by "DemesneGH (via GitHub)" <gi...@apache.org>.
DemesneGH merged PR #144:
URL: https://github.com/apache/incubator-teaclave-trustzone-sdk/pull/144


-- 
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: dev-unsubscribe@teaclave.apache.org

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


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


Re: [PR] Add std-only examples and polish doc for `main` [incubator-teaclave-trustzone-sdk]

Posted by "DemesneGH (via GitHub)" <gi...@apache.org>.
DemesneGH commented on code in PR #144:
URL: https://github.com/apache/incubator-teaclave-trustzone-sdk/pull/144#discussion_r1804504603


##########
examples/message_passing_interface-rs/Makefile:
##########
@@ -0,0 +1,33 @@
+# 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.
+
+# If _HOST or _TA specific compiler/target are not specified, then use common
+# compiler/target for both
+CROSS_COMPILE_HOST ?= aarch64-linux-gnu-
+CROSS_COMPILE_TA ?= aarch64-linux-gnu-
+TARGET_HOST ?= aarch64-unknown-linux-gnu
+TARGET_TA ?= aarch64-unknown-linux-gnu
+
+all:
+	$(q)make -C host TARGET_HOST=$(TARGET_HOST) \
+		CROSS_COMPILE_HOST=$(CROSS_COMPILE_HOST)
+	$(q)make -C ta TARGET_TA=$(TARGET_TA) \
+		CROSS_COMPILE_TA=$(CROSS_COMPILE_TA)
+
+clean:
+	$(q)make -C host clean

Review Comment:
   `q` is set in the root Makefile: https://github.com/DemesneGH/rust-optee-trustzone-sdk/blob/a84e96d4199289844285d545ac5916fb35f1e9fb/Makefile#L27C1-L35C9 to determine whether we print the executing details for commands. It's in original `no-std` branch so not included in this commit diff.



-- 
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: dev-unsubscribe@teaclave.apache.org

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


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


Re: [PR] Add std-only examples and polish doc for `main` [incubator-teaclave-trustzone-sdk]

Posted by "DemesneGH (via GitHub)" <gi...@apache.org>.
DemesneGH commented on code in PR #144:
URL: https://github.com/apache/incubator-teaclave-trustzone-sdk/pull/144#discussion_r1806243983


##########
docs/migrating-to-new-building-env.md:
##########
@@ -0,0 +1,57 @@
+---
+permalink: /trustzone-sdk-docs/migrating-to-new-building-env.md
+---
+
+## Migration Guide: Moving from `master` to `main` Branch (Post-Oct 2024)
+
+Since the `main` branch (after October 2024) introduces breaking changes 
+to the build environment, if users of the legacy `master` branch want to 
+keep upstream or use a new version of the Rust toolchain, they will need 
+to follow these steps to migrate their TA to the new environment.
+
+### Step 1: Migrate Old Code to the New Environment
+
+To migrate an example project (e.g., `tls_server-rs` in `examples/`), you 

Review Comment:
   Doc updated, thanks for all comments



-- 
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: dev-unsubscribe@teaclave.apache.org

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


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