Skip to content

Commit b350209

Browse files
Fixes for #356, shadowing of parameters (#380)
Fixes #356, adds workflows to verification cmake presets, adds armv7m native verification build, and removes version_check_nunavut.py.
1 parent 11785de commit b350209

30 files changed

+4893
-610
lines changed

.clang-format

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ BraceWrapping:
2828
AfterStruct: true
2929
AfterClass: true
3030
AfterControlStatement: true
31-
AfterEnum: true
3231
AfterFunction: true
3332
AfterUnion: true
3433
AfterNamespace: true
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "C/C++ verification environment with lcov (amd64)",
3+
"image": "ghcr.io/opencyphal/toolshed:ts22.4.10",
4+
"workspaceFolder": "/repo",
5+
"workspaceMount": "source=${localWorkspaceFolder},target=/repo,type=bind,consistency=delegated",
6+
"mounts": [
7+
"source=profile-nunavut-c,target=/root,type=volume",
8+
"target=/root/.vscode-server,type=volume"
9+
],
10+
"customizations": {
11+
"vscode": {
12+
"extensions": [
13+
"uavcan.dsdl",
14+
"wholroyd.jinja",
15+
"ms-vscode.cpptools",
16+
"ms-vscode.cpptools-themes",
17+
"ms-vscode.cmake-tools",
18+
"josetr.cmake-language-support-vscode",
19+
"streetsidesoftware.code-spell-checker",
20+
"xaver.clang-format",
21+
"vadimcn.vscode-lldb",
22+
"matepek.vscode-catch2-test-adapter",
23+
"ms-python.python",
24+
"ms-python.mypy-type-checker",
25+
"ms-python.black-formatter",
26+
"ms-python.pylint"
27+
]
28+
}
29+
},
30+
"runArgs": ["--platform=linux/amd64", "-i"],
31+
"postCreateCommand": "git submodule update --init --recursive"
32+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "C/C++ verification environment with lcov (arm64)",
3+
"image": "ghcr.io/opencyphal/toolshed:ts22.4.10",
4+
"workspaceFolder": "/repo",
5+
"workspaceMount": "source=${localWorkspaceFolder},target=/repo,type=bind,consistency=delegated",
6+
"mounts": [
7+
"source=profile-nunavut-c,target=/root,type=volume",
8+
"target=/root/.vscode-server,type=volume"
9+
],
10+
"customizations": {
11+
"vscode": {
12+
"extensions": [
13+
"uavcan.dsdl",
14+
"wholroyd.jinja",
15+
"ms-vscode.cpptools",
16+
"ms-vscode.cpptools-themes",
17+
"ms-vscode.cmake-tools",
18+
"josetr.cmake-language-support-vscode",
19+
"streetsidesoftware.code-spell-checker",
20+
"xaver.clang-format",
21+
"vadimcn.vscode-lldb",
22+
"matepek.vscode-catch2-test-adapter",
23+
"ms-python.python",
24+
"ms-python.mypy-type-checker",
25+
"ms-python.black-formatter",
26+
"ms-python.pylint"
27+
]
28+
}
29+
},
30+
"runArgs": ["--platform=linux/arm64", "-i"],
31+
"postCreateCommand": "git submodule update --init --recursive"
32+
}

.github/verify_global.ini

Lines changed: 0 additions & 6 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 10 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
path: .tox/py311-test/tmp/
6767
- name: set-environment
6868
run: |
69-
echo NUNAVUT_MAJOR_MINOR_VERSION=$(./version_check_nunavut --major-minor-version-only) >> $GITHUB_ENV
69+
echo NUNAVUT_MAJOR_MINOR_VERSION=$(./src/nunavut/_version.py --major-minor-only) >> $GITHUB_ENV
7070
- name: verify tox artifacts
7171
run: ls -R
7272
working-directory: .tox
@@ -133,51 +133,27 @@ jobs:
133133
- name: python3.${{ matrix.python3-version }} test
134134
run: tox -e py3${{ matrix.python3-version }}-nnvg,py3${{ matrix.python3-version }}-test
135135

