From 8b0d58d5d00f2120e719e484aaa7d290b0e12ac0 Mon Sep 17 00:00:00 2001 From: Alex Tsitsiura Date: Thu, 14 Sep 2023 13:26:28 +0300 Subject: [PATCH 1/6] [Telink] remove unused tools build files during app build --- .github/workflows/examples-telink.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index f7ddf8dc340e1d..7bfbda367d8798 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -104,9 +104,9 @@ jobs: - name: Build example Telink (B91) Lighting App with RPC, Shell and Factory Data run: | - ./scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux ./scripts/build/gn_gen.sh ./scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE chip-cert chip-tool spake2p" + (cd ./out/$BUILD_TYPE && rm -rf !("chip-cert"|"chip-tool"|"spake2p")) ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-rpc-shell-factory-data' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ @@ -114,6 +114,9 @@ jobs: out/telink-tlsr9518adk80d-light-rpc-shell-factory-data/zephyr/zephyr.elf \ /tmp/bloat_reports/ + - name: clean out build output (keep tools) + run: rm -rf ./out/telink-tlsr* + - name: Build example Telink (B92) Lighting App with RPC, Shell and Factory Data run: | ./scripts/run_in_build_env.sh \ From 6a182c3b9e2e6cc369f59d63ac336f142c6576e2 Mon Sep 17 00:00:00 2001 From: Alex Tsitsiura Date: Thu, 14 Sep 2023 14:01:51 +0300 Subject: [PATCH 2/6] [Telink] restore required checkout_submodules --- .github/workflows/examples-telink.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index 7bfbda367d8798..f3565f6cb4b9a6 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -104,6 +104,7 @@ jobs: - name: Build example Telink (B91) Lighting App with RPC, Shell and Factory Data run: | + ./scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux ./scripts/build/gn_gen.sh ./scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE chip-cert chip-tool spake2p" (cd ./out/$BUILD_TYPE && rm -rf !("chip-cert"|"chip-tool"|"spake2p")) From 2ac885f43c5fd5f455281bdaf729caea2c2c121e Mon Sep 17 00:00:00 2001 From: Alex Tsitsiura Date: Thu, 14 Sep 2023 14:44:44 +0300 Subject: [PATCH 3/6] [Telink] rework due to CI syntax error --- .github/workflows/examples-telink.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index f3565f6cb4b9a6..9ed390c691503d 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -102,12 +102,17 @@ jobs: - name: clean out build output run: rm -rf ./out - - name: Build example Telink (B91) Lighting App with RPC, Shell and Factory Data + - name: Build tools required for factory data run: | ./scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux ./scripts/build/gn_gen.sh ./scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE chip-cert chip-tool spake2p" - (cd ./out/$BUILD_TYPE && rm -rf !("chip-cert"|"chip-tool"|"spake2p")) + + - name: clean out build output (keep tools) + run: cd ./out/$BUILD_TYPE && rm -rf !("chip-cert"|"chip-tool"|"spake2p") + + - name: Build example Telink (B91) Lighting App with RPC, Shell and Factory Data + run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-rpc-shell-factory-data' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ From c7550eb5a18f9c7bb836d12729fe6b769ab75216 Mon Sep 17 00:00:00 2001 From: Alex Tsitsiura Date: Thu, 14 Sep 2023 16:17:23 +0300 Subject: [PATCH 4/6] [Telink] use GLOBIGNORE instead of regular expression --- .github/workflows/examples-telink.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index 9ed390c691503d..37126961fe5276 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -102,14 +102,16 @@ jobs: - name: clean out build output run: rm -rf ./out - - name: Build tools required for factory data + - name: Build tools required for Factory Data run: | ./scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux ./scripts/build/gn_gen.sh ./scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE chip-cert chip-tool spake2p" - name: clean out build output (keep tools) - run: cd ./out/$BUILD_TYPE && rm -rf !("chip-cert"|"chip-tool"|"spake2p") + run: | + GLOBIGNORE=chip-cert:chip-tool:spake2p + cd ./out/$BUILD_TYPE && rm -rf * - name: Build example Telink (B91) Lighting App with RPC, Shell and Factory Data run: | From 608807c06ba8bc0cfb202bef20972c7c35b457c8 Mon Sep 17 00:00:00 2001 From: Alex Tsitsiura Date: Thu, 14 Sep 2023 18:52:33 +0300 Subject: [PATCH 5/6] [Telink] use separate folder (GLOBIGNORE doesn't work in CI) --- .github/workflows/examples-telink.yaml | 8 ++++---- config/telink/chip-module/generate_factory_data.cmake | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index 37126961fe5276..e65f5d97f383d8 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -107,11 +107,11 @@ jobs: ./scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux ./scripts/build/gn_gen.sh ./scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE chip-cert chip-tool spake2p" + mkdir ./out/tools + mv ./out/$BUILD_TYPE/chip-cert ./out/$BUILD_TYPE/chip-tool ./out/$BUILD_TYPE/spake2p ./out/tools - name: clean out build output (keep tools) - run: | - GLOBIGNORE=chip-cert:chip-tool:spake2p - cd ./out/$BUILD_TYPE && rm -rf * + run: rm -rf ./out/telink* - name: Build example Telink (B91) Lighting App with RPC, Shell and Factory Data run: | @@ -123,7 +123,7 @@ jobs: /tmp/bloat_reports/ - name: clean out build output (keep tools) - run: rm -rf ./out/telink-tlsr* + run: rm -rf ./out/telink* - name: Build example Telink (B92) Lighting App with RPC, Shell and Factory Data run: | diff --git a/config/telink/chip-module/generate_factory_data.cmake b/config/telink/chip-module/generate_factory_data.cmake index 7798f101982787..36111f4970d490 100644 --- a/config/telink/chip-module/generate_factory_data.cmake +++ b/config/telink/chip-module/generate_factory_data.cmake @@ -69,7 +69,7 @@ else() endif() # find chip cert tool -find_program(chip_cert_exe NAMES chip-cert PATHS ${CHIP_ROOT}/out/telink REQUIRED) +find_program(chip_cert_exe NAMES chip-cert PATHS ${CHIP_ROOT}/out/tools REQUIRED) string(APPEND script_args "--chip-cert-path ${chip_cert_exe}\n") # for development purpose user can use default certs instead of generating or providing them @@ -99,7 +99,7 @@ else() endif() # find chip tool requied for generating QRCode -find_program(chip_tool_exe NAMES chip-tool PATHS ${CHIP_ROOT}/out/telink REQUIRED) +find_program(chip_tool_exe NAMES chip-tool PATHS ${CHIP_ROOT}/out/tools REQUIRED) string(APPEND script_args "--chip-tool-path ${chip_tool_exe}\n") # add Password-Authenticated Key Exchange parameters @@ -108,7 +108,7 @@ string(APPEND script_args "--discriminator ${CONFIG_CHIP_DEVICE_DISCRIMINATOR}\n string(APPEND script_args "--passcode ${CONFIG_CHIP_DEVICE_SPAKE2_PASSCODE}\n") # request spake2p to generate a new spake2_verifier -find_program(spake_exe NAMES spake2p PATHS ${CHIP_ROOT}/out/telink REQUIRED) +find_program(spake_exe NAMES spake2p PATHS ${CHIP_ROOT}/out/tools REQUIRED) string(APPEND script_args "--spake2-path ${spake_exe}\n") if(CONFIG_CHIP_DEVICE_ENABLE_KEY) From 8ac0682b1a5c6efde05818dac897fd046c3ffb19 Mon Sep 17 00:00:00 2001 From: Alex Tsitsiura Date: Thu, 14 Sep 2023 19:00:03 +0300 Subject: [PATCH 6/6] [Telink] use just out folder --- .github/workflows/examples-telink.yaml | 3 +-- config/telink/chip-module/generate_factory_data.cmake | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index e65f5d97f383d8..ce56a06b25db37 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -107,8 +107,7 @@ jobs: ./scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux ./scripts/build/gn_gen.sh ./scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE chip-cert chip-tool spake2p" - mkdir ./out/tools - mv ./out/$BUILD_TYPE/chip-cert ./out/$BUILD_TYPE/chip-tool ./out/$BUILD_TYPE/spake2p ./out/tools + mv ./out/$BUILD_TYPE/chip-cert ./out/$BUILD_TYPE/chip-tool ./out/$BUILD_TYPE/spake2p ./out - name: clean out build output (keep tools) run: rm -rf ./out/telink* diff --git a/config/telink/chip-module/generate_factory_data.cmake b/config/telink/chip-module/generate_factory_data.cmake index 36111f4970d490..9ba1903266c2dc 100644 --- a/config/telink/chip-module/generate_factory_data.cmake +++ b/config/telink/chip-module/generate_factory_data.cmake @@ -69,7 +69,7 @@ else() endif() # find chip cert tool -find_program(chip_cert_exe NAMES chip-cert PATHS ${CHIP_ROOT}/out/tools REQUIRED) +find_program(chip_cert_exe NAMES chip-cert PATHS ${CHIP_ROOT}/out REQUIRED) string(APPEND script_args "--chip-cert-path ${chip_cert_exe}\n") # for development purpose user can use default certs instead of generating or providing them @@ -99,7 +99,7 @@ else() endif() # find chip tool requied for generating QRCode -find_program(chip_tool_exe NAMES chip-tool PATHS ${CHIP_ROOT}/out/tools REQUIRED) +find_program(chip_tool_exe NAMES chip-tool PATHS ${CHIP_ROOT}/out REQUIRED) string(APPEND script_args "--chip-tool-path ${chip_tool_exe}\n") # add Password-Authenticated Key Exchange parameters @@ -108,7 +108,7 @@ string(APPEND script_args "--discriminator ${CONFIG_CHIP_DEVICE_DISCRIMINATOR}\n string(APPEND script_args "--passcode ${CONFIG_CHIP_DEVICE_SPAKE2_PASSCODE}\n") # request spake2p to generate a new spake2_verifier -find_program(spake_exe NAMES spake2p PATHS ${CHIP_ROOT}/out/tools REQUIRED) +find_program(spake_exe NAMES spake2p PATHS ${CHIP_ROOT}/out REQUIRED) string(APPEND script_args "--spake2-path ${spake_exe}\n") if(CONFIG_CHIP_DEVICE_ENABLE_KEY)