Skip to content

Commit f4e2b91

Browse files
authored
Merge branch 'master' into fix/nand_flash_not_working_with_esp32p4
2 parents dd5bb69 + 696a3cf commit f4e2b91

37 files changed

+3215
-68
lines changed

.build-test-rules.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ esp_jpeg/examples/get_started:
3434
- if: IDF_VERSION_MAJOR > 4 and IDF_TARGET in ["esp32", "esp32s2", "esp32s3"]
3535
reason: Example depends on BSP, which is supported only for IDF >= 5.0 and limited targets
3636

37+
esp_schedule/examples/get_started:
38+
enable:
39+
- if: ((IDF_VERSION_MAJOR == 5 and IDF_VERSION_MINOR >= 1) or (IDF_VERSION_MAJOR > 5)) and SOC_WIFI_SUPPORTED == 1
40+
reason: Network provisioning component has dependencies IDF >= 5.1; example only supports Wi-Fi enabled targets
41+
3742
catch2/examples/catch2-test:
3843
enable:
3944
- if: INCLUDE_DEFAULT == 1 or IDF_TARGET == "linux"

.github/ISSUE_TEMPLATE/bug-report.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ body:
3838
- esp_isotp
3939
- esp_jpeg
4040
- esp_lcd_qemu_rgb
41+
- esp_schedule
4142
- esp_serial_slave_link
4243
- expat
4344
- fmt

.github/filter_sarif.py

Lines changed: 74 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,94 @@
33
import argparse
44
import copy
55
import json
6-
import typing
6+
import typing as t
77

88

9-
def process(in_file: typing.TextIO, out_file: typing.TextIO, include_prefix_list: typing.List[str]) -> None:
9+
def main():
10+
parser = argparse.ArgumentParser()
11+
parser.add_argument('-o', '--output', type=argparse.FileType('w'), help='Output filtered SARIF file')
12+
parser.add_argument('--include-prefix', required=True, action='append',
13+
help='File prefix for source code to include in analysis')
14+
parser.add_argument('--exclude-text-contains', action='append', default=[],
15+
help='Exclude results whose message.text contains this substring (may be repeated)')
16+
parser.add_argument('input_file', type=argparse.FileType('r'), help='Input SARIF file')
17+
args = parser.parse_args()
18+
process(args.input_file, args.output, args.include_prefix, args.exclude_text_contains)
19+
20+
21+
def process(in_file: t.TextIO, out_file: t.TextIO, include_prefix_list: t.List[str], exclude_text_contains_list: t.List[str]) -> None:
1022
in_json = json.load(in_file)
1123
if len(in_json['runs']) != 1:
1224
raise NotImplementedError('Only 1 run is supported')
1325
in_results = in_json['runs'][0]['results']
1426
out_results = []
1527
for result in in_results:
16-
locations = result['locations']
17-
if len(locations) != 1:
18-
raise NotImplementedError('Only 1 location is supported')
19-
artifact_location = locations[0]['physicalLocation']['artifactLocation']
20-
uri = artifact_location['uri']
21-
new_uri = None
22-
for include_prefix in include_prefix_list:
23-
if uri.startswith(include_prefix):
24-
new_uri = uri.replace(include_prefix, '')
25-
break
26-
if not new_uri:
27-
continue
28-
new_result = copy.deepcopy(result)
29-
new_result['locations'][0]['physicalLocation']['artifactLocation']['uri'] = new_uri
30-
out_results.append(new_result)
28+
transformed = transform_result(result, include_prefix_list, exclude_text_contains_list)
29+
if transformed is not None:
30+
out_results.append(transformed)
3131

3232
out_json = copy.deepcopy(in_json)
3333
out_json['runs'][0]['results'] = out_results
3434
json.dump(out_json, out_file, indent=True)
3535

3636

