Skip to content

Commit

Permalink
Merge branch 'master' into telink-shell-factoryreset
Browse files Browse the repository at this point in the history
  • Loading branch information
s07641069 authored Dec 1, 2022
2 parents 80d1dde + b46af33 commit ce9582b
Show file tree
Hide file tree
Showing 278 changed files with 21,057 additions and 19,929 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,28 @@ jobs:
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --no-log-timestamps \
--target linux-x64-all-clusters-ipv6only-clang \
--target linux-x64-chip-tool-ipv6only-clang \
--target linux-x64-minmdns-ipv6only-clang \
--target linux-x64-rpc-console \
build \
"
- name: Create a pre-generate directory and ensure compile-time codegen would fail
run: |
./scripts/run_in_build_env.sh "./scripts/codepregen.py ./zzz_pregenerated"
mv scripts/codegen.py scripts/codegen.py.renamed
- name: Build using build_examples.py (pregen)
timeout-minutes: 60
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --no-log-timestamps \
--target linux-x64-all-clusters-ipv6only-clang \
--target linux-x64-chip-tool-ipv6only-clang \
--pregen-dir ./zzz_pregenerated \
build \
"
- name: Undo code pre-generation changes (make compile time codegen work again)
run: |
rm -rf ./zzz_pregenerated
mv scripts/codegen.py.renamed scripts/codegen.py
- name: Run fake linux tests with build_examples
timeout-minutes: 15
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/examples-bouffalolab.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: connectedhomeip/chip-build:0.6.06
image: connectedhomeip/chip-build-bouffalolab:0.6.12
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
steps:
Expand All @@ -44,7 +44,7 @@ jobs:
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform bl602
run: scripts/checkout_submodules.py --shallow --platform bouffalolab --recursive

- name: Set up environment for size reports
if: ${{ !env.ACT }}
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: connectedhomeip/chip-build:0.6.06
image: connectedhomeip/chip-build-bouffalolab:0.6.12
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
steps:
Expand All @@ -100,7 +100,7 @@ jobs:
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform bouffalolab
run: scripts/checkout_submodules.py --shallow --platform bouffalolab --recursive

- name: Set up environment for size reports
if: ${{ !env.ACT }}
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/examples-esp32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,29 @@ jobs:
"./scripts/build/build_examples.py \
--enable-flashbundle \
--target esp32-m5stack-all-clusters \
build \
--copy-artifacts-to out/artifacts \
"
- name: Prepare code pregen and ensure compile time pregen not possible
run: |
./scripts/run_in_build_env.sh "./scripts/codepregen.py ./zzz_pregenerated"
mv scripts/codegen.py scripts/codegen.py.renamed
- name: Build some M5Stack variations with pregen
timeout-minutes: 60
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--enable-flashbundle \
--target esp32-m5stack-all-clusters-minimal \
--target esp32-m5stack-all-clusters-rpc-ipv6only \
--pregen-dir ./zzz_pregenerated \
build \
--copy-artifacts-to out/artifacts \
"
- name: Undo code pregeneration changes
run: |
rm -rf ./zzz_pregenerated
mv scripts/codegen.py.renamed scripts/codegen.py
- name: Prepare bloat report
run: |
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/zap_regeneration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

runs-on: ubuntu-20.04
container:
image: connectedhomeip/chip-build:0.6.11
image: connectedhomeip/chip-build:0.6.15
defaults:
run:
shell: sh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/zap_templates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

runs-on: ubuntu-20.04
container:
image: connectedhomeip/chip-build:0.6.11
image: connectedhomeip/chip-build:0.6.15
defaults:
run:
shell: sh
Expand Down
14 changes: 7 additions & 7 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
path = third_party/freertos/repo
url = https://github.com/FreeRTOS/FreeRTOS-Kernel.git
branch = V10.3.1-kernel-only
platforms = ameba,cc13x2_26x2,bl602,efr32,esp32,k32w0,infineon,qpg
platforms = ameba,cc13x2_26x2,bouffalolab,efr32,esp32,k32w0,infineon,qpg
[submodule "simw-top-mini"]
path = third_party/simw-top-mini/repo
url = https://github.com/NXP/plug-and-trust.git
Expand Down Expand Up @@ -264,11 +264,6 @@
[submodule "third_party/boringssl/repo/src"]
path = third_party/boringssl/repo/src
url = https://github.com/google/boringssl.git
[submodule "boufalolab_repo"]
path = third_party/bouffalolab/repo
url = https://github.com/bouffalolab/bl_iot_sdk.git
branch = master
platforms = bouffalolab,bl602
[submodule "third_party/mt793x_sdk/filogic"]
path = third_party/mt793x_sdk/filogic
url = https://github.com/MediaTek-Labs/genio-matter-bsp.git
Expand All @@ -293,4 +288,9 @@
path = third_party/open-iot-sdk/storage
url = https://git.gitlab.arm.com/iot/open-iot-sdk/storage.git
branch = main
platforms = openiotsdk
platforms = openiotsdk
[submodule "bouffalolab_sdk"]
path = third_party/bouffalolab/repo
url = https://github.com/bouffalolab/bl_iot_sdk_tiny.git
branch = main
platforms = bouffalolab
91 changes: 61 additions & 30 deletions build/chip/chip_codegen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,40 +31,71 @@ function(chip_codegen TARGET_NAME)
${ARGN}
)

