From ee7e944733e784e92d2debf48d14b81e93478da2 Mon Sep 17 00:00:00 2001 From: Peter LeVasseur Date: Wed, 8 Jan 2025 09:59:07 -0500 Subject: [PATCH 1/7] Add shell script to set environment variables, updated CI workflows to use it. --- .github/workflows/bundled-lint-and-test.yaml | 32 ++++- .../workflows/unbundled-lint-and-test.yaml | 53 ++++++-- build/envsetup.sh | 120 ++++++++++++++++++ 3 files changed, 189 insertions(+), 16 deletions(-) create mode 100755 build/envsetup.sh diff --git a/.github/workflows/bundled-lint-and-test.yaml b/.github/workflows/bundled-lint-and-test.yaml index 5a574ad..f12945e 100644 --- a/.github/workflows/bundled-lint-and-test.yaml +++ b/.github/workflows/bundled-lint-and-test.yaml @@ -15,8 +15,6 @@ name: Lint and Test - Bundled env: VSOMEIP_INSTALL_PATH: vsomeip-install - GENERIC_CPP_STDLIB_PATH: /usr/include/c++/11 - ARCH_SPECIFIC_CPP_STDLIB_PATH: /usr/include/x86_64-linux-gnu/c++/11 on: push: @@ -35,9 +33,31 @@ concurrency: jobs: + set-env: + name: Set environment variables + runs-on: ubuntu-22.04 + + outputs: + arch_specific_cpp_stdlib_path: ${{ steps.set_env.outputs.arch_specific_cpp_stdlib_path }} + generic_cpp_stdlib_path: ${{ steps.set_env.outputs.generic_cpp_stdlib_path }} + + steps: + - uses: actions/checkout@v4 + + - name: Add execute permissions for envsetup + run: chmod +x build/envsetup.sh + + - name: Set stdlib paths dynamically + id: set_env + run: | + source ./build/envsetup.sh highest + echo "arch_specific_cpp_stdlib_path=$ARCH_SPECIFIC_CPP_STDLIB_PATH" >> $GITHUB_OUTPUT + echo "generic_cpp_stdlib_path=$GENERIC_CPP_STDLIB_PATH" >> $GITHUB_OUTPUT + lint: name: Lint - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 + needs: set-env steps: - uses: actions/checkout@v4 @@ -81,7 +101,8 @@ jobs: test: name: Test - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 + needs: set-env steps: - uses: actions/checkout@v4 @@ -146,7 +167,8 @@ jobs: build-docs: name: Build documentation - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 + needs: set-env steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/unbundled-lint-and-test.yaml b/.github/workflows/unbundled-lint-and-test.yaml index 2052e14..6145404 100644 --- a/.github/workflows/unbundled-lint-and-test.yaml +++ b/.github/workflows/unbundled-lint-and-test.yaml @@ -19,9 +19,6 @@ env: VSOMEIP_SOURCE_PATH: vsomeip-src VSOMEIP_INSTALL_PATH: vsomeip-install - GENERIC_CPP_STDLIB_PATH: /usr/include/c++/11 - ARCH_SPECIFIC_CPP_STDLIB_PATH: /usr/include/x86_64-linux-gnu/c++/11 - on: push: branches: [ main ] @@ -38,10 +35,36 @@ concurrency: cancel-in-progress: true jobs: - obtain_and_build_vsomeip: + set-env: + name: Set environment variables runs-on: ubuntu-22.04 + + outputs: + arch_specific_cpp_stdlib_path: ${{ steps.set_env.outputs.arch_specific_cpp_stdlib_path }} + generic_cpp_stdlib_path: ${{ steps.set_env.outputs.generic_cpp_stdlib_path }} + + steps: + - uses: actions/checkout@v4 + + - name: Add execute permissions for envsetup + run: chmod +x build/envsetup.sh + + - name: Set stdlib paths dynamically + id: set_env + run: | + source ./build/envsetup.sh highest + echo "arch_specific_cpp_stdlib_path=$ARCH_SPECIFIC_CPP_STDLIB_PATH" >> $GITHUB_OUTPUT + echo "generic_cpp_stdlib_path=$GENERIC_CPP_STDLIB_PATH" >> $GITHUB_OUTPUT + + obtain_and_build_vsomeip: + needs: set-env outputs: cache_key: ${{ steps.generate_cache_key.outputs.CACHE_KEY }} + + env: + ARCH_SPECIFIC_CPP_STDLIB_PATH: ${{ needs.set-env.outputs.arch_specific_cpp_stdlib_path }} + GENERIC_CPP_STDLIB_PATH: ${{ needs.set-env.outputs.generic_cpp_stdlib_path }} + steps: - name: Checkout repository uses: actions/checkout@v4 @@ -52,6 +75,7 @@ jobs: echo "VSOMEIP_SOURCE_PATH=${{ github.workspace }}/${{ env.VSOMEIP_SOURCE_PATH }}" >> $GITHUB_ENV echo "VSOMEIP_INSTALL_PATH=${{ github.workspace }}/${{ env.VSOMEIP_INSTALL_PATH }}" >> $GITHUB_ENV echo "VSOMEIP_SOURCE_PATH_WITH_WILDCARD=${{ github.workspace }}/${{ env.VSOMEIP_SOURCE_PATH }}/*" >> $GITHUB_ENV + env - name: Print environment variables for debugging run: | @@ -59,7 +83,10 @@ jobs: echo "VSOMEIP_SOURCE_PATH: ${{ env.VSOMEIP_SOURCE_PATH }}" echo "VSOMEIP_INSTALL_PATH: ${{ env.VSOMEIP_INSTALL_PATH }}" echo "VSOMEIP_SOURCE_PATH_WITH_WILDCARD: ${{ env.VSOMEIP_SOURCE_PATH_WITH_WILDCARD }}" - + echo "GENERIC_CPP_STDLIB_PATH: ${{ env.GENERIC_CPP_STDLIB_PATH }}" + echo "ARCH_SPECIFIC_CPP_STDLIB_PATH: ${{ env.ARCH_SPECIFIC_CPP_STDLIB_PATH }}" + env + - name: Download tarball run: | wget -O vsomeip-source.tar.gz $VSOMEIP_SOURCE_TARBALL @@ -101,7 +128,7 @@ jobs: - name: Install dependencies if: steps.cache-vsomeip.outputs.cache-hit != 'true' - run: sudo apt-get install -y build-essential cmake libboost-all-dev + run: sudo apt-get install -y build-essential cmake libboost-all-dev doxygen asciidoc - name: Build vsomeip if: steps.cache-vsomeip.outputs.cache-hit != 'true' @@ -119,8 +146,9 @@ jobs: lint: name: Lint - needs: obtain_and_build_vsomeip - runs-on: ubuntu-22.04 + needs: + - set-env + - obtain_and_build_vsomeip env: CACHE_KEY: ${{ needs.obtain_and_build_vsomeip.outputs.cache_key }} @@ -178,7 +206,9 @@ jobs: test: name: Test - needs: obtain_and_build_vsomeip + needs: + - set-env + - obtain_and_build_vsomeip runs-on: ubuntu-22.04 env: CACHE_KEY: ${{ needs.obtain_and_build_vsomeip.outputs.cache_key }} @@ -257,8 +287,9 @@ jobs: build-docs: name: Build documentation - needs: obtain_and_build_vsomeip - runs-on: ubuntu-22.04 + needs: + - obtain_and_build_vsomeip + - set-env env: CACHE_KEY: ${{ needs.obtain_and_build_vsomeip.outputs.cache_key }} diff --git a/build/envsetup.sh b/build/envsetup.sh new file mode 100755 index 0000000..28a364e --- /dev/null +++ b/build/envsetup.sh @@ -0,0 +1,120 @@ +#!/bin/bash +# +# to set environment variables for c++ stdlib paths: +# $ source build/envsetup.sh +# +# to automatically select the highest version of the c++ stdlib: +# $ source build/envsetup.sh highest + +# console colors +RED='\033[0;31m' +GRN='\033[0;32m' +ORNG='\033[0;33m' +NC='\033[0;0m' +USE_HIGHEST=0 +if [ "$1" == "highest" ]; then + USE_HIGHEST=1 +fi + +# find the highest number in an array +select_highest_number() { + local numbers=("$@") + local highest_number=0 + + for number in "${numbers[@]}"; do + if [ "$number" -gt "$highest_number" ]; then + highest_number=$number + fi + done + + echo "$highest_number" +} + +# Select a directory from a list of directories +select_directory() { + local directories=("$@") + local selected_path="" + # Check if the directory array contains numbers or strings + is_number=0 + if [[ "${directories[0]}" =~ ^[0-9]+$ ]]; then + is_number=1 + fi + + # Check the number of directories + if [ "${#directories[@]}" -eq 1 ]; then + # If only one directory is found, set MY_PATH to it + selected_path="${directories[0]}" + + elif [ "$USE_HIGHEST" -eq 1 ] && [ "$is_number" -eq 1 ]; then + highest_version=$(select_highest_number "${directories[@]}") + selected_path="$highest_version" + + else + # Display directories to the user if more than one exists + printf "Select a directory: \n" 1>&2 + for i in "${!directories[@]}"; do + printf "%d) %s\n" "$((i + 1))" "${directories[i]}" 1>&2 + done + + # Prompt the user to enter a choice + read -p "Enter the number of your choice: " choice + + # Validate the user’s input + if [[ "$choice" -ge 1 && "$choice" -le "${#directories[@]}" ]]; then + selected_path="${directories[choice - 1]}" + else + printf "${RED}Invalid selection ${NC}\n" 1>&2 + return 1 + fi + fi + + # Return the selected path + echo "$selected_path" +} + +# find c++ include +if [ -d "/usr/include/c++/" ]; then + CPP_DIRS=$( ls /usr/include/c++/ ) + CPP_ARRAY=($CPP_DIRS) + STDLIB_DIR=$(select_directory "${CPP_ARRAY[@]}") + if [ -z "$STDLIB_DIR" ]; then + return 1 + fi + STDLIB_PATH="/usr/include/c++/${STDLIB_DIR}" +else + # Print warning if the directory doesn't exist + echo -e "${RED}/usr/include/c++/ does not exist.${NC}" + return +fi + +# find machine dir +MACHINE_NAME=$(uname -m) +MACHINE_DIRS=$( ls /usr/include/ | grep "${MACHINE_NAME}" ) +MACHINE_ARRAY=($MACHINE_DIRS) +ARCH_DIR=$(select_directory "${MACHINE_ARRAY[@]}") +if [ -z "$ARCH_DIR" ]; then + return 1 +fi +ARCH_PATH="/usr/include/${ARCH_DIR}" + +# find arch c++ include +if [ -d "$ARCH_PATH/c++/" ]; then + CPP_DIRS=$( ls ${ARCH_PATH}/c++/ ) + CPP_ARRAY=($CPP_DIRS) + STDLIB_DIR=$(select_directory "${CPP_ARRAY[@]}") + if [ -z "$STDLIB_DIR" ]; then + return 1 + fi + ARCH_STDLIB_PATH="${ARCH_PATH}/c++/${STDLIB_DIR}" +else + # Print warning if the directory doesn't exist + echo -e "${RED}$ARCH_PATH/c++/ does not exist.${NC}" + return +fi + +# export the variables +export GENERIC_CPP_STDLIB_PATH=$STDLIB_PATH +export ARCH_SPECIFIC_CPP_STDLIB_PATH=$ARCH_STDLIB_PATH + +echo -e "${ORNG}Set GENERIC_CPP_STDLIB_PATH=${GRN}$GENERIC_CPP_STDLIB_PATH${NC}" +echo -e "${ORNG}Set ARCH_SPECIFIC_CPP_STDLIB_PATH=${GRN}$ARCH_SPECIFIC_CPP_STDLIB_PATH${NC}" From 534f76bf66b0df3dfba8d65992c9fc3eda555d21 Mon Sep 17 00:00:00 2001 From: Peter LeVasseur Date: Wed, 8 Jan 2025 12:20:43 -0500 Subject: [PATCH 2/7] Update up-transport-vsomeip-rust and up-streamer-rust to use up-rust 0.3.0 --- Cargo.lock | 55 ++++++++++++++++++++--------- Cargo.toml | 8 +++-- up-linux-streamer-plugin/Cargo.toml | 2 +- 3 files changed, 44 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 909e8b3..5239c76 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1162,7 +1162,7 @@ dependencies = [ "protobuf", "serde", "tokio", - "up-rust", + "up-rust 0.3.0", "up-transport-mqtt5", "up-transport-vsomeip", "up-transport-zenoh", @@ -1734,7 +1734,7 @@ dependencies = [ "serde_json", "tokio", "tokio-condvar", - "up-rust", + "up-rust 0.3.0", "up-streamer", "uuid", ] @@ -3548,7 +3548,7 @@ dependencies = [ "protobuf", "serde", "serde_json", - "up-rust", + "up-rust 0.3.0", "uuid", ] @@ -4094,7 +4094,7 @@ dependencies = [ "protobuf", "serde", "tokio", - "up-rust", + "up-rust 0.3.0", "up-streamer", "up-transport-mqtt5", "up-transport-vsomeip", @@ -4115,7 +4115,7 @@ dependencies = [ "serde_json", "tokio", "tracing", - "up-rust", + "up-rust 0.3.0", "up-streamer", "up-transport-vsomeip", "up-transport-zenoh", @@ -4148,6 +4148,26 @@ dependencies = [ "uuid-simd", ] +[[package]] +name = "up-rust" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30118ab07c7ca420e2196bbc0f6f380b3100928d03ec1cd960f9220472f48f1a" +dependencies = [ + "async-trait", + "bytes", + "mediatype", + "protobuf", + "protobuf-codegen", + "protoc-bin-vendored", + "rand", + "thiserror", + "tokio", + "tracing", + "uriparse", + "uuid-simd", +] + [[package]] name = "up-streamer" version = "0.1.0" @@ -4165,7 +4185,7 @@ dependencies = [ "subscription-cache", "tokio", "tokio-condvar", - "up-rust", + "up-rust 0.3.0", "usubscription-static-file", "uuid", ] @@ -4190,15 +4210,15 @@ dependencies = [ "serde_json", "tokio", "tokio-macros", - "up-rust", + "up-rust 0.2.0", "url", "uuid", ] [[package]] name = "up-transport-vsomeip" -version = "0.2.0" -source = "git+https://github.com/eclipse-uprotocol/up-transport-vsomeip-rust.git?tag=v0.3.0#d659287126120d4feb75cbcc35a5334def421f50" +version = "0.3.0" +source = "git+https://github.com/PLeVasseur/up-client-vsomeip-rust?branch=add-build-script_update-up-rust-version#ed295aba9e979ff7cf59b3d085586677e43c75f5" dependencies = [ "async-trait", "bimap", @@ -4213,26 +4233,27 @@ dependencies = [ "serde", "serde_json", "tokio", - "up-rust", + "up-rust 0.3.0", "vsomeip-proc-macro", "vsomeip-sys", ] [[package]] name = "up-transport-zenoh" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "739441e501be7ea887024bcb2df2b452a362ee39d8efb0f2663fae0dc35e564c" +checksum = "1dba40062ff410f59a9a34a51a9288c8ad92454e4199725264f4f9eaeb604fd9" dependencies = [ "anyhow", "async-trait", "bytes", "lazy_static", "protobuf", + "serde_json", "tokio", "tracing", "tracing-subscriber", - "up-rust", + "up-rust 0.3.0", "zenoh", ] @@ -4266,7 +4287,7 @@ dependencies = [ "log", "serde_json", "subscription-cache", - "up-rust", + "up-rust 0.3.0", ] [[package]] @@ -4363,7 +4384,7 @@ checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" [[package]] name = "vsomeip-proc-macro" version = "0.1.0" -source = "git+https://github.com/eclipse-uprotocol/up-transport-vsomeip-rust.git?tag=v0.3.0#d659287126120d4feb75cbcc35a5334def421f50" +source = "git+https://github.com/PLeVasseur/up-client-vsomeip-rust?branch=add-build-script_update-up-rust-version#ed295aba9e979ff7cf59b3d085586677e43c75f5" dependencies = [ "proc-macro2", "quote", @@ -4373,8 +4394,8 @@ dependencies = [ [[package]] name = "vsomeip-sys" -version = "0.2.0" -source = "git+https://github.com/eclipse-uprotocol/up-transport-vsomeip-rust.git?tag=v0.3.0#d659287126120d4feb75cbcc35a5334def421f50" +version = "0.3.0" +source = "git+https://github.com/PLeVasseur/up-client-vsomeip-rust?branch=add-build-script_update-up-rust-version#ed295aba9e979ff7cf59b3d085586677e43c75f5" dependencies = [ "autocxx", "autocxx-build", diff --git a/Cargo.toml b/Cargo.toml index b3d0320..3cd8706 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,9 +41,11 @@ serde_json = { version = "1.0.94" } uuid = { version = "1.7.0" } tokio = { version = "1.35.1", default-features = false, features = ["rt", "rt-multi-thread", "sync", "time"] } protobuf = { version = "3.3", features = ["with-bytes"] } -up-rust = { version = "0.2.0", default-features = false } -up-transport-zenoh = { version = "0.3.0" } -up-transport-vsomeip = { git = "https://github.com/eclipse-uprotocol/up-transport-vsomeip-rust.git", tag = "v0.3.0", default-features = false } +up-rust = { version = "0.3.0", default-features = false } +up-transport-zenoh = { version = "0.4.0" } +# TODO: Update this to dmacattack version for test +up-transport-vsomeip = { git = "https://github.com/PLeVasseur/up-client-vsomeip-rust", branch = "add-build-script_update-up-rust-version", default-features = false } +# up-transport-vsomeip = { git = "https://github.com/eclipse-uprotocol/up-transport-vsomeip-rust.git", tag = "v0.3.0", default-features = false } up-transport-mqtt5 = { version = "0.1.0" } zenoh = { version = "1.0.0", features = ["default", "plugins"] } zenoh-core = { version = "1.0.0" } diff --git a/up-linux-streamer-plugin/Cargo.toml b/up-linux-streamer-plugin/Cargo.toml index 9b34f4e..bddb08d 100644 --- a/up-linux-streamer-plugin/Cargo.toml +++ b/up-linux-streamer-plugin/Cargo.toml @@ -47,7 +47,7 @@ serde = { version = "1.0.154" } serde_json = { version = "1.0.94" } tokio = { version = "1.35.1", default-features = false } up-rust = { workspace = true } -up-transport-zenoh = { workspace = true, optional = true } +up-transport-zenoh = { workspace = true, optional = true, features = ["zenoh-unstable"] } up-transport-vsomeip = { workspace = true, optional = true } up-streamer = { path = "../up-streamer" } usubscription-static-file = {path = "../utils/usubscription-static-file"} From 3f4b1fdc56257cd6a55b4832b4ab24506588b239 Mon Sep 17 00:00:00 2001 From: Peter LeVasseur Date: Wed, 8 Jan 2025 12:31:43 -0500 Subject: [PATCH 3/7] Update up-transport-mqtt5 to 0.2.0 --- Cargo.lock | 44 ++++++++++++-------------------------------- Cargo.toml | 2 +- 2 files changed, 13 insertions(+), 33 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5239c76..01f869f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1162,7 +1162,7 @@ dependencies = [ "protobuf", "serde", "tokio", - "up-rust 0.3.0", + "up-rust", "up-transport-mqtt5", "up-transport-vsomeip", "up-transport-zenoh", @@ -1734,7 +1734,7 @@ dependencies = [ "serde_json", "tokio", "tokio-condvar", - "up-rust 0.3.0", + "up-rust", "up-streamer", "uuid", ] @@ -3548,7 +3548,7 @@ dependencies = [ "protobuf", "serde", "serde_json", - "up-rust 0.3.0", + "up-rust", "uuid", ] @@ -4094,7 +4094,7 @@ dependencies = [ "protobuf", "serde", "tokio", - "up-rust 0.3.0", + "up-rust", "up-streamer", "up-transport-mqtt5", "up-transport-vsomeip", @@ -4115,7 +4115,7 @@ dependencies = [ "serde_json", "tokio", "tracing", - "up-rust 0.3.0", + "up-rust", "up-streamer", "up-transport-vsomeip", "up-transport-zenoh", @@ -4128,26 +4128,6 @@ dependencies = [ "zenoh_backend_traits", ] -[[package]] -name = "up-rust" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af7f283ab2b74869f69bcd5a87950b87db5110e46764af2ddae3248109f0e374" -dependencies = [ - "async-trait", - "bytes", - "mediatype", - "protobuf", - "protobuf-codegen", - "protoc-bin-vendored", - "rand", - "thiserror", - "tokio", - "tracing", - "uriparse", - "uuid-simd", -] - [[package]] name = "up-rust" version = "0.3.0" @@ -4185,16 +4165,16 @@ dependencies = [ "subscription-cache", "tokio", "tokio-condvar", - "up-rust 0.3.0", + "up-rust", "usubscription-static-file", "uuid", ] [[package]] name = "up-transport-mqtt5" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0063dbc750c320501e17ce9d0834a616b26ec49ef6c41887f30bc2788ec25405" +checksum = "43adade571c38ed57b35440a5e524f642f440be19b3f3a5dd79924e0419ce01b" dependencies = [ "async-channel 1.9.0", "async-trait", @@ -4210,7 +4190,7 @@ dependencies = [ "serde_json", "tokio", "tokio-macros", - "up-rust 0.2.0", + "up-rust", "url", "uuid", ] @@ -4233,7 +4213,7 @@ dependencies = [ "serde", "serde_json", "tokio", - "up-rust 0.3.0", + "up-rust", "vsomeip-proc-macro", "vsomeip-sys", ] @@ -4253,7 +4233,7 @@ dependencies = [ "tokio", "tracing", "tracing-subscriber", - "up-rust 0.3.0", + "up-rust", "zenoh", ] @@ -4287,7 +4267,7 @@ dependencies = [ "log", "serde_json", "subscription-cache", - "up-rust 0.3.0", + "up-rust", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 3cd8706..c26690a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,7 +46,7 @@ up-transport-zenoh = { version = "0.4.0" } # TODO: Update this to dmacattack version for test up-transport-vsomeip = { git = "https://github.com/PLeVasseur/up-client-vsomeip-rust", branch = "add-build-script_update-up-rust-version", default-features = false } # up-transport-vsomeip = { git = "https://github.com/eclipse-uprotocol/up-transport-vsomeip-rust.git", tag = "v0.3.0", default-features = false } -up-transport-mqtt5 = { version = "0.1.0" } +up-transport-mqtt5 = { version = "0.2.0" } zenoh = { version = "1.0.0", features = ["default", "plugins"] } zenoh-core = { version = "1.0.0" } zenoh-plugin-trait = { version = "1.0.0" } From 4e1e6bc24470a944e5fa44b92176f839ab472842 Mon Sep 17 00:00:00 2001 From: Peter LeVasseur Date: Wed, 8 Jan 2025 13:04:15 -0500 Subject: [PATCH 4/7] Add necessary piping through of environment variables for paths to C++ stdlib --- .github/workflows/bundled-lint-and-test.yaml | 16 ++++++++++++++++ .github/workflows/unbundled-lint-and-test.yaml | 8 ++++++++ 2 files changed, 24 insertions(+) diff --git a/.github/workflows/bundled-lint-and-test.yaml b/.github/workflows/bundled-lint-and-test.yaml index f12945e..7c62c51 100644 --- a/.github/workflows/bundled-lint-and-test.yaml +++ b/.github/workflows/bundled-lint-and-test.yaml @@ -59,6 +59,10 @@ jobs: runs-on: ubuntu-22.04 needs: set-env + env: + ARCH_SPECIFIC_CPP_STDLIB_PATH: ${{ needs.set-env.outputs.arch_specific_cpp_stdlib_path }} + GENERIC_CPP_STDLIB_PATH: ${{ needs.set-env.outputs.generic_cpp_stdlib_path }} + steps: - uses: actions/checkout@v4 @@ -68,10 +72,14 @@ jobs: - name: Set environment variables run: | echo "VSOMEIP_INSTALL_PATH=${{ github.workspace }}/${{ env.VSOMEIP_INSTALL_PATH }}" >> $GITHUB_ENV + env - name: Print environment variables for debugging run: | echo "VSOMEIP_INSTALL_PATH: ${{ env.VSOMEIP_INSTALL_PATH }}" + echo "GENERIC_CPP_STDLIB_PATH: ${{ env.GENERIC_CPP_STDLIB_PATH }}" + echo "ARCH_SPECIFIC_CPP_STDLIB_PATH: ${{ env.ARCH_SPECIFIC_CPP_STDLIB_PATH }}" + env - name: Ensure vsomeip install path exists run: | @@ -104,6 +112,10 @@ jobs: runs-on: ubuntu-22.04 needs: set-env + env: + ARCH_SPECIFIC_CPP_STDLIB_PATH: ${{ needs.set-env.outputs.arch_specific_cpp_stdlib_path }} + GENERIC_CPP_STDLIB_PATH: ${{ needs.set-env.outputs.generic_cpp_stdlib_path }} + steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable @@ -170,6 +182,10 @@ jobs: runs-on: ubuntu-22.04 needs: set-env + env: + ARCH_SPECIFIC_CPP_STDLIB_PATH: ${{ needs.set-env.outputs.arch_specific_cpp_stdlib_path }} + GENERIC_CPP_STDLIB_PATH: ${{ needs.set-env.outputs.generic_cpp_stdlib_path }} + steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/unbundled-lint-and-test.yaml b/.github/workflows/unbundled-lint-and-test.yaml index 6145404..ce924d1 100644 --- a/.github/workflows/unbundled-lint-and-test.yaml +++ b/.github/workflows/unbundled-lint-and-test.yaml @@ -35,6 +35,7 @@ concurrency: cancel-in-progress: true jobs: + set-env: name: Set environment variables runs-on: ubuntu-22.04 @@ -150,6 +151,8 @@ jobs: - set-env - obtain_and_build_vsomeip env: + ARCH_SPECIFIC_CPP_STDLIB_PATH: ${{ needs.set-env.outputs.arch_specific_cpp_stdlib_path }} + GENERIC_CPP_STDLIB_PATH: ${{ needs.set-env.outputs.generic_cpp_stdlib_path }} CACHE_KEY: ${{ needs.obtain_and_build_vsomeip.outputs.cache_key }} steps: @@ -210,7 +213,10 @@ jobs: - set-env - obtain_and_build_vsomeip runs-on: ubuntu-22.04 + env: + ARCH_SPECIFIC_CPP_STDLIB_PATH: ${{ needs.set-env.outputs.arch_specific_cpp_stdlib_path }} + GENERIC_CPP_STDLIB_PATH: ${{ needs.set-env.outputs.generic_cpp_stdlib_path }} CACHE_KEY: ${{ needs.obtain_and_build_vsomeip.outputs.cache_key }} steps: @@ -291,6 +297,8 @@ jobs: - obtain_and_build_vsomeip - set-env env: + ARCH_SPECIFIC_CPP_STDLIB_PATH: ${{ needs.set-env.outputs.arch_specific_cpp_stdlib_path }} + GENERIC_CPP_STDLIB_PATH: ${{ needs.set-env.outputs.generic_cpp_stdlib_path }} CACHE_KEY: ${{ needs.obtain_and_build_vsomeip.outputs.cache_key }} steps: From 3c6cd5dad6332d2fb50988d6eb266b87b0b7eab8 Mon Sep 17 00:00:00 2001 From: Peter LeVasseur Date: Thu, 23 Jan 2025 10:07:19 -0500 Subject: [PATCH 5/7] Update to published up-transport-vsomeip 0.4.1 --- .github/workflows/unbundled-lint-and-test.yaml | 3 +++ Cargo.toml | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/unbundled-lint-and-test.yaml b/.github/workflows/unbundled-lint-and-test.yaml index ce924d1..066e111 100644 --- a/.github/workflows/unbundled-lint-and-test.yaml +++ b/.github/workflows/unbundled-lint-and-test.yaml @@ -59,6 +59,7 @@ jobs: obtain_and_build_vsomeip: needs: set-env + runs-on: ubuntu-22.04 outputs: cache_key: ${{ steps.generate_cache_key.outputs.CACHE_KEY }} @@ -150,6 +151,7 @@ jobs: needs: - set-env - obtain_and_build_vsomeip + runs-on: ubuntu-22.04 env: ARCH_SPECIFIC_CPP_STDLIB_PATH: ${{ needs.set-env.outputs.arch_specific_cpp_stdlib_path }} GENERIC_CPP_STDLIB_PATH: ${{ needs.set-env.outputs.generic_cpp_stdlib_path }} @@ -296,6 +298,7 @@ jobs: needs: - obtain_and_build_vsomeip - set-env + runs-on: ubuntu-22.04 env: ARCH_SPECIFIC_CPP_STDLIB_PATH: ${{ needs.set-env.outputs.arch_specific_cpp_stdlib_path }} GENERIC_CPP_STDLIB_PATH: ${{ needs.set-env.outputs.generic_cpp_stdlib_path }} diff --git a/Cargo.toml b/Cargo.toml index c26690a..d4a78c9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,9 +43,7 @@ tokio = { version = "1.35.1", default-features = false, features = ["rt", "rt-mu protobuf = { version = "3.3", features = ["with-bytes"] } up-rust = { version = "0.3.0", default-features = false } up-transport-zenoh = { version = "0.4.0" } -# TODO: Update this to dmacattack version for test -up-transport-vsomeip = { git = "https://github.com/PLeVasseur/up-client-vsomeip-rust", branch = "add-build-script_update-up-rust-version", default-features = false } -# up-transport-vsomeip = { git = "https://github.com/eclipse-uprotocol/up-transport-vsomeip-rust.git", tag = "v0.3.0", default-features = false } +up-transport-vsomeip = { version = "0.4.1", default-features = false } up-transport-mqtt5 = { version = "0.2.0" } zenoh = { version = "1.0.0", features = ["default", "plugins"] } zenoh-core = { version = "1.0.0" } From b2ef2c33b8efc929c40f80efdee2e4ecccc38a63 Mon Sep 17 00:00:00 2001 From: Pete LeVasseur Date: Tue, 4 Mar 2025 03:28:59 +0900 Subject: [PATCH 6/7] Add copyright notice to envsetup.sh --- build/envsetup.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build/envsetup.sh b/build/envsetup.sh index 28a364e..f4dbe67 100755 --- a/build/envsetup.sh +++ b/build/envsetup.sh @@ -1,5 +1,16 @@ #!/bin/bash # +# Copyright (c) 2025 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# # to set environment variables for c++ stdlib paths: # $ source build/envsetup.sh # From 298ac22663c09324923a090753983e66431859ba Mon Sep 17 00:00:00 2001 From: Pete LeVasseur Date: Tue, 4 Mar 2025 03:44:52 +0900 Subject: [PATCH 7/7] Update README.md on how to build using either config.toml or envsetup.sh --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a47e332..9d23656 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,11 @@ cargo build You'll need to use the feature flags `vsomeip-transport`, `zenoh-transport` or `mqtt-transport` depending on which implementation you want to build. You then also have the option of including your own vsomeip or using one bundled in `up-transport-vsomeip`. -For the bundled option, set the following environment variables (for example in your .cargo/config.toml file): +For the bundled option, you have two options to set environment variables needed. + +#### Using `config.toml` + +Set the following environment variables (for example in your .cargo/config.toml file): ```toml [env] @@ -45,6 +49,16 @@ ARCH_SPECIFIC_CPP_STDLIB_PATH=