Skip to content

Commit 4e8d79c

Browse files
committed
Merge branch 'develop' of https://github.com/libcsp/libcsp into libcsp-develop
2 parents 0b39eaa + 2dfaf8b commit 4e8d79c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+636
-247
lines changed

.github/ISSUE_TEMPLATE/01_q_and_a.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
name: Q & A
3+
about: Ask for help
4+
title: ''
5+
labels: Q&A
6+
---
7+
8+
## Description
9+
10+
<!--
11+
Describe your question in detail. Explain what you're trying to
12+
achieve and what specific part is causing trouble.
13+
-->
14+
15+
## Steps to Reproduce
16+
17+
<!--
18+
Provide a step-by-step guide on how to reproduce the issue. Include
19+
any code snippets, commands, or configurations.
20+
-->
21+
22+
1.
23+
2.
24+
3.
25+
26+
## Expected behavior
27+
28+
<!--
29+
A clear and concise description of what you expected to happen.
30+
-->
31+
32+
## Actual Behavior
33+
34+
<!--
35+
Describe what actually happened. Include any error messages or
36+
unexpected outputs.
37+
-->
38+
39+
## Environment Details
40+
41+
Provide information about your environment, including:
42+
43+
- Build OS: (e.g., Ubuntu 24.04)
44+
- Target OS: (e.g., Ubunut 24.04, FreeRTOS, Zephyr)
45+
- libcsp commit hash:
46+
- Meson version:
47+
- CMake version:
48+
- GNU Make version
49+
- Ninja version:
50+
51+
## Logs or console output from the very beginning to the end
52+
53+
<!--
54+
Do NOT add screen shorts. Make sure to copy & paste in plain text. Or,
55+
use logging feature of your terminal software.
56+
-->
57+
58+
## Additional Context
59+
60+
<!--
61+
Add any other context, logs, or screenshots that might help in
62+
understanding the issue.
63+
-->
64+
65+
## Checklist
66+
67+
<!--
68+
Please confirm by replacing `[ ]` with `[x]`.
69+
-->
70+
71+
- [ ] I've searched in "Issues" for similar issues, both open and closed.
72+
- [ ] I've used GitHub Flavored Markdown (GFM) to format my text.
73+
- [ ] I've avoided using screenshots for console output or logs
74+
- [ ] I've included all relevant details and steps to reproduce the issue.
75+
- [ ] I've provided information about my environment.
76+
- [ ] I've attached necessary logs or code snippet for minimal reproducible example.
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
name: Bug Report
3+
about: Create a report to help us improve libcsp
4+
title: ''
5+
labels: Defect
6+
---
7+
8+
## Description
9+
10+
<!--
11+
Describe the bug in detail. Explain what the bug is and how it affects
12+
the project.
13+
-->
14+
15+
## Steps to Reproduce
16+
17+
<!--
18+
Provide a step-by-step guide on how to reproduce the issue. Include
19+
any code snippets, commands, or configurations.
20+
-->
21+
22+
1.
23+
2.
24+
3.
25+
26+
## Expected behavior
27+
28+
<!--
29+
A clear and concise description of what you expected to happen.
30+
-->
31+
32+
## Actual Behavior:
33+
34+
<!--
35+
Describe what actually happened. Include any error messages or
36+
unexpected outputs.
37+
-->
38+
39+
## Environment Details:
40+
41+
Provide information about your environment, including:
42+
43+
- Build OS: (e.g., Ubuntu 24.04)
44+
- Target OS: (e.g., Ubunut 24.04, FreeRTOS, Zephyr)
45+
- libcsp commit hash:
46+
- Meson version:
47+
- CMake version:
48+
- GNU Make version
49+
- Ninja version:
50+
51+
## Logs or console output from the very beginning to the end
52+
53+
<!--
54+
Do NOT add screen shorts. Make sure to copy & paste in plain text. Or,
55+
use logging feature of your terminal software.
56+
-->
57+
58+
## Additional Context:
59+
60+
<!--
61+
62+
Add any other context, logs or code snippet for minimal reproducible
63+
example that might help in understanding the issue.
64+
65+
-->
66+
67+
## Checklist
68+
69+
<!--
70+
Please confirm by replacing `[ ]` with `[x]`.
71+
-->
72+
73+
- [ ] I've searched in "Issues" for similar issues, both open and closed.
74+
- [ ] I've used GitHub Flavored Markdown (GFM) to format my text.
75+
- [ ] I've avoided using screenshots for console output or logs
76+
- [ ] I've included all relevant details and steps to reproduce the issue.
77+
- [ ] I've provided information about my environment.
78+
- [ ] I've attached necessary logs or code snippet for minimal reproducible example.

