Skip to content

Commit fa78596

Browse files
authored
Update nuclear subtree (#24)
Updating the nuclear subtree to fix the memory leak in NUClearNet. The fix: (Fastcode/NUClear@2b46a4d)
1 parent 5d934c7 commit fa78596

251 files changed

Lines changed: 10659 additions & 6153 deletions

File tree

Some content is hidden

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

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nuclearnet.js",
3-
"version": "1.7.1",
3+
"version": "1.7.2",
44
"description": "Node.js module for interacting with the NUClear network",
55
"main": "index.js",
66
"types": "index.d.ts",

src/nuclear/.clang-tidy

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Checks: >
77
clang-diagnostic-*,
88
clang-analyzer-*,
99
cppcoreguidelines-*,
10+
-cppcoreguidelines-avoid-const-or-ref-data-members,
1011
-cppcoreguidelines-avoid-magic-numbers,
1112
-cppcoreguidelines-non-private-member-variables-in-classes,
1213
-cppcoreguidelines-owning-memory,
@@ -26,7 +27,9 @@ Checks: >
2627
-misc-non-private-member-variables-in-classes,
2728
-misc-no-recursion,
2829
performance-*,
30+
-performance-avoid-endl,
2931
readability-*,
32+
-readability-avoid-nested-conditional-operator,
3033
-readability-function-cognitive-complexity,
3134
-readability-function-size,
3235
-readability-identifier-length,
@@ -37,7 +40,6 @@ Checks: >
3740
-modernize-use-emplace
3841
WarningsAsErrors: ""
3942
HeaderFilterRegex: ".*"
40-
AnalyzeTemporaryDtors: false
4143
FormatStyle: file
4244
CheckOptions:
4345
- key: cppcoreguidelines-avoid-magic-numbers.IgnoredFloatingPointValues
@@ -49,9 +51,9 @@ CheckOptions:
4951
- key: readability-magic-numbers.IgnoredIntegerValues
5052
value: "1;2;3;4;"
5153
- key: llvm-namespace-comment.ShortNamespaceLines
52-
value: '1'
54+
value: "1"
5355
- key: llvm-namespace-comment.SpacesBeforeComments
54-
value: '2'
56+
value: "2"
5557
- key: misc-move-constructor-init.IncludeStyle
5658
value: google
5759
- key: modernize-loop-convert.NamingStyle
@@ -61,10 +63,10 @@ CheckOptions:
6163
- key: modernize-replace-auto-ptr.IncludeStyle
6264
value: google
6365
- key: performance-for-range-copy.WarnOnAllAutoCopies
64-
value: '1'
66+
value: "1"
6567
- key: performance-type-promotion-in-math-fn.IncludeStyle
6668
value: google
6769
- key: performance-unnecessary-value-param.IncludeStyle
6870
value: google
6971
- key: readability-braces-around-statements.ShortStatementLines
70-
value: '1'
72+
value: "1"

src/nuclear/.cmake-format.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
with section("parse"):
55

66
# Specify structure for custom cmake functions
7-
additional_commands = {
8-
"HeaderLibrary": {"kwargs": {"NAME": "*", "HEADER": "*", "PATH_SUFFIX": "*", "URL": "*"}},
9-
}
7+
additional_commands = {}
108

119
# Specify variable tags.
1210
vartags = []
@@ -213,6 +211,5 @@
213211
# A dictionary containing any per-command configuration overrides. Currently
214212
# only `command_case` is supported.
215213
per_command = {
216-
"HeaderLibrary": {"command_case": "unchanged"},
217214
"ToolchainLibraryFinder": {"command_case": "unchanged"},
218215
}

src/nuclear/.github/workflows/gcc.yaml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ jobs:
3434
version: "8"
3535
- container: ubuntu:20.04
3636
version: "7"
37-
- container: ubuntu:18.04
38-
version: "6"
39-
- container: ubuntu:18.04
40-
version: "5"
4137

4238
name: Linux GCC-${{ matrix.toolchain.version }}
4339
runs-on: ubuntu-latest
@@ -48,12 +44,12 @@ jobs:
4844

4945
steps:
5046
- name: Checkout Code
51-
uses: actions/checkout@v3
47+
uses: actions/checkout@v4
5248

5349
# Update for all the actions that need to install stuff
5450
- run: |
5551
apt-get update
56-
apt-get install -y software-properties-common
52+
apt-get install -y software-properties-common unzip
5753
5854
- name: Install GCC
5955
run: |
@@ -95,7 +91,15 @@ jobs:
9591
run: ccache --show-stats
9692

9793
- name: Test
98-
timeout-minutes: 10
99-
run: |
100-
build/tests/test_nuclear
101-
for f in build/tests/individual/*; do echo "Testing $f"; ./$f; done
94+
timeout-minutes: 2
95+
working-directory: build/tests
96+
run: ctest --output-on-failure -E "dsl/UDP"
97+
98+
- name: Upload Traces
99+
if: always()
100+
uses: actions/upload-artifact@v4
101+
with:
102+
name: traces-gcc-${{ matrix.toolchain.version }}
103+
path: build/tests/**/*.trace
104+
retention-days: 1 # This sets the artifact TTL to 1 day (minimum is 1 day)
105+
overwrite: true

src/nuclear/.github/workflows/linting.yaml

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424

2525
steps:
2626
- name: Checkout Code
27-
uses: actions/checkout@v3
27+
uses: actions/checkout@v4
2828

2929
- name: Install clang-tidy-15
3030
run: |
@@ -48,6 +48,34 @@ jobs:
4848
key: ${{ github.job }}
4949
max-size: 100M
5050

51+
# Install ctcache
52+
- name: Install ctcache
53+
shell: bash
54+
run: |
55+
CTCACHE_REF=debfea68152c5221d8f409cbef85dc5d0f98071d
56+
curl --location https://raw.githubusercontent.com/matus-chochlik/ctcache/${CTCACHE_REF}/clang-tidy-cache | sudo tee /usr/local/bin/clang-tidy-cache > /dev/null
57+
58+
echo #!/bin/bash | sudo tee /usr/local/bin/clang-tidy > /dev/null
59+
echo /usr/local/bin/clang-tidy-cache '"${CTCACHE_CLANG_TIDY}"' '"$@"' | sudo tee -a /usr/local/bin/clang-tidy > /dev/null
60+
61+
sudo chmod +x /usr/local/bin/clang-tidy-cache /usr/local/bin/clang-tidy
62+
63+
mkdir -p ${{ github.workspace }}/.ctcache
64+
65+
echo CTCACHE_CLANG_TIDY='/usr/bin/clang-tidy-15' >> "$GITHUB_ENV"
66+
echo CTCACHE_LOCAL=1 >> "$GITHUB_ENV"
67+
echo CTCACHE_SAVE_OUTPUT=1 >> "$GITHUB_ENV"
68+
echo CTCACHE_DIR='${{github.workspace}}/.ctcache' >> "$GITHUB_ENV"
69+
echo "CTCACHE_NOW=$(date -u +"%Y-%m-%dT%H:%M:%S.%3NZ")" >> $GITHUB_ENV
70+
71+
- name: Setup caching for ctcache
72+
uses: actions/cache@v4
73+
with:
74+
key: ctcache-${{ github.workflow }}-${{ github.job }}-${{ env.CTCACHE_NOW }}
75+
path: ${{ env.CTCACHE_DIR }}
76+
restore-keys: ctcache-${{ github.workflow }}-${{ github.job }}-
77+
save-always: true
78+
5179
- name: Configure CMake
5280
run: |
5381
cmake -E make_directory build
@@ -56,14 +84,16 @@ jobs:
5684
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
5785
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
5886
-DBUILD_TESTS=ON \
59-
-DCMAKE_BUILD_TYPE=Release \
87+
-DCMAKE_BUILD_TYPE=Debug \
6088
-DCI_BUILD=ON \
6189
-DENABLE_CLANG_TIDY=ON
6290
6391
- name: Build
6492
timeout-minutes: 30
65-
# Execute the build. You can specify a specific target with "--target <NAME>"
66-
run: cmake --build build --config Release --parallel 2
93+
run: cmake --build build --config Debug --parallel 2
6794

6895
- name: CCache Stats
6996
run: ccache --show-stats
97+
98+
- name: CTCache Stats
99+
run: clang-tidy-cache --show-stats

src/nuclear/.github/workflows/macos.yaml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323

2424
steps:
2525
- name: Checkout Code
26-
uses: actions/checkout@v3
26+
uses: actions/checkout@v4
2727

2828
- name: Setup CCache
2929
uses: hendrikmuhs/ccache-action@v1.2
@@ -38,6 +38,8 @@ jobs:
3838
ninjaVersion: 1.11.1
3939

4040
- name: Configure CMake
41+
env:
42+
CXXFLAGS: -DNUCLEAR_TEST_TIME_UNIT_DEN=10
4143
run: |
4244
cmake -E make_directory build
4345
cmake -S . -B build \
@@ -57,7 +59,15 @@ jobs:
5759
run: ccache --show-stats
5860

5961
- name: Test
60-
timeout-minutes: 10
61-
run: |
62-
build/tests/test_nuclear
63-
for f in build/tests/individual/*; do echo "Testing $f"; ./$f; done
62+
timeout-minutes: 5
63+
working-directory: build/tests
64+
run: ctest --output-on-failure
65+
66+
- name: Upload Traces
67+
if: always()
68+
uses: actions/upload-artifact@v4
69+
with:
70+
name: traces-macos
71+
path: build/tests/**/*.trace
72+
retention-days: 1 # This sets the artifact TTL to 1 day (minimum is 1 day)
73+
overwrite: true

src/nuclear/.github/workflows/sonarcloud.yaml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ jobs:
2222
env:
2323
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
2424
steps:
25-
- uses: actions/checkout@v3
25+
- uses: actions/checkout@v4
2626
with:
2727
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
2828

2929
- name: Install gcovr
30-
run: pip install gcovr==6.0
30+
run: pip install gcovr==7.2
3131

3232
- name: Install sonar-scanner and build-wrapper
33-
uses: SonarSource/sonarcloud-github-c-cpp@v2
33+
uses: SonarSource/sonarcloud-github-c-cpp@v3
3434

3535
- name: Install CMake
3636
uses: lukka/get-cmake@latest
@@ -57,24 +57,34 @@ jobs:
5757
-DCI_BUILD=ON \
5858
-DENABLE_CLANG_TIDY=OFF
5959
60-
- name: Build with Sonar Wrapper
60+
- name: Build the code in debug mode
6161
timeout-minutes: 30
62-
run: build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build/ --config Debug
62+
run: cmake --build build/ --config Debug
6363

6464
- name: Run tests to generate coverage statistics
6565
timeout-minutes: 10
66-
run: |
67-
build/tests/test_nuclear
68-
for f in build/tests/individual/*; do echo "Testing $f"; ./$f; done
66+
working-directory: build/tests
67+
run: ctest --output-on-failure
6968

7069
- name: Collect coverage into one XML report
71-
run: gcovr --exclude-unreachable-branches --exclude-noncode-lines --sonarqube > coverage.xml
70+
if: always()
71+
run: gcovr --gcov-ignore-parse-errors=negative_hits.warn_once_per_file --exclude-unreachable-branches --exclude-noncode-lines --sonarqube > coverage.xml
7272

7373
- name: Run sonar-scanner
74+
if: always()
7475
env:
7576
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7677
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
7778
run: |
7879
sonar-scanner \
79-
--define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" \
80+
--define sonar.cfamily.compile-commands=build/compile_commands.json \
8081
--define sonar.coverageReportPaths=coverage.xml
82+
83+
- name: Upload Traces
84+
if: always()
85+
uses: actions/upload-artifact@v4
86+
with:
87+
name: traces-sonar
88+
path: build/tests/**/*.trace
89+
retention-days: 1 # This sets the artifact TTL to 1 day (minimum is 1 day)
90+
overwrite: true

src/nuclear/.github/workflows/windows.yaml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636

3737
steps:
3838
- name: Checkout Code
39-
uses: actions/checkout@v3
39+
uses: actions/checkout@v4
4040

4141
- name: Setup CCache
4242
uses: hendrikmuhs/ccache-action@v1.2
@@ -56,6 +56,8 @@ jobs:
5656
uses: ilammy/msvc-dev-cmd@v1
5757

5858
- name: Configure CMake
59+
env:
60+
CXXFLAGS: -DNUCLEAR_TEST_TIME_UNIT_DEN=10
5961
shell: cmd
6062
run: |
6163
cmake -E make_directory build
@@ -78,8 +80,15 @@ jobs:
7880
run: sccache --show-stats
7981

8082
- name: Test
81-
timeout-minutes: 10
82-
shell: bash
83-
run: |
84-
build/tests/test_nuclear.exe
85-
for f in build/tests/individual/*; do echo "Testing $f"; ./$f; done
83+
timeout-minutes: 5
84+
working-directory: build/tests
85+
run: ctest --output-on-failure
86+
87+
- name: Upload Traces
88+
if: always()
89+
uses: actions/upload-artifact@v4
90+
with:
91+
name: traces-windows-${{ matrix.toolchain.name }}
92+
path: build/tests/**/*.trace
93+
retention-days: 1 # This sets the artifact TTL to 1 day (minimum is 1 day)
94+
overwrite: true

0 commit comments

Comments
 (0)