Skip to content

Commit

Permalink
Merge branch 'master' into darwin-skip-storing-C-quality-attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
kiel-apple authored May 15, 2024
2 parents 697a01c + eef8ea4 commit 544a45f
Show file tree
Hide file tree
Showing 241 changed files with 27,038 additions and 5,788 deletions.
1 change: 1 addition & 0 deletions .github/.wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,7 @@ NTP
nullable
nullptr
NUM
NuttX
NVM
NVS
nwdiag
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/examples-linux-standalone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,16 @@ jobs:
linux debug air-purifier-app \
out/linux-x64-air-purifier/chip-air-purifier-app \
/tmp/bloat_reports/
- name: Build example Fabric Bridge App
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target linux-x64-fabric-bridge \
build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
linux debug fabric-bridge-app \
out/linux-x64-fabric-bridge/fabric-bridge-app \
/tmp/bloat_reports/
- name: Uploading Size Reports
uses: ./.github/actions/upload-size-reports
if: ${{ !env.ACT }}
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/examples-nuttx.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Copyright (c) 2024 Project CHIP Authors
#
# Licensed 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: Build example - NuttX

on:
push:
pull_request:
merge_group:
workflow_dispatch:

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }}
cancel-in-progress: true

env:
CHIP_NO_LOG_TIMESTAMPS: true

jobs:
nuttx:
name: NuttX

