Skip to content

Commit

Permalink
Merge branch 'master' into feature/enable_uart_logging
Browse files Browse the repository at this point in the history
  • Loading branch information
arun-silabs authored Feb 29, 2024
2 parents 780b13f + b427981 commit a96538c
Show file tree
Hide file tree
Showing 272 changed files with 6,653 additions and 1,897 deletions.
2 changes: 2 additions & 0 deletions .github/actions/checkout-submodules-and-bootstrap/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ inputs:
runs:
using: "composite"
steps:
- name: Maximize runner disk
uses: ./.github/actions/maximize-runner-disk
- name: Dump disk info
uses: ./.github/actions/dump-disk-info
- name: Set git safe directory for local act runs
Expand Down
50 changes: 50 additions & 0 deletions .github/actions/maximize-runner-disk/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Maximize runner disk
description: Free up disk space on the github runner
runs:
using: "composite"
steps:
- name: Free up disk space on the github runner
if: ${{ !env.ACT }}
shell: bash
run: |
# maximize-runner-disk
if [[ "$RUNNER_OS" == Linux ]]; then
# Directories to prune to free up space. Candidates:
# 1.6G /usr/share/dotnet
# 1.1G /usr/local/lib/android/sdk/platforms
# 1000M /usr/local/lib/android/sdk/build-tools
# 8.9G /usr/local/lib/android/sdk
# This list can be amended later to change the trade-off between the amount of
# disk space freed up, and how long it takes to do so (deleting many files is slow).
prune=(/usr/share/dotnet /usr/local/lib/android/sdk/platforms /usr/local/lib/android/sdk/build-tools)
if [[ "$UID" -eq 0 && -d /__w ]]; then
root=/runner-root-volume
if [[ ! -d "$root" ]]; then
echo "Unable to maximize disk space, job is running inside a container and $root is not mounted"
exit 0
fi
function sudo() { "$@"; } # we're already root (and sudo is probably unavailable)
elif [[ "$UID" -ne 0 && "$RUNNER_ENVIRONMENT" == github-hosted ]]; then
root=
else
echo "Unable to maximize disk space, unknown runner environment"
exit 0
fi
echo "Freeing up runner disk space on ${root:-/}"
function avail() { df -k --output=avail "${root:-/}" | grep '^[0-9]*$'; }
function now() { date '+%s'; }
before="$(avail)" start="$(now)"
for dir in "${prune[@]}"; do
if [[ -d "${root}${dir}" ]]; then
echo "- $dir"
# du -sh -- "${root}${dir}"
sudo rm -rf -- "${root}${dir}"
else
echo "- $dir (not found)"
fi
done
after="$(avail)" end="$(now)"
echo "Done, freed up $(( (after - before) / 1024 ))M of disk space in $(( end - start )) seconds."
fi
5 changes: 5 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
container:
image: ghcr.io/project-chip/chip-build:35
volumes:
- "/:/runner-root-volume"
- "/tmp/log_output:/tmp/test_logs"
options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"
Expand Down Expand Up @@ -137,6 +138,7 @@ jobs:
container:
image: ghcr.io/project-chip/chip-build:35
volumes:
- "/:/runner-root-volume"
- "/tmp/log_output:/tmp/test_logs"
options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"
Expand Down Expand Up @@ -285,6 +287,7 @@ jobs:
container:
image: ghcr.io/project-chip/chip-build:35
volumes:
- "/:/runner-root-volume"
- "/tmp/log_output:/tmp/test_logs"
options: --sysctl "net.ipv6.conf.all.disable_ipv6=0
net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"
Expand Down Expand Up @@ -345,6 +348,7 @@ jobs:
container:
image: ghcr.io/project-chip/chip-build:35
volumes:
- "/:/runner-root-volume"
- "/tmp/log_output:/tmp/test_logs"
options: --sysctl "net.ipv6.conf.all.disable_ipv6=0
net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"
Expand Down Expand Up @@ -453,6 +457,7 @@ jobs:
container:
image: ghcr.io/project-chip/chip-build:35
volumes:
- "/:/runner-root-volume"
- "/tmp/log_output:/tmp/test_logs"
options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/darwin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,10 @@ jobs:
run: |
xcodebuild -target "MatterTvCastingBridge" -sdk iphoneos
working-directory: examples/tv-casting-app/darwin/MatterTvCastingBridge
- name: Uploading .ips files in Xcode derived data to debug the failure
uses: actions/upload-artifact@v4
if: ${{ failure() && !env.ACT }}
with:
name: darwin-framework-derived-data
path: ~/Library/Developer/Xcode/DerivedData/**/*.ips
retention-days: 5
- name: Collect crash logs
run: |
mkdir -p /tmp/darwin/framework-tests
find ~/Library/Developer/Xcode/DerivedData /Library/Logs/DiagnosticReports -name '*.ips' -print0 | xargs -0 -J % cp % /tmp/darwin/framework-tests
- name: Uploading log files
uses: actions/upload-artifact@v4
if: ${{ failure() && !env.ACT }}
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/java-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,17 @@ jobs:
--tool-cluster "im" \
--tool-args "onnetwork-long-im-invoke --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 1000" \
--factoryreset \
'
- name: Run IM Extendable Invoke Test
run: |
scripts/run_in_python_env.sh out/venv \
'./scripts/tests/run_java_test.py \
--app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \
--app-args "--discriminator 3840 --interface-id -1" \
--tool-path out/linux-x64-java-matter-controller \
--tool-cluster "im" \
--tool-args "onnetwork-long-im-extendable-invoke --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 1000" \
--factoryreset \
'
- name: Run IM Read Test
run: |
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ jobs:
--known-failure app/CommandHandler.h \
--known-failure app/CommandHandlerInterface.h \
--known-failure app/CommandSenderLegacyCallback.h \
--known-failure app/CompatEnumNames.h \
--known-failure app/data-model/ListLargeSystemExtensions.h \
--known-failure app/EventHeader.h \
--known-failure app/EventLoggingTypes.h \
Expand All @@ -114,7 +113,6 @@ jobs:
--known-failure app/util/attribute-table.h \
--known-failure app/util/binding-table.cpp \
--known-failure app/util/binding-table.h \
--known-failure app/util/common.h \
--known-failure app/util/config.h \
--known-failure app/util/DataModelHandler.cpp \
--known-failure app/util/DataModelHandler.h \
Expand Down Expand Up @@ -205,7 +203,7 @@ jobs:
# TODO: TLVDebug should ideally not be excluded here.
# TODO: protocol_decoder.cpp should ideally not be excluded here.
# TODO: PersistentStorageMacros.h should ideally not be excluded here.
git grep -I -n "PRI.64" -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)examples/chip-tool' ':(exclude)examples/tv-casting-app' ':(exclude)src/app/MessageDef/MessageDefHelper.cpp' ':(exclude)src/app/tests/integration/chip_im_initiator.cpp' ':(exclude)src/lib/core/TLVDebug.cpp' ':(exclude)src/lib/dnssd/tests/TestTxtFields.cpp' ':(exclude)src/lib/format/protocol_decoder.cpp' ':(exclude)src/lib/support/PersistentStorageMacros.h' ':(exclude)src/messaging/tests/echo/echo_requester.cpp' ':(exclude)src/platform/Linux' ':(exclude)src/platform/Ameba' ':(exclude)src/platform/ESP32' ':(exclude)src/platform/webos' ':(exclude)zzz_generated/chip-tool' ':(exclude)src/tools/chip-cert/Cmd_PrintCert.cpp' && exit 1 || exit 0
git grep -I -n "PRI.64" -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)examples/chip-tool' ':(exclude)examples/tv-casting-app' ':(exclude)src/app/MessageDef/MessageDefHelper.cpp' ':(exclude)src/app/tests/integration/chip_im_initiator.cpp' ':(exclude)src/lib/core/TLVDebug.cpp' ':(exclude)src/lib/dnssd/tests/TestTxtFields.cpp' ':(exclude)src/lib/format/protocol_decoder.cpp' ':(exclude)src/lib/support/PersistentStorageMacros.h' ':(exclude)src/messaging/tests/echo/echo_requester.cpp' ':(exclude)src/platform/Linux' ':(exclude)src/platform/Ameba' ':(exclude)src/platform/ESP32' ':(exclude)src/platform/Darwin' ':(exclude)src/darwin' ':(exclude)src/platform/webos' ':(exclude)zzz_generated/chip-tool' ':(exclude)src/tools/chip-cert/Cmd_PrintCert.cpp' && exit 1 || exit 0
# git grep exits with 0 if it finds a match, but we want
# to fail (exit nonzero) on match. And we want to exclude this file,
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/smoketest-android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
container:
image: ghcr.io/project-chip/chip-build-android:35
volumes:
- "/:/runner-root-volume"
- "/tmp/log_output:/tmp/test_logs"