set(GEN_FOLDER "${CMAKE_BINARY_DIR}/gen/${TARGET_NAME}/${ARG_GENERATOR}")
set(CHIP_CODEGEN_PREGEN_DIR "" CACHE PATH "Pre-generated directory to use instead of compile-time code generation.")

string(REPLACE ";" "\n" OUTPUT_AS_NEWLINES "${ARG_OUTPUTS}")
if ("${CHIP_CODEGEN_PREGEN_DIR}" STREQUAL "")
set(GEN_FOLDER "${CMAKE_BINARY_DIR}/gen/${TARGET_NAME}/${ARG_GENERATOR}")

file(MAKE_DIRECTORY "${GEN_FOLDER}")
file(GENERATE
OUTPUT "${GEN_FOLDER}/expected.outputs"
CONTENT "${OUTPUT_AS_NEWLINES}"
)
string(REPLACE ";" "\n" OUTPUT_AS_NEWLINES "${ARG_OUTPUTS}")

file(MAKE_DIRECTORY "${GEN_FOLDER}")
file(GENERATE
OUTPUT "${GEN_FOLDER}/expected.outputs"
CONTENT "${OUTPUT_AS_NEWLINES}"
)


set(OUT_NAMES)
foreach(NAME IN LISTS ARG_OUTPUTS)
list(APPEND OUT_NAMES "${GEN_FOLDER}/${NAME}")
endforeach()

# Python is expected to be in the path
#
# find_package(Python3 REQUIRED)
add_custom_command(
OUTPUT ${OUT_NAMES}
COMMAND "${CHIP_ROOT}/scripts/codegen.py"
ARGS "--generator" "${ARG_GENERATOR}"
"--output-dir" "${GEN_FOLDER}"
"--expected-outputs" "${GEN_FOLDER}/expected.outputs"
"${ARG_INPUT}"
DEPENDS
"${ARG_INPUT}"
VERBATIM
)

add_custom_target(${TARGET_NAME} DEPENDS "${OUT_NAMES}")

# Forward outputs to the parent
set(${ARG_OUTPUT_FILES} "${OUT_NAMES}" PARENT_SCOPE)
set(${ARG_OUTPUT_PATH} "${GEN_FOLDER}" PARENT_SCOPE)
else()
# Gets a path such as:
# examples/lock-app/lock-common/lock-app.matter
file(RELATIVE_PATH MATTER_FILE_PATH "${CHIP_ROOT}" ${ARG_INPUT})

# Removes the trailing file extension to get something like:
# examples/lock-app/lock-common/lock-app
string(REGEX REPLACE "\.matter$" "" CODEGEN_DIR_PATH "${MATTER_FILE_PATH}")


# Build the final location within the pregen directory
set(GEN_FOLDER "${CHIP_CODEGEN_PREGEN_DIR}/${CODEGEN_DIR_PATH}/codegen/${ARG_GENERATOR}")

# TODO: build a fake target of ${TARGET_NAME}

# Here we have ${CHIP_CODEGEN_PREGEN_DIR}
set(OUT_NAMES)
foreach(NAME IN LISTS ARG_OUTPUTS)
list(APPEND OUT_NAMES "${GEN_FOLDER}/${NAME}")
endforeach()

set(OUT_NAMES)
foreach(NAME IN LISTS ARG_OUTPUTS)
list(APPEND OUT_NAMES "${GEN_FOLDER}/${NAME}")
endforeach()

# Python is expected to be in the path
#
# find_package(Python3 REQUIRED)
add_custom_command(
OUTPUT ${OUT_NAMES}
COMMAND "${CHIP_ROOT}/scripts/codegen.py"
ARGS "--generator" "${ARG_GENERATOR}"
"--output-dir" "${GEN_FOLDER}"
"--expected-outputs" "${GEN_FOLDER}/expected.outputs"
"${ARG_INPUT}"
DEPENDS
"${ARG_INPUT}"
VERBATIM
)

add_custom_target(${TARGET_NAME} DEPENDS "${OUT_NAMES}")
set(${ARG_OUTPUT_FILES} "${OUT_NAMES}" PARENT_SCOPE)
set(${ARG_OUTPUT_PATH} "${GEN_FOLDER}" PARENT_SCOPE)

# Forward outputs to the parent
set(${ARG_OUTPUT_FILES} "${OUT_NAMES}" PARENT_SCOPE)
set(${ARG_OUTPUT_PATH} "${GEN_FOLDER}" PARENT_SCOPE)
# allow adding dependencies to a phony target since no codegen is done
add_custom_target(${TARGET_NAME})
endif()
endfunction()
Loading

0 comments on commit ce9582b

Please sign in to comment.