runs-on: ubuntu-latest
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build-nuttx:51
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout submodules & Bootstrap
uses: ./.github/actions/checkout-submodules-and-bootstrap
with:
platform: nuttx
extra-submodule-parameters: " --recursive"
- name: Build example simulator NuttX Lighting App
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target nuttx-x64-light \
build \
"
7 changes: 6 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ jobs:
--skip-dir platform/webos \
--skip-dir platform/Zephyr \
--skip-dir test_driver \
--skip-dir platform/NuttX \
--known-failure app/app-platform/ContentApp.cpp \
--known-failure app/app-platform/ContentApp.h \
--known-failure app/app-platform/ContentAppPlatform.cpp \
Expand Down Expand Up @@ -118,6 +119,10 @@ jobs:
--known-failure app/util/DataModelHandler.h \
--known-failure app/util/ember-compatibility-functions.cpp \
--known-failure app/util/ember-compatibility-functions.h \
--known-failure app/util/ember-global-attribute-access-interface.cpp \
--known-failure app/util/ember-global-attribute-access-interface.h \
--known-failure app/util/ember-io-storage.cpp \
--known-failure app/util/ember-io-storage.h \
--known-failure app/util/endpoint-config-api.h \
--known-failure app/util/generic-callbacks.h \
--known-failure app/util/generic-callback-stubs.cpp \
Expand Down Expand Up @@ -205,7 +210,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/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 -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' ':(exclude)src/platform/NuttX' && 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
14 changes: 13 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,18 @@
"${workspaceFolder}/src/lib/**",
"${workspaceFolder}/src/system/**",
"${workspaceFolder}/third_party/nlassert/repo/include/**",
"${workspaceFolder}/third_party/nlio/repo/include/**"
"${workspaceFolder}/third_party/nlio/repo/include/**",
"${workspaceFolder}/darwin/Framework/CHIP/**",
"${workspaceFolder}/src/messaging/**",
"${workspaceFolder}/src/protocols/**",
"${workspaceFolder}/src/tracing/**",
"${workspaceFolder}/src/transport/**",
"${workspaceFolder}/src/inet/**",
"${workspaceFolder}/src/credentials/**",
"${workspaceFolder}/src/data_model/**",
"${workspaceFolder}/src/app/**",
"${workspaceFolder}/src/crytpo/**",
"${workspaceFolder}/src/platform/**"
],
"[cpp]": {
"editor.defaultFormatter": "xaver.clang-format"
Expand All @@ -35,6 +46,7 @@
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"files.associations": {
"*.mm": "cpp",
"iostream": "cpp",
"array": "cpp",
"atomic": "cpp",
Expand Down
5 changes: 5 additions & 0 deletions build/config/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,11 @@ config("strict_warnings") {

cflags_cc = [ "-Wnon-virtual-dtor" ]

if (current_os == "nuttx") {
cflags -= [ "-Wshadow" ]
cflags_cc -= [ "-Wnon-virtual-dtor" ]
}

configs = []
ldflags = []

Expand Down
12 changes: 6 additions & 6 deletions config/esp32/components/chip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1232,47 +1232,47 @@ menu "CHIP Device Layer"
menu "Message Reliable Protocol Options"
config MRP_LOCAL_ACTIVE_RETRY_INTERVAL_FOR_THREAD
int "MRP local active retry interval for Thread network in milliseconds"
depends on OPENTHREAD_ENABLED
depends on ENABLE_MATTER_OVER_THREAD
range 0 3600000
default 800
help
Base retry interval of the present Thread node when it is in the active state.

config MRP_LOCAL_ACTIVE_RETRY_INTERVAL_FOR_WIFI_ETHERNET
int "MRP local active retry interval for WIFI or ETHERNET network in milliseconds"
depends on !OPENTHREAD_ENABLED
depends on !ENABLE_MATTER_OVER_THREAD
range 0 3600000
default 300
help
Base retry interval of the present node (WIFI or ETHERNET) when it is in the active state.

config MRP_LOCAL_IDLE_RETRY_INTERVAL_FOR_THREAD
int "MRP local idle retry interval for Thread network in milliseconds"
depends on OPENTHREAD_ENABLED
depends on ENABLE_MATTER_OVER_THREAD
range 0 3600000
default 800
help
Base retry interval of the present Thread node when it is in the idle state.

config MRP_LOCAL_IDLE_RETRY_INTERVAL_FOR_WIFI_ETHERNET
int "MRP local idle retry interval for WIFI or ETHERNET network in milliseconds"
depends on !OPENTHREAD_ENABLED
depends on !ENABLE_MATTER_OVER_THREAD
range 0 3600000
default 500
help
Base retry interval of the present node (WIFI or ETHERNET) when it is in the idle state.

config MRP_RETRY_INTERVAL_SENDER_BOOST_FOR_THREAD
int "MRP retransmission delta timeout for Thread network in milliseconds"
depends on OPENTHREAD_ENABLED
depends on ENABLE_MATTER_OVER_THREAD
range 0 3600000
default 500
help
A constant value added to the calculated retransmission timeout.

config MRP_RETRY_INTERVAL_SENDER_BOOST_FOR_WIFI_ETHERNET
int "MRP retransmission delta timeout for WIFI or ETHERNET network in milliseconds"
depends on !OPENTHREAD_ENABLED
depends on !ENABLE_MATTER_OVER_THREAD
range 0 3600000
default 0
help
Expand Down
29 changes: 29 additions & 0 deletions config/nuttx/chip-gn/.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright (c) 2024 Project CHIP Authors
#
# Licensed 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.

import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")

# The location of the build configuration file.
buildconfig = "${build_root}/config/BUILDCONFIG.gn"

# CHIP uses angle bracket includes.
check_system_includes = true

default_args = {
target_cpu = ""
target_os = "nuttx"

import("${chip_root}/config/nuttx/chip-gn/args.gni")
}
57 changes: 57 additions & 0 deletions config/nuttx/chip-gn/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Copyright (c) 2024 Project CHIP Authors
#
# Licensed 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.

import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")

import("${chip_root}/build/chip/tests.gni")

assert(current_os == "nuttx")

declare_args() {
chip_build_example_providers = false
chip_example_lighting = false
}

static_library("nuttx") {
output_name = "libchipnuttx"

public_deps = [
"${chip_root}/examples/platform/linux:app-main",
"${chip_root}/src/lib",
]

if (chip_build_tests) {
public_deps += [ "${chip_root}/src:tests" ]
}

if (chip_build_example_providers) {
public_deps += [ "${chip_root}/examples/providers:device_info_provider" ]
}

if (chip_example_lighting) {
public_deps += [
"${chip_root}/examples/lighting-app/lighting-common",
"${chip_root}/examples/lighting-app/lighting-common:lighting-manager",
]
}

output_dir = "${root_out_dir}/lib"

complete_static_lib = true
}

group("default") {
deps = [ ":nuttx" ]
}
32 changes: 32 additions & 0 deletions config/nuttx/chip-gn/args.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright (c) 2024 Project CHIP Authors
#
# Licensed 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.

import("//build_overrides/chip.gni")

import("${chip_root}/src/crypto/crypto.gni")

chip_device_platform = "nuttx"

chip_build_tests = false

chip_project_config_include = ""
chip_system_project_config_include = ""
chip_ble_project_config_include = ""

chip_crypto = "mbedtls"
chip_external_mbedtls = true

custom_toolchain = "${chip_root}/config/nuttx/chip-gn/toolchain:nuttx"

pw_build_PIP_CONSTRAINTS = [ "${chip_root}/scripts/setup/constraints.txt" ]
33 changes: 33 additions & 0 deletions config/nuttx/chip-gn/toolchain/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright (c) 2024 Project CHIP Authors
#
# Licensed 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.

import("//build/toolchain/gcc_toolchain.gni")
import("//build_overrides/build.gni")

declare_args() {
nuttx_ar = ""
nuttx_cc = ""
nuttx_cxx = ""
}

gcc_toolchain("nuttx") {
ar = nuttx_ar
cc = nuttx_cc
cxx = nuttx_cxx

toolchain_args = {
current_os = "nuttx"
is_clang = false
}
}
2 changes: 1 addition & 1 deletion examples/chip-tool/commands/common/Command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ bool HandleNullableOptional(Argument & arg, char * argValue, std::function<bool(
if (arg.isNullable())
{
auto * nullable = reinterpret_cast<chip::app::DataModel::Nullable<T> *>(arg.value);
if (strcmp(argValue, "null") == 0)
if (argValue != nullptr && strncmp(argValue, "null", 4) == 0)
{
nullable->SetNull();
return true;
Expand Down
25 changes: 25 additions & 0 deletions examples/fabric-admin/.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (c) 2024 Project CHIP Authors
#
# Licensed 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.

import("//build_overrides/build.gni")

# The location of the build configuration file.
buildconfig = "${build_root}/config/BUILDCONFIG.gn"

# CHIP uses angle bracket includes.
check_system_includes = true

default_args = {
import("//args.gni")
}
Loading

0 comments on commit 544a45f

Please sign in to comment.