136-
language-verification-c:
136+
language-verification-c-cpp:
137137
runs-on: ubuntu-latest
138138
needs: test
139139
container: ghcr.io/opencyphal/toolshed:ts24.4.3
140140
strategy:
141141
matrix:
142-
architecture: [native32, native]
142+
architecture: [native32, native, arm-none-eabi]
143143
compiler: [gcc, clang]
144+
language: [c-11, c-11-arr-override, cpp-14, cpp-17, cpp-20]
144145
exclude:
145146
- architecture: native32
146147
compiler: clang
147-
steps:
148-
- uses: actions/checkout@v4
149-
with:
150-
submodules: true
151-
- name: verify
152-
# We're using Ninja multi-config so we only have to configure once for all build types
153-
working-directory: verification
154-
run: |
155-
cmake -DNUNAVUT_EXTRA_GENERATOR_ARGS=--embed-auditing-info --preset config-${{ matrix.compiler }}-${{ matrix.architecture }}-c-11
156-
cmake --build --preset build-${{ matrix.compiler }}-${{ matrix.architecture }}-c-11-release
157-
cmake --build --preset build-${{ matrix.compiler }}-${{ matrix.architecture }}-c-11-debugasan
158-
159-
language-verification-cpp:
160-
runs-on: ubuntu-latest
161-
needs: test
162-
container: ghcr.io/opencyphal/toolshed:ts24.4.3
163-
strategy:
164-
matrix:
165-
architecture: [native32, native]
166-
compiler: [gcc, clang]
167-
language: [cpp-14, cpp-17, cpp-20]
168-
exclude:
169-
- architecture: native32
148+
- architecture: arm-none-eabi
170149
compiler: clang
171150
steps:
172151
- uses: actions/checkout@v4
173152
with:
174153
submodules: true
175154
- name: verify
176155
working-directory: verification
177-
run: |
178-
cmake -DNUNAVUT_EXTRA_GENERATOR_ARGS=--embed-auditing-info --preset config-${{ matrix.compiler }}-${{ matrix.architecture }}-${{ matrix.language }}
179-
cmake --build --preset build-${{ matrix.compiler }}-${{ matrix.architecture }}-${{ matrix.language }}-debugasan
180-
cmake --build --preset build-${{ matrix.compiler }}-${{ matrix.architecture }}-${{ matrix.language }}-release
156+
run: cmake --workflow --preset workflow-${{ matrix.compiler }}-${{ matrix.architecture }}-${{ matrix.language }}
181157

182158
language-verification-c-clang-native-extra:
183159
runs-on: ubuntu-latest
@@ -190,8 +166,8 @@ jobs:
190166
- name: verify
191167
working-directory: verification
192168
run: |
193-
cmake -DNUNAVUT_EXTRA_GENERATOR_ARGS="--enable-override-variable-array-capacity;--embed-auditing-info" --preset config-clang-native-c-11
194-
cmake --build --preset build-clang-native-c-11-debugcov --target cov_all
169+
cmake -DNUNAVUT_EXTRA_GENERATOR_ARGS="--enable-override-variable-array-capacity;--embed-auditing-info" --preset configure-clang-native-c-11
170+
cmake --build --preset build-DebugCov-clang-native-c-11 --target cov_all
195171
- name: upload-verification-coverage-reports
196172
uses: actions/upload-artifact@v4
197173
with:
@@ -209,8 +185,8 @@ jobs:
209185
- name: verify
210186
working-directory: verification
211187
run: |
212-
cmake -DNUNAVUT_EXTRA_GENERATOR_ARGS="--enable-override-variable-array-capacity;--embed-auditing-info" --preset config-clang-native-cpp-20
213-
cmake --build --preset build-clang-native-cpp-20-debugcov --target cov_all
188+
cmake -DNUNAVUT_EXTRA_GENERATOR_ARGS="--enable-override-variable-array-capacity;--embed-auditing-info" --preset configure-clang-native-cpp-20
189+
cmake --build --preset build-DebugCov-clang-native-cpp-20 --target cov_all
214190
- name: upload-verification-coverage-reports
215191
uses: actions/upload-artifact@v4
216192
with:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ prof
3232
out
3333
venv*
3434
*.bkp
35+
*.bak
3536

3637
# Eclipse
3738
.metadata

