Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pigweed to the latest version #35644

Merged
merged 56 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from 52 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
08b8a63
Pull latest pigweed
andy31415 Sep 18, 2024
3e8ec2d
Make pigweed pull python 3.11 on macs, to have a consistent build env…
andy31415 Sep 18, 2024
22613fa
Restyle
andy31415 Sep 18, 2024
00a33ac
Remove unused import
andy31415 Sep 18, 2024
8d5dc83
Update signature of WriteLine - this was updated in pigwed to use std…
andy31415 Sep 18, 2024
0702e9b
Workaround for slc errors for efr32
andy31415 Sep 18, 2024
a40c4d0
Disable openssl warning of invalid function cast. This is already cov…
andy31415 Sep 18, 2024
7cb2097
ZAP regen because we change clang-format version
andy31415 Sep 18, 2024
b21f4d4
SystemConfig includes ICDServerBuildConfig.h. Add the dependency as a…
andy31415 Sep 18, 2024
61fb366
Fix typo in WriteLine parameter
andy31415 Sep 18, 2024
d5c2bcf
Restyle
andy31415 Sep 18, 2024
0d19b41
Fix the typo .. again, I had deleted the wrong thing
andy31415 Sep 18, 2024
89cd06d
Look to fix openiot sdk build
andy31415 Sep 18, 2024
01c3972
Restyle
andy31415 Sep 18, 2024
e3b5a6e
Fix clang-tidy: it became stricter on unused arguments
andy31415 Sep 18, 2024
553f26a
Fix tidy run for real this time ... at least one file passes locally
andreilitvin Sep 19, 2024
1e485d9
Different fix for clang-tidy, seems more targeted
andreilitvin Sep 19, 2024
fe3656c
More updates: -S is also a flag that clang tidy would not like accord…
andreilitvin Sep 19, 2024
6faed9a
Fix typo
andreilitvin Sep 19, 2024
c367b6e
Disable two more diagnostics that seem to show up in clang-tidy
andreilitvin Sep 19, 2024
6b3d51c
Need comma for - updated config
andreilitvin Sep 19, 2024
1ebebb6
Fix some clang-tidy findings
andreilitvin Sep 19, 2024
5913fcf
More clang-tidy fixes
andreilitvin Sep 19, 2024
5e12bf9
Generate script update: make sure metadata is generated
andreilitvin Sep 19, 2024
782d872
more tidy and dependency fixes
andreilitvin Sep 19, 2024
f7d234a
more clang tidy make happy updates
andreilitvin Sep 19, 2024
e032868
Restyle
andreilitvin Sep 19, 2024
b537900
Fix too many args error
andreilitvin Sep 19, 2024
d5f96cb
Clean up an odd dependency
andreilitvin Sep 19, 2024
d0d80b6
Signature update for android test functions
andreilitvin Sep 19, 2024
0648959
Fix type cast for android callback on type
andreilitvin Sep 19, 2024
1b388db
Fix the order of checks in TCP endpoint implementations to be what te…
andreilitvin Sep 19, 2024
b83e30e
Fix invalid verify
andreilitvin Sep 19, 2024
5e97ff7
Fix typo
andreilitvin Sep 19, 2024
42413b3
Merge branch 'master' into update_pigweed
andreilitvin Sep 19, 2024
4ce4e49
Additional socket checks for socket inet implementations
andreilitvin Sep 19, 2024
fdda391
Self-review update
andreilitvin Sep 19, 2024
b056580
Merge branch 'check_sockets' into update_pigweed
andreilitvin Sep 19, 2024
8d37429
Undo merge error
andreilitvin Sep 19, 2024
f36610f
Undo pigweed repo loss
andreilitvin Sep 19, 2024
8ebd1fb
One more extra check to make clang-tidy happy
andreilitvin Sep 19, 2024
c17e4f7
One more extra check to make clang-tidy happy
andreilitvin Sep 19, 2024
2a201e0
Merge branch 'check_sockets' into update_pigweed
andreilitvin Sep 19, 2024
d76b473
Switch to nolint
andreilitvin Sep 19, 2024
8e0e206
Merge branch 'check_sockets' into update_pigweed
andreilitvin Sep 19, 2024
2e22776
Avoid large code deltas
andreilitvin Sep 19, 2024
149f2f3
Merge branch 'check_sockets' into update_pigweed
andreilitvin Sep 19, 2024
0255e13
Restyle
andreilitvin Sep 19, 2024
8238c07
Merge branch 'check_sockets' into update_pigweed
andreilitvin Sep 19, 2024
7bcbe62
Restyled by clang-format
restyled-commits Sep 19, 2024
2c71e0b
Merge branch 'check_sockets' into update_pigweed
andreilitvin Sep 19, 2024
ef2c36f
Merge branch 'master' into update_pigweed
andreilitvin Sep 20, 2024
1fafe89
Undo changes to build of attestation_verifier: it seems not needed
andreilitvin Sep 20, 2024
6e00260
Fix for clang-tidy requiring updated template keywords
andreilitvin Sep 20, 2024
41e3165
Fix the template argument ... there is a 2nd invoke type
andreilitvin Sep 20, 2024
1d2bfe9
Another fix
andreilitvin Sep 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Checks: >
-bugprone-multi-level-implicit-pointer-conversion,
-bugprone-narrowing-conversions,
-bugprone-not-null-terminated-result,
-bugprone-pointer-arithmetic-on-polymorphic-object,
-bugprone-reserved-identifier,
-bugprone-signed-char-misuse,
-bugprone-suspicious-include,
Expand All @@ -45,6 +46,7 @@ Checks: >
-clang-analyzer-security.insecureAPI.rand,
-clang-analyzer-security.insecureAPI.strcpy,
-clang-analyzer-unix.Malloc,
-clang-diagnostic-implicit-int-conversion
-clang-diagnostic-implicit-int-conversion,
-clang-diagnostic-missing-template-arg-list-after-template-kw
WarningsAsErrors: '*'
HeaderFilterRegex: '(src|examples|zzz_generated|credentials).*(?<!third_party.*repo)'
2 changes: 1 addition & 1 deletion examples/platform/ameba/pw_sys_io/sys_io_ameba.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Status WriteByte(std::byte b)
}

