Skip to content

Commit 244d760

Browse files
authored
Merge branch 'master' into me-no-dev-patch-1
2 parents fd7a0d7 + 0236483 commit 244d760

File tree

9 files changed

+103
-63
lines changed

9 files changed

+103
-63
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
/libraries/ESP_SR/ @me-no-dev
6060
/libraries/ESPmDNS/ @me-no-dev
6161
/libraries/Ethernet/ @me-no-dev
62+
/libraries/Hash/ @lucasssvaz
6263
/libraries/Matter/ @SuGlider
6364
/libraries/NetBIOS/ @me-no-dev
6465
/libraries/Network/ @me-no-dev

.github/scripts/get_affected.py

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,59 @@ def build_qname_from_tag(tag: dict) -> str:
358358
qname = "::".join([p for p in qparts if p])
359359
return f"{qname}{signature}"
360360

361+
def find_impl_files_for_qname(qname: str, defs_by_qname: dict[str, set[str]], header_path: str = None) -> set[str]:
362+
"""
363+
Find implementation files for a qualified name, handling namespace mismatches.
364+
365+
Ctags may capture different namespace scopes in headers vs implementations.
366+
For example:
367+
- Header: fs::SDFS::begin(...)
368+
- Implementation: SDFS::begin(...)
369+
370+
This happens when implementations use "using namespace" directives.
371+
372+
Strategy:
373+
1. Try exact match first
374+
2. If no match and qname has namespaces, try stripping ONLY outer namespace prefixes
375+
(keep at least Class::method structure intact)
376+
3. If header_path provided, prefer implementations from same directory
377+
"""
378+
# Try exact match first
379+
impl_files = defs_by_qname.get(qname, set())
380+
if impl_files:
381+
return impl_files
382+
383+
# If no exact match and the qname contains namespaces (::), try stripping them
384+
if "::" in qname:
385+
parts = qname.split("::")
386+
# Only strip outer namespaces, not the class/method structure
387+
# For "ns1::ns2::Class::method(...)", we want to try:
388+
# - "ns2::Class::method(...)" (strip 1 level)
389+
# - "Class::method(...)" (strip 2 levels)
390+
# But NOT "method(...)" alone (too ambiguous)
391+
392+
# Only allow stripping if we have more than 2 parts (namespace::Class::method)
393+
# If we only have 2 parts (Class::method), don't strip as it would leave just "method"
394+
if len(parts) > 2:
395+
# Keep at least 2 parts (Class::method) to avoid false positives
396+
max_strip = len(parts) - 2
397+
398+
for i in range(1, max_strip + 1):
399+
shorter_qname = "::".join(parts[i:])
400+
impl_files = defs_by_qname.get(shorter_qname, set())
401+
402+
if impl_files:
403+
# If we have the header path, prefer implementations from same directory
404+
if header_path:
405+
header_dir = os.path.dirname(header_path)
406+
same_dir_files = {f for f in impl_files if os.path.dirname(f) == header_dir}
407+
if same_dir_files:
408+
return same_dir_files
409+
410+
return impl_files
411+
412+
return set()
413+
361414
def run_ctags_and_index(paths: list[str]) -> tuple[dict[str, set[str]], dict[str, set[str]], str]:
362415
"""
363416
Run Universal Ctags over given paths (relative to project_root) and build:
@@ -582,8 +635,10 @@ def build_dependencies_graph() -> None:
582635
if qnames:
583636
impl_files = set()
584637
for qn in qnames:
585-
# For each qualified name, get the implementation files
586-
impl_files |= ctags_defs_by_qname.get(qn, set())
638+
# For each qualified name, find implementation files
639+
# This handles namespace mismatches (e.g., fs::SDFS vs SDFS)
640+
# Pass header_path to prefer implementations from same directory
641+
impl_files |= find_impl_files_for_qname(qn, ctags_defs_by_qname, header_path)
587642
for impl in impl_files:
588643
# Skip .ino files - they should never be dependencies of other files
589644
if impl.endswith('.ino'):

.github/scripts/on-release.sh

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -54,30 +54,6 @@ if [ -n "${VENDOR}" ]; then
5454
echo "Setting packager: $VENDOR"
5555
fi
5656

57-
function update_version {
58-
set -e
59-
set -o pipefail
60-
61-
local tag=$1
62-
local major
63-
local minor
64-
local patch
65-
66-
# Extract major, minor, and patch from the tag
67-
# We need to make sure to remove the "v" prefix from the tag and any characters after the patch version
68-
tag=$(echo "$tag" | sed 's/^v//g' | sed 's/-.*//g')
69-
major=$(echo "$tag" | cut -d. -f1)
70-
minor=$(echo "$tag" | cut -d. -f2)
71-
patch=$(echo "$tag" | cut -d. -f3 | sed 's/[^0-9].*//') # Remove non-numeric suffixes like RC1, alpha, beta
72-
73-
echo "Major: $major, Minor: $minor, Patch: $patch"
74-
75-
"${SCRIPTS_DIR}/update-version.sh" "$major" "$minor" "$patch"
76-
77-
set +e
78-
set +o pipefail
79-
}
80-
8157
function get_file_size {
8258
local file="$1"
8359
if [[ "$OSTYPE" == "darwin"* ]]; then
@@ -230,7 +206,7 @@ LIBS_ZIP="$PACKAGE_NAME-libs.zip"
230206
LIBS_XZ="$PACKAGE_NAME-libs.tar.xz"
231207

232208
echo "Updating version..."
233-
if ! update_version "$RELEASE_TAG"; then
209+
if ! "${SCRIPTS_DIR}/update-version.sh" "$RELEASE_TAG"; then
234210
echo "ERROR: update_version failed!"
235211
exit 1
236212
fi

.github/scripts/update-version.sh

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,26 @@ set -o pipefail
1010
# "[board].upload.tool=esptool_py" to "[board].upload.tool=esptool_py\n[board].upload.tool.default=esptool_py\n[board].upload.tool.network=esp_ota"
1111
#cat boards.txt | sed "s/\([a-zA-Z0-9_\-]*\)\.upload\.tool\=esptool_py/\1\.upload\.tool\=esptool_py\\n\1\.upload\.tool\.default\=esptool_py\\n\1\.upload\.tool\.network\=esp_ota/"
1212

13-
if [ ! $# -eq 3 ]; then
13+
if [ ! $# -eq 1 ]; then
1414
echo "Bad number of arguments: $#" >&2
15-
echo "usage: $0 <major> <minor> <patch>" >&2
15+
echo "usage: $0 <version>" >&2
1616
exit 1
1717
fi
1818

19-
re='^[0-9]+$'
20-
if [[ ! $1 =~ $re ]] || [[ ! $2 =~ $re ]] || [[ ! $3 =~ $re ]] ; then
21-
echo "error: Not a valid version: $1.$2.$3" >&2
22-
echo "usage: $0 <major> <minor> <patch>" >&2
19+
# Version must be in the format of X.Y.Z or X.Y.Z-abc123 (POSIX ERE)
20+
re='^[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z]+[0-9]*)?$'
21+
version=$1
22+
23+
if [[ ! $version =~ $re ]] ; then
24+
echo "error: Not a valid version: $version" >&2
25+
echo "usage: $0 <version>" >&2
2326
exit 1
2427
fi
2528

26-
ESP_ARDUINO_VERSION_MAJOR="$1"
27-
ESP_ARDUINO_VERSION_MINOR="$2"
28-
ESP_ARDUINO_VERSION_PATCH="$3"
29-
ESP_ARDUINO_VERSION="$ESP_ARDUINO_VERSION_MAJOR.$ESP_ARDUINO_VERSION_MINOR.$ESP_ARDUINO_VERSION_PATCH"
29+
ESP_ARDUINO_VERSION_MAJOR=$(echo "$version" | cut -d. -f1)
30+
ESP_ARDUINO_VERSION_MINOR=$(echo "$version" | cut -d. -f2)
31+
ESP_ARDUINO_VERSION_PATCH=$(echo "$version" | cut -d. -f3 | sed 's/[^0-9].*//') # Remove non-numeric suffixes like RC1, alpha, beta
32+
ESP_ARDUINO_VERSION_CLEAN="$ESP_ARDUINO_VERSION_MAJOR.$ESP_ARDUINO_VERSION_MINOR.$ESP_ARDUINO_VERSION_PATCH"
3033

3134
# Get ESP-IDF version from build_component.yml (this way we can ensure that the version is correct even if the local libs are not up to date)
3235
ESP_IDF_VERSION=$(grep -m 1 "default:" .github/workflows/build_component.yml | sed 's/.*release-v\([^"]*\).*/\1/')
@@ -35,38 +38,38 @@ if [ -z "$ESP_IDF_VERSION" ]; then
3538
exit 1
3639
fi
3740

38-
echo "New Arduino Version: $ESP_ARDUINO_VERSION"
41+
echo "New Arduino Version: $version"
3942
echo "ESP-IDF Version: $ESP_IDF_VERSION"
4043

4144
echo "Updating issue template..."
42-
if ! grep -q "v$ESP_ARDUINO_VERSION" .github/ISSUE_TEMPLATE/Issue-report.yml; then
45+
if ! grep -q "v$version" .github/ISSUE_TEMPLATE/Issue-report.yml; then
4346
cat .github/ISSUE_TEMPLATE/Issue-report.yml | \
44-
sed "s/.*\- latest master .*/ - latest master \(checkout manually\)\\n - v$ESP_ARDUINO_VERSION/g" > __issue-report.yml && mv __issue-report.yml .github/ISSUE_TEMPLATE/Issue-report.yml
45-
echo "Issue template updated with version v$ESP_ARDUINO_VERSION"
47+
sed "s/.*\- latest master .*/ - latest master \(checkout manually\)\\n - v$version/g" > __issue-report.yml && mv __issue-report.yml .github/ISSUE_TEMPLATE/Issue-report.yml
48+
echo "Issue template updated with version v$version"
4649
else
47-
echo "Version v$ESP_ARDUINO_VERSION already exists in issue template, skipping update"
50+
echo "Version v$version already exists in issue template, skipping update"
4851
fi
4952

5053
echo "Updating GitLab variables..."
5154
cat .gitlab/workflows/common.yml | \
5255
sed "s/ESP_IDF_VERSION:.*/ESP_IDF_VERSION: \"$ESP_IDF_VERSION\"/g" | \
53-
sed "s/ESP_ARDUINO_VERSION:.*/ESP_ARDUINO_VERSION: \"$ESP_ARDUINO_VERSION\"/g" > .gitlab/workflows/__common.yml && mv .gitlab/workflows/__common.yml .gitlab/workflows/common.yml
56+
sed "s/ESP_ARDUINO_VERSION:.*/ESP_ARDUINO_VERSION: \"$ESP_ARDUINO_VERSION_CLEAN\"/g" > .gitlab/workflows/__common.yml && mv .gitlab/workflows/__common.yml .gitlab/workflows/common.yml
5457

5558
echo "Updating platform.txt..."
56-
cat platform.txt | sed "s/version=.*/version=$ESP_ARDUINO_VERSION/g" > __platform.txt && mv __platform.txt platform.txt
59+
cat platform.txt | sed "s/version=.*/version=$ESP_ARDUINO_VERSION_CLEAN/g" > __platform.txt && mv __platform.txt platform.txt
5760

5861
echo "Updating package.json..."
59-
cat package.json | sed "s/.*\"version\":.*/ \"version\": \"$ESP_ARDUINO_VERSION\",/g" > __package.json && mv __package.json package.json
62+
cat package.json | sed "s/.*\"version\":.*/ \"version\": \"$ESP_ARDUINO_VERSION_CLEAN\",/g" > __package.json && mv __package.json package.json
6063

6164
echo "Updating docs/conf_common.py..."
6265
cat docs/conf_common.py | \
63-
sed "s/.. |version| replace:: .*/.. |version| replace:: $ESP_ARDUINO_VERSION/g" | \
66+
sed "s/.. |version| replace:: .*/.. |version| replace:: $ESP_ARDUINO_VERSION_CLEAN/g" | \
6467
sed "s/.. |idf_version| replace:: .*/.. |idf_version| replace:: $ESP_IDF_VERSION/g" > docs/__conf_common.py && mv docs/__conf_common.py docs/conf_common.py
6568

6669
echo "Updating .gitlab/workflows/common.yml..."
6770
cat .gitlab/workflows/common.yml | \
6871
sed "s/ESP_IDF_VERSION:.*/ESP_IDF_VERSION: \"$ESP_IDF_VERSION\"/g" | \
69-
sed "s/ESP_ARDUINO_VERSION:.*/ESP_ARDUINO_VERSION: \"$ESP_ARDUINO_VERSION\"/g" > .gitlab/workflows/__common.yml && mv .gitlab/workflows/__common.yml .gitlab/workflows/common.yml
72+
sed "s/ESP_ARDUINO_VERSION:.*/ESP_ARDUINO_VERSION: \"$ESP_ARDUINO_VERSION_CLEAN\"/g" > .gitlab/workflows/__common.yml && mv .gitlab/workflows/__common.yml .gitlab/workflows/common.yml
7073

7174
echo "Updating cores/esp32/esp_arduino_version.h..."
7275
cat cores/esp32/esp_arduino_version.h | \
@@ -78,7 +81,7 @@ libraries=$(find libraries -maxdepth 1 -mindepth 1 -type d -exec basename {} \;)
7881
for lib in $libraries; do
7982
if [ -f "libraries/$lib/library.properties" ]; then
8083
echo "Updating Library $lib..."
81-
cat "libraries/$lib/library.properties" | sed "s/version=.*/version=$ESP_ARDUINO_VERSION/g" > "libraries/$lib/__library.properties" && mv "libraries/$lib/__library.properties" "libraries/$lib/library.properties"
84+
cat "libraries/$lib/library.properties" | sed "s/version=.*/version=$ESP_ARDUINO_VERSION_CLEAN/g" > "libraries/$lib/__library.properties" && mv "libraries/$lib/__library.properties" "libraries/$lib/library.properties"
8285
fi
8386
done
8487

.github/workflows/docs_deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ permissions:
1919
jobs:
2020
deploy-prod-docs:
2121
name: Deploy Documentation on Production
22+
if: github.repository == 'espressif/arduino-esp32'
2223
runs-on: ubuntu-22.04
2324
defaults:
2425
run:

boards.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42213,8 +42213,8 @@ nano_nora.debug_config.nano_nora.cortex-debug.custom.overrideRestartCommands.1=m
4221342213
nano_nora.debug_config.nano_nora.cortex-debug.custom.overrideRestartCommands.2=interrupt
4221442214
nano_nora.debug.additional_config=debug_config.nano_nora
4221542215

42216-
nano_nora.tools.esptool_py.program.pattern_args=--chip {build.mcu} --port "{serial.port}" --before default_reset --after hard_reset write_flash -z --flash_mode {build.flash_mode} --flash_freq {build.flash_freq} --flash_size {build.flash_size} {build.bootloader_addr} "{build.path}/{build.project_name}.bootloader.bin" 0x8000 "{build.path}/{build.project_name}.partitions.bin" 0xe000 "{runtime.platform.path}/tools/partitions/boot_app0.bin" 0xf70000 "{build.variant.path}/extra/nora_recovery/nora_recovery.ino.bin" 0x10000 "{build.path}/{build.project_name}.bin"
42217-
nano_nora.tools.esptool_py.erase.pattern_args=--chip {build.mcu} --port "{serial.port}" --before default_reset --after hard_reset erase_flash
42216+
nano_nora.tools.esptool_py.program.pattern_args=--chip {build.mcu} --port "{serial.port}" --before default-reset --after hard-reset write-flash -z --flash-mode {build.flash_mode} --flash-freq {build.flash_freq} --flash-size {build.flash_size} {build.bootloader_addr} "{build.path}/{build.project_name}.bootloader.bin" 0x8000 "{build.path}/{build.project_name}.partitions.bin" 0xe000 "{runtime.platform.path}/tools/partitions/boot_app0.bin" 0xf70000 "{build.variant.path}/extra/nora_recovery/nora_recovery.ino.bin" 0x10000 "{build.path}/{build.project_name}.bin"
42217+
nano_nora.tools.esptool_py.erase.pattern_args=--chip {build.mcu} --port "{serial.port}" --before default-reset --after hard-reset erase-flash
4221842218

4221942219
nano_nora.debug.executable=
4222042220

idf_component.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
1-
description: "Arduino core for ESP32, ESP32-S and ESP32-C series of SoCs"
1+
description: "Arduino core for ESP32, ESP32-C, ESP32-H, ESP32-P, ESP32-S series of SoCs"
22
url: "https://github.com/espressif/arduino-esp32"
33
license: "LGPL-2.1"
44
targets:
55
- esp32
6-
- esp32s2
7-
- esp32s3
86
- esp32c2
97
- esp32c3
8+
- esp32c5
109
- esp32c6
1110
- esp32h2
1211
- esp32p4
13-
- esp32c5
12+
- esp32s2
13+
- esp32s3
1414
tags:
1515
- arduino
1616
files:
1717
include:
1818
- "variants/esp32/**/*"
19-
- "variants/esp32s2/**/*"
20-
- "variants/esp32s3/**/*"
2119
- "variants/esp32c2/**/*"
2220
- "variants/esp32c3/**/*"
21+
- "variants/esp32c5/**/*"
2322
- "variants/esp32c6/**/*"
2423
- "variants/esp32h2/**/*"
2524
- "variants/esp32p4/**/*"
26-
- "variants/esp32c5/**/*"
25+
- "variants/esp32s2/**/*"
26+
- "variants/esp32s3/**/*"
2727
exclude:
28+
- ".*" # All files in the root directory that start with a dot.
29+
- ".gitlab/"
30+
- ".gitlab/**/*"
2831
- "docs/"
2932
- "docs/**/*"
3033
- "idf_component_examples/"
@@ -36,9 +39,6 @@ files:
3639
- "tools/"
3740
- "tools/**/*"
3841
- "variants/**/*"
39-
- ".gitignore"
40-
- ".gitmodules"
41-
- ".readthedocs.yaml"
4242
- "boards.txt"
4343
- "CODE_OF_CONDUCT.md"
4444
- "LICENSE.md"

libraries/FS/src/vfs_api.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,12 @@ VFSFileImpl::VFSFileImpl(VFSImpl *fs, const char *fpath, const char *mode) : _fs
276276
if (!_f) {
277277
log_e("fopen(%s) failed", temp);
278278
}
279-
if (_f && (_stat.st_blksize == 0)) {
280-
setvbuf(_f, NULL, _IOFBF, DEFAULT_FILE_BUFFER_SIZE);
279+
if (!stat(temp, &_stat)) {
280+
if (_f && (_stat.st_blksize == 0)) {
281+
setvbuf(_f, NULL, _IOFBF, DEFAULT_FILE_BUFFER_SIZE);
282+
}
283+
} else {
284+
log_e("stat(%s) failed", temp);
281285
}
282286
}
283287
free(temp);

platform.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,6 @@ tools.esptool_py_app_only.upload.protocol=serial
352352
tools.esptool_py_app_only.upload.params.verbose=
353353
tools.esptool_py_app_only.upload.params.quiet=
354354

355-
tools.esptool_py_app_only.upload.pattern_args=--chip {build.mcu} --port "{serial.port}" --baud {upload.speed} {upload.flags} --before default_reset --after hard_reset write_flash --flash_mode {build.flash_mode} --flash_freq {build.flash_freq} --flash_size {build.flash_size} {build.flash_offset} "{build.path}/{build.project_name}.bin" {upload.extra_flags}
355+
tools.esptool_py_app_only.upload.pattern_args=--chip {build.mcu} --port "{serial.port}" --baud {upload.speed} {upload.flags} --before default-reset --after hard-reset write-flash --flash-mode {build.flash_mode} --flash-freq {build.flash_freq} --flash-size {build.flash_size} {build.flash_offset} "{build.path}/{build.project_name}.bin" {upload.extra_flags}
356356

357357
tools.esptool_py_app_only.upload.pattern="{path}/{cmd}" {tools.esptool_py_app_only.upload.pattern_args}

0 commit comments

Comments
 (0)