.vscode/settings.json

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,60 @@
3333
"**/*.egg-info": true
3434
},
3535
"files.associations": {
36+
"*.in": "cmake",
37+
"Config": "perl",
3638
"*.py.template": "python",
3739
"nunavut_support.j2": "python",
40+
"array": "cpp",
41+
"atomic": "cpp",
42+
"*.tcc": "cpp",
43+
"bitset": "cpp",
44+
"cctype": "cpp",
45+
"charconv": "cpp",
46+
"clocale": "cpp",
47+
"cmath": "cpp",
48+
"compare": "cpp",
49+
"concepts": "cpp",
50+
"cstddef": "cpp",
51+
"cstdint": "cpp",
52+
"cstdio": "cpp",
53+
"cstdlib": "cpp",
54+
"cstring": "cpp",
55+
"cwchar": "cpp",
56+
"vector": "cpp",
57+
"exception": "cpp",
58+
"algorithm": "cpp",
59+
"iterator": "cpp",
60+
"memory_resource": "cpp",
61+
"optional": "cpp",
62+
"string": "cpp",
63+
"string_view": "cpp",
64+
"system_error": "cpp",
65+
"tuple": "cpp",
66+
"type_traits": "cpp",
67+
"utility": "cpp",
68+
"initializer_list": "cpp",
69+
"iosfwd": "cpp",
70+
"istream": "cpp",
71+
"limits": "cpp",
72+
"mutex": "cpp",
73+
"new": "cpp",
74+
"ostream": "cpp",
75+
"span": "cpp",
76+
"stdexcept": "cpp",
77+
"streambuf": "cpp",
78+
"typeinfo": "cpp",
79+
"variant": "cpp",
80+
"format": "cpp",
81+
"__bit_reference": "cpp",
82+
"__locale": "cpp",
83+
"__split_buffer": "cpp",
84+
"__verbose_abort": "cpp",
85+
"ios": "cpp",
86+
"locale": "cpp",
87+
"print": "cpp",
88+
"queue": "cpp",
89+
"stack": "cpp"
3890
},
3991
"editor.wordWrapColumn": 120,
4092
"editor.rulers": [
@@ -47,7 +99,7 @@
4799
"reflow.preferredLineLength": 120,
48100
"testMate.cpp.test.advancedExecutables": [
49101
{
50-
"pattern": "build/**/suite/{test,Test,TEST}_*",
102+
"pattern": "verification/build/**/{test,Test,TEST}_*",
51103
"cwd": "${workspaceFolder}"
52104
}
53105
],

CONTRIBUTING.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@ your dev environment setup.
1414
- See `nunavut on read the docs`_ for the full set of nunavut documentation.
1515
- See the `OpenCyphal website`_ for documentation on the Cyphal protocol.
1616

17-
.. warning::
17+
************************************************
18+
Release
19+
************************************************
1820

19-
When committing to main you **must** bump at least the patch number in ``src/nunavut/_version.py``
20-
or the build will fail on the upload step.
21+
To release nunavut to Pypi and on github first bump the version number in ``src/nunavut/_version.py``.
22+
Once that is merged into the branch you are releasing from then you just create a new github release and tag the
23+
change with the same version number you set in ``src/nunavut/_version.py``. Once you create this release the CI
24+
will kickoff and do the rest for you.
2125

2226

2327
************************************************
@@ -296,7 +300,9 @@ three variables you can set in your environment or pass into cmake if using cmak
296300

297301
- ``NUNAVUT_VERIFICATION_LANG`` - By default this will be 'c'. Set to 'c' or 'cpp'
298302
- ``NUNAVUT_VERIFICATION_LANG_STANDARD`` - See the supported options for ``--language-standard`` (see ``nnvg -h``)
299-
- ``NUNAVUT_VERIFICATION_TARGET_PLATFORM`` - 'native' by default. 'native32' for cross-compiling for a 32-bit version of the native platform.
303+
- ``NUNAVUT_VERIFICATION_TARGET_PLATFORM`` - 'native' by default. 'native32' for cross-compiling for a 32-bit version
304+
of the native platform and 'armv7m' to cross-compile for a generic arm
305+
micro controller (cortex-m).
300306

301307
All other options set when generating code are provided by setting ``NUNAVUT_EXTRA_GENERATOR_ARGS`` in your environment.
302308

0 commit comments

Comments
 (0)