// Writes a string using pw::sys_io, and add newline characters at the end.
StatusWithSize WriteLine(const std::string_view & s)
StatusWithSize WriteLine(std::string_view s)
{
size_t chars_written = 0;
StatusWithSize result = WriteBytes(pw::as_bytes(pw::span(s)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Status WriteByte(std::byte b)
}

// Writes a string using pw::sys_io, and add newline characters at the end.
StatusWithSize WriteLine(const std::string_view & s)
StatusWithSize WriteLine(std::string_view s)
{
size_t chars_written = 0;
StatusWithSize result = WriteBytes(pw::as_bytes(pw::span(s)));
Expand Down
2 changes: 1 addition & 1 deletion examples/platform/esp32/pw_sys_io/sys_io_esp32.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Status WriteByte(std::byte b)
}

// Writes a string using pw::sys_io, and add newline characters at the end.
StatusWithSize WriteLine(const std::string_view & s)
StatusWithSize WriteLine(std::string_view s)
{
size_t chars_written = 0;
StatusWithSize result = WriteBytes(pw::as_bytes(pw::span(s)));
Expand Down
2 changes: 1 addition & 1 deletion examples/platform/mbed/pw_sys_io/sys_io_mbed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Status WriteByte(std::byte b)
}

// Writes a string using pw::sys_io, and add newline characters at the end.
StatusWithSize WriteLine(const std::string_view & s)
StatusWithSize WriteLine(std::string_view s)
{
size_t chars_written = 0;
StatusWithSize result = WriteBytes(pw::as_bytes(pw::span(s)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Status WriteByte(std::byte b)
}

// Writes a string using pw::sys_io, and add newline characters at the end.
StatusWithSize WriteLine(const std::string_view & s)
StatusWithSize WriteLine(std::string_view s)
{
size_t chars_written = 0;
StatusWithSize result = WriteBytes(pw::as_bytes(pw::span(s)));
Expand Down
2 changes: 1 addition & 1 deletion examples/platform/nxp/pw_sys_io/sys_io_nxp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Status WriteByte(std::byte b)
}

// Writes a string using pw::sys_io, and add newline characters at the end.
StatusWithSize WriteLine(const std::string_view & s)
StatusWithSize WriteLine(std::string_view s)
{
size_t chars_written = 0;
StatusWithSize result = WriteBytes(pw::as_bytes(pw::span(s)));
Expand Down
2 changes: 1 addition & 1 deletion examples/platform/qpg/pw_sys_io/sys_io_qpg.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Status WriteByte(std::byte b)
}

// Writes a string using pw::sys_io, and add newline characters at the end.
StatusWithSize WriteLine(const std::string_view & s)
StatusWithSize WriteLine(std::string_view s)
{
size_t chars_written = 0;
StatusWithSize result = WriteBytes(pw::as_bytes(pw::span(s)));
Expand Down
2 changes: 1 addition & 1 deletion examples/platform/silabs/pw_sys_io/sys_io_silabs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Status WriteByte(std::byte b)
}

// Writes a string using pw::sys_io, and add newline characters at the end.
StatusWithSize WriteLine(const std::string_view & s)
StatusWithSize WriteLine(std::string_view s)
{
size_t chars_written = 0;
StatusWithSize result = WriteBytes(pw::as_bytes(pw::span(s)));
Expand Down
2 changes: 1 addition & 1 deletion examples/platform/telink/pw_sys_io/sys_io_telink.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Status WriteByte(std::byte b)
}

// Writes a string using pw::sys_io, and add newline characters at the end.
StatusWithSize WriteLine(const std::string_view & s)
StatusWithSize WriteLine(std::string_view s)
{
size_t chars_written = 0;
StatusWithSize result = WriteBytes(pw::as_bytes(pw::span(s)));
Expand Down
9 changes: 9 additions & 0 deletions scripts/run-clang-tidy-on-compile-commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@ def __init__(self, json_entry, gcc_sysroot=None):
command_items = shlex.split(command)
compiler = os.path.basename(command_items[0])

# Clang-tidy complains about "unused argument '-c'"
# We could disable that with something like
#
# self.clang_arguments.append("-Wno-unused-command-line-argument")
#
# However that seems to potentially disable a lot, so for now just filter out the
# offending argument
command_items = [arg for arg in command_items if arg not in {'-c', '-S'}]

# Allow gcc/g++ invocations to also be tidied - arguments should be
# compatible and on darwin gcc/g++ is actually a symlink to clang
if compiler in ['clang++', 'clang', 'gcc', 'g++']:
Expand Down
6 changes: 6 additions & 0 deletions scripts/run_codegen_targets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,9 @@ for name in $(ninja -C "$OUT_DIR" -t targets | grep -E 'dbus.*codegen:' | sed 's
echo "Generating $name ..."
ninja -C "$OUT_DIR" "$name"
done

# TLV decoding metadata
for name in $(ninja -C "$OUT_DIR" -t targets | grep -E '_generate' | sed 's/: .*//'); do
echo "Generating $name ..."
ninja -C "$OUT_DIR" "$name"
done
9 changes: 7 additions & 2 deletions scripts/setup/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,15 @@ _bootstrap_or_activate() {
export PW_DOCTOR_SKIP_CIPD_CHECKS=1
export PATH # https://bugs.chromium.org/p/pigweed/issues/detail?id=281

local _PIGWEED_CIPD_JSON="$_CHIP_ROOT/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/cipd_setup/pigweed.json"
local _PIGWEED_CIPD_JSON_ROOT="$_CHIP_ROOT/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/cipd_setup"
local _PIGWEED_CIPD_JSON="$_PIGWEED_CIPD_JSON_ROOT/pigweed.json"
local _PYTHON_CIPD_JSON="$_PIGWEED_CIPD_JSON_ROOT/python311.json"
mkdir -p "$_PW_ACTUAL_ENVIRONMENT_ROOT"
local _GENERATED_PIGWEED_CIPD_JSON="$_PW_ACTUAL_ENVIRONMENT_ROOT/pigweed.json"
$_CHIP_ROOT/scripts/setup/gen_pigweed_cipd_json.py -i $_PIGWEED_CIPD_JSON -o $_GENERATED_PIGWEED_CIPD_JSON
$_CHIP_ROOT/scripts/setup/gen_pigweed_cipd_json.py \
-i $_PIGWEED_CIPD_JSON \
-o $_GENERATED_PIGWEED_CIPD_JSON \
-e darwin:$_PYTHON_CIPD_JSON
bzbarsky-apple marked this conversation as resolved.
Show resolved Hide resolved

if test -n "$GITHUB_ACTION"; then
tee <<EOF >"${_PW_ACTUAL_ENVIRONMENT_ROOT}/pip.conf"
Expand Down
22 changes: 21 additions & 1 deletion scripts/setup/gen_pigweed_cipd_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import argparse
import json
import platform

_LIST_OF_PACKAGES_TO_EXCLUDE = ['fuchsia/third_party/rust/']

Expand All @@ -32,12 +33,26 @@ def include_package(package: dict) -> bool:
return True


def generate_new_cipd_package_json(input, output):
def generate_new_cipd_package_json(input, output, extra):
with open(input) as ins:
packages = json.load(ins)

file_packages = packages.get('packages')
new_file_packages = [x for x in file_packages if include_package(x)]

# Extra is a list of platform:json.
# Filter it for the given platform and append any resulting packages
my_platform = platform.system().lower()
for item in extra:
inject_platform, path = item.split(':', 1)

if inject_platform.lower() != my_platform:
continue

with open(path) as ins:
for package in json.load(ins).get('packages'):
new_file_packages.append(package)

new_packages = {'packages': new_file_packages}
with open(output, 'w') as f:
json.dump(new_packages, f, indent=2)
Expand All @@ -54,6 +69,11 @@ def main():
parser.add_argument(
'--output', '-o', required=True
)
parser.add_argument(
'--extra', '-e', nargs='*', default=[],
help="Inject extra packages for specific platforms. Format is <platform>:<path_to_json>"
)

generate_new_cipd_package_json(**vars(parser.parse_args()))


Expand Down
Loading
Loading