.github/workflows/abi-checker.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: ABI Compliance Check
2+
on: [pull_request]
3+
jobs:
4+
abi-check:
5+
strategy:
6+
fail-fast: false
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Setup packages on Linux
10+
run: |
11+
sudo apt-get update
12+
sudo apt-get install libzmq3-dev libsocketcan-dev
13+
14+
- name: Setup build system packages on Linux
15+
run: |
16+
sudo apt-get install ninja-build cmake
17+
18+
- name: Setup ABI Compliance Checker
19+
run: |
20+
sudo apt-get install abi-compliance-checker abi-dumper
21+
22+
- name: Checkout merged-base
23+
uses: actions/checkout@v4
24+
with:
25+
ref: ${{ github.event.pull_request.base.ref }}
26+
27+
- name: Build and Dump ABI for `merged-base` version
28+
run: |
29+
cmake -GNinja -B build -DCMAKE_BUILD_TYPE=Debug -DCSP_USE_RTABLE=1 -DCMAKE_POSITION_INDEPENDENT_CODE=ON && ninja -C build
30+
abi-dumper build/libcsp.so -lver "merged-base" -o ../tmp/libcsp-merged-base.dump
31+
32+
- name: Checkout Current PR
33+
uses: actions/checkout@v4
34+
with:
35+
fetch-depth: 0
36+
ref: ${{github.event.pull_request.head.ref}}
37+
repository: ${{github.event.pull_request.head.repo.full_name}}
38+
39+
- name: Build and Dump ABI for Current PR
40+
run: |
41+
cmake -GNinja -B build -DCMAKE_BUILD_TYPE=Debug -DCSP_USE_RTABLE=1 -DCMAKE_POSITION_INDEPENDENT_CODE=ON && ninja -C build
42+
abi-dumper build/libcsp.so -lver "PR" -o ../tmp/pr.dump
43+
44+
- name: Compare ABI
45+
run: |
46+
abi-compliance-checker -l libcsp -old ../tmp/libcsp-merged-base.dump -new ../tmp/pr.dump
47+
48+
- name: Check ABI Compatibility Result
49+
if: failure()
50+
run: echo "::warning::ABI compatibility issues detected. Please review the report."
51+
52+
- name: Upload ABI Report
53+
if: always()
54+
uses: actions/upload-artifact@v4
55+
with:
56+
name: abi-compliance-report-${{ github.run_id }}
57+
path: compat_reports
58+
if-no-files-found: warn
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Python Bindings
2+
on: [push, pull_request]
3+
jobs:
4+
build-test-python:
5+
strategy:
6+
fail-fast: false
7+
matrix:
8+
python-version:
9+
- '3.9'
10+
- '3.10'
11+
- '3.11'
12+
- '3.12'
13+
os:
14+
- ubuntu-24.04
15+
- ubuntu-22.04
16+
- ubuntu-20.04
17+
buildsystem:
18+
- meson
19+
- cmake
20+
runs-on: ${{ matrix.os }}
21+
steps:
22+
- name: Setup Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
27+
- name: Setup packages on Linux
28+
run: |
29+
sudo apt-get update
30+
sudo apt-get install libzmq3-dev libsocketcan-dev
31+
32+
- name: Setup build system packages on Linux
33+
run: |
34+
sudo apt-get install ninja-build ${{ matrix.buildsystem }}
35+
36+
- name: Checkout
37+
uses: actions/checkout@v4
38+
39+
- name: Build libcsp examples
40+
run: python3 examples/buildall.py --build-system=${{ matrix.buildsystem }}
41+
42+
- name: Build libcsp with python binding with cmake
43+
if: ${{ matrix.buildsystem == 'cmake' }}
44+
run: |
45+
cmake -GNinja -B builddir -DCSP_ENABLE_PYTHON3_BINDINGS=1 -DCSP_USE_RTABLE=1 && ninja -C builddir
46+
47+
- name: Install the latest Meson using Pip if Python is 3.12 or later
48+
# Meson 1.3+ supports Python 3.12 (distutils removed)
49+
if: ${{ matrix.buildsystem == 'meson' && matrix.python-version == '3.12' }}
50+
run: |
51+
pip install meson
52+
meson --version
53+
54+
- name: Build libcsp with python binding with meson
55+
if: ${{ matrix.buildsystem == 'meson' }}
56+
run: |
57+
meson setup builddir -Denable_python3_bindings=true -Duse_rtable=true && ninja -C builddir
58+
59+
- name: Run ZMQ Python binding Test
60+
run: |
61+
build/examples/zmqproxy &
62+
PYTHONPATH=builddir python3 examples/python_bindings_example_server.py &
63+
PYTHONPATH=builddir python3 examples/python_bindings_example_client.py -z localhost -s 27 -a 2
64+
pkill zmqproxy