37-
def main():
38-
parser = argparse.ArgumentParser()
39-
parser.add_argument('-o', '--output', type=argparse.FileType('w'), help='Output filtered SARIF file')
40-
parser.add_argument('--include-prefix', required=True, action='append',
41-
help='File prefix for source code to include in analysis')
42-
parser.add_argument('input_file', type=argparse.FileType('r'), help='Input SARIF file')
43-
args = parser.parse_args()
44-
process(args.input_file, args.output, args.include_prefix)
37+
def normalize_uri_optional(uri: t.Optional[str], include_prefix_list: t.List[str], strict: bool) -> t.Optional[str]:
38+
if uri is None:
39+
return None
40+
for include_prefix in include_prefix_list:
41+
if uri.startswith(include_prefix):
42+
return uri.replace(include_prefix, '')
43+
return None if strict else uri
44+
45+
46+
def message_contains_any(text: str, substrings: t.List[str]) -> bool:
47+
return any(substr in text for substr in substrings)
48+
49+
50+
def dedupe_related_locations(related_locations: t.Any, include_prefix_list: t.List[str]) -> t.List[t.Dict[str, t.Any]]:
51+
if not isinstance(related_locations, list) or not related_locations:
52+
return []
53+
seen_keys: t.Set[t.Tuple[t.Any, ...]] = set()
54+
deduped: t.List[t.Dict[str, t.Any]] = []
55+
for rel in related_locations:
56+
if not isinstance(rel, dict):
57+
continue
58+
rel_msg_text = rel['message']['text']
59+
rel_uri = rel['physicalLocation']['artifactLocation']['uri']
60+
rel_uri_norm = normalize_uri_optional(rel_uri, include_prefix_list, strict=False)
61+
rel['physicalLocation']['artifactLocation']['uri'] = rel_uri_norm
62+
key = (rel_msg_text,
63+
rel_uri_norm,
64+
rel['physicalLocation']['region']['startLine'],
65+
rel['physicalLocation']['region']['startColumn'])
66+
if key in seen_keys:
67+
continue
68+
seen_keys.add(key)
69+
deduped.append(rel)
70+
return deduped
71+
72+
73+
def transform_result(result: t.Dict[str, t.Any], include_prefix_list: t.List[str], exclude_text_contains_list: t.List[str]) -> t.Optional[t.Dict[str, t.Any]]:
74+
locations = result['locations']
75+
if len(locations) != 1:
76+
raise NotImplementedError('Only 1 location is supported')
77+
artifact_location = locations[0]['physicalLocation']['artifactLocation']
78+
uri = artifact_location['uri']
79+
normalized_uri = normalize_uri_optional(uri, include_prefix_list, strict=True)
80+
if not normalized_uri:
81+
return None
82+
message_text = result['message']['text']
83+
if message_contains_any(message_text, exclude_text_contains_list):
84+
return None
85+
new_result = copy.deepcopy(result)
86+
new_result['locations'][0]['physicalLocation']['artifactLocation']['uri'] = normalized_uri
87+
deduped_related = dedupe_related_locations(new_result.get('relatedLocations'), include_prefix_list)
88+
if deduped_related:
89+
new_result['relatedLocations'] = deduped_related
90+
elif 'relatedLocations' in new_result:
91+
# Ensure we have a list per schema even if empty
92+
new_result['relatedLocations'] = []
93+
return new_result
4594

4695

4796
if __name__ == '__main__':

.github/workflows/clang-tidy.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
jobs:
1111
build:
1212
name: Run clang-tidy
13-
runs-on: ubuntu-22.04
13+
runs-on: ubuntu-24.04
1414
container: espressif/idf:latest
1515
steps:
1616
- uses: actions/checkout@v4
@@ -21,7 +21,7 @@ jobs:
2121
${IDF_PATH}/tools/idf_tools.py --non-interactive install esp-clang
2222
- name: Install clang-tidy-sarif
2323
run: |
24-
curl -sSL https://github.com/psastras/sarif-rs/releases/download/clang-tidy-sarif-v0.3.3/clang-tidy-sarif-x86_64-unknown-linux-gnu -o clang-tidy-sarif
24+
curl -sSL https://github.com/psastras/sarif-rs/releases/download/clang-tidy-sarif-v0.8.0/clang-tidy-sarif-x86_64-unknown-linux-gnu -o clang-tidy-sarif
2525
chmod +x clang-tidy-sarif
2626
- name: Install pyclang
2727
shell: bash
@@ -42,8 +42,18 @@ jobs:
4242
- name: Convert clang-tidy results into SARIF output
4343
run: |
4444
export PATH=$PWD:$PATH
45-
./clang-tidy-sarif -o results.sarif.raw warnings.txt
46-
python3 $GITHUB_WORKSPACE/.github/filter_sarif.py -o results.sarif --include-prefix ${GITHUB_WORKSPACE}/ results.sarif.raw
45+
./clang-tidy-sarif -o results.sarif.raw -i warnings.txt
46+
# Remove warnings which recommend using functions not supported in newlib.
47+
python3 $GITHUB_WORKSPACE/.github/filter_sarif.py -o results.sarif \
48+
--include-prefix ${GITHUB_WORKSPACE}/ \
49+
--exclude-text-contains memset_s \
50+
--exclude-text-contains memmove_s \
51+
--exclude-text-contains memcpy_s \
52+
--exclude-text-contains fprintf_s \
53+
--exclude-text-contains snprintf_s \
54+
--exclude-text-contains strncpy_s \
55+
--exclude-text-contains sscanf_s \
56+
results.sarif.raw
4757
- uses: actions/upload-artifact@v4
4858
with:
4959
path: |