steps:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/unit_integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
container:
image: ghcr.io/project-chip/chip-build:35
volumes:
- "/:/runner-root-volume"
- "/tmp/log_output:/tmp/test_logs"
options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"

Expand Down
55 changes: 3 additions & 52 deletions build/chip/chip_codegen.gni
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ template("_chip_build_time_zapgen") {
_output_subdir = "zap-generated"
}

pw_python_action("${_name}_zap_pregen") {
pw_python_action("${_name}_zap") {
script = "${chip_root}/scripts/tools/zap/generate.py"

# TODO: this seems to touch internals. Is this ok? speeds up builds!
Expand All @@ -165,7 +165,7 @@ template("_chip_build_time_zapgen") {
"--templates",
_template_path,
"--output-dir",
rebase_path(target_gen_dir) + "/zap_pregen/" + _output_subdir,
rebase_path(target_gen_dir) + "/zapgen/" + _output_subdir,

# TODO: lock file support should be removed as this serializes zap
# (slower), however this is currently done because on Darwin zap startup
Expand All @@ -188,54 +188,10 @@ template("_chip_build_time_zapgen") {

sources = [ _idl_file ]

outputs = []
foreach(name, invoker.outputs) {
outputs += [ "${target_gen_dir}/zap_pregen/${name}" ]
}

forward_variables_from(invoker, [ "prune_outputs" ])
if (defined(prune_outputs)) {
foreach(name, prune_outputs) {
outputs += [ "${target_gen_dir}/zap_pregen/${name}" ]
}
}
}

# This action ensures that any "extra" files generated by zap codegen
# are actually deleted.
#
# This is to avoid double-codegen of configurations like endpoint config
# or access credentials being generated for both "controller client" and
# application-specific
pw_python_action("${_name}_files") {
# TODO: this seems to touch internals. Is this ok? speeds up builds!
_pw_internal_run_in_venv = false

script = "${chip_root}/scripts/tools/zap/prune_outputs.py"

_keep_file = rebase_path("${target_gen_dir}/${_name}.keep.outputs")
write_file(_keep_file, invoker.outputs, "list lines")

args = [
"--keep",
_keep_file,
"--input-dir",
rebase_path("${target_gen_dir}/zap_pregen/"),
"--output-dir",
rebase_path("${target_gen_dir}/zapgen/"),
]

inputs = []
foreach(name, invoker.outputs) {
inputs += [ "${target_gen_dir}/zap_pregen/${name}" ]
}

outputs = []
foreach(name, invoker.outputs) {
outputs += [ "${target_gen_dir}/zapgen/${name}" ]
}

deps = [ ":${_name}_zap_pregen" ]
}

source_set(_name) {
Expand All @@ -255,10 +211,7 @@ template("_chip_build_time_zapgen") {
if (!defined(public_deps)) {
public_deps = []
}
public_deps += [
":${_name}_files",
":${_name}_zap_pregen",
]
public_deps += [ ":${_name}_zap" ]
}
}

Expand Down Expand Up @@ -420,7 +373,6 @@ template("chip_zapgen") {
"input",
"outputs",
"public_configs",
"prune_outputs",
])
}
} else {
Expand Down Expand Up @@ -482,7 +434,6 @@ template("chip_zapgen") {
[
"deps",
"public_configs",
"prune_outputs",
])
if (!defined(public_configs)) {
public_configs = []
Expand Down
11 changes: 4 additions & 7 deletions build/config/BUILDCONFIG.gn
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ if (_chip_defaults.custom_toolchain != "") {
} else {
_target_compiler = "gcc"
}

_default_toolchain = "${_build_overrides.build_root}/toolchain/linux:linux_${target_cpu}_${_target_compiler}"
} else if (target_os == host_os &&
(target_cpu == host_cpu ||
(target_cpu == "arm64e" && host_cpu == "arm64"))) {
} else if (host_os == "mac" && (target_os == "mac" || target_os == "ios")) {
# On Mac the host toolchain supports building for all mac and ios targets
_default_toolchain = host_toolchain
} else if (target_os == host_os && target_cpu == host_cpu) {
_default_toolchain = host_toolchain
} else if (target_os == "freertos") {
if (_chip_defaults.is_clang) {
Expand Down Expand Up @@ -113,9 +113,6 @@ if (_chip_defaults.custom_toolchain != "") {
} else {
assert(false, "Unsupported target_cpu: ${current_cpu}")
}
} else if (target_os == "ios") {
_default_toolchain =
"${_build_overrides.build_root}/toolchain/ios:ios_${target_cpu}"
} else if (target_os == "tizen") {
_default_toolchain =
"${_build_overrides.build_root}/toolchain/tizen:tizen_${target_cpu}"
Expand Down
4 changes: 2 additions & 2 deletions build/config/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ config("cosmetic_default") {
}

config("runtime_default") {
if (is_clang) {
if (is_clang) { # Using Pigweed clang instead of Darwin host clang
configs = [
"$dir_pw_toolchain/host_clang:no_system_libcpp",
"$dir_pw_toolchain/host_clang:xcode_sysroot",
Expand Down Expand Up @@ -402,7 +402,7 @@ config("sanitize_address") {
]
ldflags = cflags

if (target_os == "mac" || target_os == "ios") {
if ((target_os == "mac" || target_os == "ios") && !is_clang) {
defines += [ "_LIBCPP_HAS_NO_ASAN" ]
}
}
Expand Down
19 changes: 19 additions & 0 deletions config/esp32/components/chip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,25 @@ endif()

if(CONFIG_ENABLE_ICD_SERVER)
chip_gn_arg_append("chip_enable_icd_server" "true")
if(CONFIG_ICD_ENFORCE_SIT_SLOW_POLL_LIMIT)
chip_gn_arg_append("icd_enforce_sit_slow_poll_limit" "true")
endif()
if(CONFIG_ICD_REPORT_ON_ACTIVE_MODE)
chip_gn_arg_append("chip_icd_report_on_active_mode" "true")
endif()
if(CONFIG_ENABLE_ICD_LIT)
chip_gn_arg_append("chip_enable_icd_lit" "true")
if(CONFIG_ENABLE_ICD_CIP)
chip_gn_arg_append("chip_enable_icd_checkin" "true")
else()
chip_gn_arg_append("chip_enable_icd_checkin" "false")
endif()
if(CONFIG_ENABLE_ICD_USER_ACTIVE_MODE_TRIGGER)
chip_gn_arg_append("chip_enable_icd_user_active_mode_trigger" "true")
else()
chip_gn_arg_append("chip_enable_icd_user_active_mode_trigger" "false")
endif()
endif()
endif()

if(CONFIG_ENABLE_PW_RPC)
Expand Down
Loading

0 comments on commit a96538c

Please sign in to comment.