.github/workflows/build-test.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ jobs:
66
fail-fast: false
77
matrix:
88
os:
9+
- ubuntu-24.04
910
- ubuntu-22.04
1011
- ubuntu-20.04
11-
#- macos-latest
12-
arch:
13-
- posix
1412
buildsystem:
1513
- meson
1614
- cmake
@@ -47,7 +45,7 @@ jobs:
4745
env:
4846
CC: ${{ matrix.compiler.CC }}
4947
CXX: ${{ matrix.compiler.CXX }}
50-
run: python3 ./examples/buildall.py ${{ matrix.arch }} --build-system=${{ matrix.buildsystem }}
48+
run: python3 ./examples/buildall.py --build-system=${{ matrix.buildsystem }}
5149

5250
- name: Run Loopback Test
5351
run: |

.github/workflows/gitlint.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: GitLint
2+
3+
on:
4+
pull_request
5+
6+
jobs:
7+
gitlint:
8+
runs-on: ubuntu-latest
9+
name: Run gitlint against all commits in a PR
10+
steps:
11+
12+
- name: Install python dependencies
13+
run: |
14+
pip3 install gitlint
15+
16+
- name: Checkout the code
17+
uses: actions/checkout@v4
18+
with:
19+
ref: ${{ github.event.pull_request.head.sha }}
20+
fetch-depth: 0
21+
22+
- name: Setup Git (pull request)
23+
run: |
24+
git checkout -b this_pr
25+
26+
- name: Run gitlint
27+
if: ${{ github.base_ref }}
28+
env:
29+
BASE_REF: ${{ github.base_ref }}
30+
run: |
31+
gitlint --commits origin/${BASE_REF}..this_pr

.github/workflows/linelint.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: EOF newline
2+
3+
on:
4+
pull_request
5+
6+
jobs:
7+
linelint:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- name: Linelint
15+
uses: fernandrone/linelint@master

.linelint.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# 'true' will fix files
2+
autofix: false
3+
4+
# list of paths to ignore, uses gitignore syntaxes (executes before any rule)
5+
ignore:
6+
- /.git
7+
- /zephyr
8+
9+
rules:
10+
# checks if file ends in a newline character
11+
end-of-file:
12+
# set to true to enable this rule
13+
enable: true
14+
15+
# set to true to disable autofix (if enabled globally)
16+
disable-autofix: true
17+
18+
# if true also checks if file ends in a single newline character
19+
single-new-line: true

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ The latest version of the /doc folder is compiled to HTML and hosted on:
7171
Thank you for considering contributing to libcsp! We welcome
7272
contributions from the community to help improve and grow the
7373
project. Please take a moment to review our
74-
[guidelines](./doc/git-commit.md) before opening a Pull Request!
74+
[guidelines](./doc/contributing.md) before opening a Pull Request!
7575

7676
## Software license
7777

contrib/drivers/can/csp_driver_can.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,4 +265,3 @@ csp_iface_t * csp_driver_can_init(int addr, int netmask, int id, can_mode_e mode
265265
return &mcan[id].interface;
266266

267267
}
268-

contrib/hooks/csp_hook_asf4.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ void csp_reboot_hook(void) {
88
void csp_shutdown_hook(void) {
99
NVIC_SystemReset();
1010
}
11-

0 commit comments

Comments
 (0)