.github/workflows/upload_component.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jobs:
4242
esp_lcd_qemu_rgb
4343
esp_linenoise
4444
esp_jpeg
45+
esp_schedule
4546
esp_serial_slave_link
4647
expat
4748
fmt

.idf_build_apps.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ manifest_file = [
1313
"esp_gcov/.build-test-rules.yml",
1414
"esp_jpeg/.build-test-rules.yml",
1515
"esp_linenoise/.build-test-rules.yml",
16+
"esp_schedule/.build-test-rules.yml",
1617
"esp_serial_slave_link/.build-test-rules.yml",
1718
"expat/.build-test-rules.yml",
1819
"iqmath/.build-test-rules.yml",

coap/sbom_libcoap.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ cve-exclude-list:
1212
reason: Resolved in version 4.3.5-rc1
1313
- cve: CVE-2024-46304
1414
reason: Resolved in version 4.3.5-rc3
15+
- cve: CVE-2025-50518
16+
reason: Not applicable as per comment https://github.com/obgm/libcoap/issues/1724#issuecomment-3296780541

esp_linenoise/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "1.0.0"
1+
version: "1.0.1"
22
description: "ESP Linenoise - Line editing C library"
33
url: https://github.com/espressif/idf-extra-components/tree/master/esp_linenoise
44
license: Apache-2.0

esp_linenoise/include/esp_linenoise.h

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,48 @@ esp_err_t esp_linenoise_set_max_cmd_line_length(esp_linenoise_handle_t handle, s
307307
*/
308308
esp_err_t esp_linenoise_get_max_cmd_line_length(esp_linenoise_handle_t handle, size_t *max_cmd_line_length);
309309

310+
/**
311+
* @brief Return the output file descriptor used by esp_linenoise
312+
*
313+
* @param handle The esp_linenoise handle from which to get
314+
* the file descriptor
315+
* @param fd Return value containing the output file descriptor
316+
* @return ESP_OK on success, ESP_ERR_INVALID_ARG otherwise
317+
*/
318+
esp_err_t esp_linenoise_get_out_fd(esp_linenoise_handle_t handle, int *fd);
319+
320+
/**
321+
* @brief Return the input file descriptor used by esp_linenoise
322+
*
323+
* @param handle The esp_linenoise handle from which to get
324+
* the file descriptor
325+
* @param fd Return value containing the input file descriptor
326+
* @return ESP_OK on success, ESP_ERR_INVALID_ARG otherwise
327+
*/
328+
esp_err_t esp_linenoise_get_in_fd(esp_linenoise_handle_t handle, int *fd);
329+
330+
/**
331+
* @brief Return the read function used by linenoise
332+
*
333+
* @param handle The esp_linenoise handle from which to get
334+
* the file descriptor
335+
* @param read_func Return the read_func as set in the configuration structure
336+
* of the given esp_linenoise instance
337+
* @return ESP_OK on success, ESP_ERR_INVALID_ARG otherwise
338+
*/
339+
esp_err_t esp_linenoise_get_read(esp_linenoise_handle_t handle, esp_linenoise_read_bytes_t *read_func);
340+
341+
/**
342+
* @brief Return the write function used by linenoise
343+
*
344+
* @param handle The esp_linenoise handle from which to get
345+
* the file descriptor
346+
* @param write_func Return the write_func as set in the configuration structure
347+
* of the given esp_linenoise instance
348+
* @return ESP_OK on success, ESP_ERR_INVALID_ARG otherwise
349+
*/
350+
esp_err_t esp_linenoise_get_write(esp_linenoise_handle_t handle, esp_linenoise_write_bytes_t *write_func);
351+
310352
#ifdef __cplusplus
311353
}
312354
#endif

esp_linenoise/private_include/esp_linenoise_private.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ typedef struct esp_linenoise_state {
6262
} esp_linenoise_state_t;
6363

6464
typedef struct esp_linenoise_instance {
65-
esp_linenoise_handle_t self;
6665
esp_linenoise_config_t config;
6766
esp_linenoise_state_t state;
6867
} esp_linenoise_instance_t;
@@ -82,7 +81,6 @@ esp_linenoise_instance_t *esp_linenoise_create_instance_static(void)
8281
esp_linenoise_instance_t *instance = malloc(sizeof(esp_linenoise_instance_t));
8382
assert(instance != NULL);
8483

85-
instance->self = instance;
8684
esp_linenoise_get_instance_config_default(&instance->config);
8785

8886
/* set the state part of the esp_linenoise_instance_t to 0 to init all values to 0 (or NULL) */

0 commit comments

Comments
 (0)