diff --git a/.bazelignore b/.bazelignore index 788b23a4..925e5c4f 100644 --- a/.bazelignore +++ b/.bazelignore @@ -38,6 +38,7 @@ _build/ .github/ .idea/ .reuse/ +.venv/ cmake-build-debug/ cmake-build-default/ cmake-build-minsizerel/ diff --git a/.buildifier.json b/.buildifier.json index fec67e6d..04d1b9d6 100644 --- a/.buildifier.json +++ b/.buildifier.json @@ -1,7 +1,7 @@ { "type": "auto", - "mode": "fix", - "lint": "fix", + "mode": "check", + "lint": "warn", "warningsList": [ "all" ] diff --git a/.clang-tidy b/.clang-tidy index 68b52c66..612ea002 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -54,11 +54,15 @@ Checks: > -cert-msc50-cpp, -cert-msc51-cpp, -clang-analyzer-security.insecureAPI.rand, + -cppcoreguidelines-avoid-do-while, -cppcoreguidelines-avoid-magic-numbers, + -misc-include-cleaner, -misc-no-recursion, -readability-function-cognitive-complexity, -readability-identifier-length, - -readability-magic-numbers + -readability-magic-numbers, + -readability-math-missing-parentheses + CheckOptions: - key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic diff --git a/.cppcheck-suppressions.xml b/.cppcheck-suppressions.xml new file mode 100644 index 00000000..869da080 --- /dev/null +++ b/.cppcheck-suppressions.xml @@ -0,0 +1,50 @@ + + + + + missingInclude + + + missingIncludeSystem + + + unmatchedSuppression + + + unusedFunction + + + unusedStructMember + + diff --git a/.deepsource.toml b/.deepsource.toml new file mode 100644 index 00000000..c162fca9 --- /dev/null +++ b/.deepsource.toml @@ -0,0 +1,52 @@ +# +# .deepsource.toml +# RVO2 Library +# +# SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Please send all bug reports to . +# +# The authors may be contacted via: +# +# Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +# Dept. of Computer Science +# 201 S. Columbia St. +# Frederick P. Brooks, Jr. Computer Science Bldg. +# Chapel Hill, N.C. 27599-3175 +# United States of America +# +# +# + +version = 1 + +[[analyzers]] +name = "cxx" +enabled = true + + [analyzers.meta] + compiler_flags = ["-std=c++98"] + cyclomatic_complexity_threshold = "medium" + include_paths = ["src/"] + misra_compliance = true + +[[analyzers]] +name = "docker" +enabled = true + + [analyzers.meta] + dockerfile_paths = ["Dockerfile"] + trusted_registries = ["docker.io"] diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 9ccbeab0..d18e6ea2 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,4 +1,5 @@ { + "$schema": "https://raw.githubusercontent.com/devcontainers/spec/refs/heads/main/schemas/devContainer.schema.json", "name": "RVO2", "customizations": { "vscode": { diff --git a/.dockerignore b/.dockerignore index 52c9795a..44c7ddd5 100644 --- a/.dockerignore +++ b/.dockerignore @@ -37,6 +37,7 @@ _build/ .idea/ .user.bazelrc +.venv/ bazel-* cmake-build-*/ CMakeUserPresets.json diff --git a/.editorconfig b/.editorconfig index 929a14bc..3a18a8a0 100644 --- a/.editorconfig +++ b/.editorconfig @@ -48,20 +48,26 @@ trim_trailing_whitespace = true [*.bazel] indent_size = 4 +[*.build] +indent_size = 4 + [*.md] trim_trailing_whitespace = false -[.bazelignore] +[*.options] indent_size = 4 -[.bazelrc] -indent_size = 4 +[*.yaml] +max_line_length = 90 -[Brewfile] +[*.yml] +max_line_length = 90 + +[.bazelignore] indent_size = 4 -[*.build] +[.bazelrc] indent_size = 4 -[*.options] +[Brewfile] indent_size = 4 diff --git a/.gersemirc b/.gersemirc new file mode 100644 index 00000000..67ec3cbd --- /dev/null +++ b/.gersemirc @@ -0,0 +1,39 @@ +# -*- mode: yaml; -*- +# vi: set ft=yaml: +# +# .gersemirc +# RVO2 Library +# +# SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Please send all bug reports to . +# +# The authors may be contacted via: +# +# Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +# Dept. of Computer Science +# 201 S. Columbia St. +# Frederick P. Brooks, Jr. Computer Science Bldg. +# Chapel Hill, N.C. 27599-3175 +# United States of America +# +# +# + +# yamllint disable-line rule:line-length +# yaml-language-server: $schema=https://raw.githubusercontent.com/BlankSpruce/gersemi/0.27.2/gersemi/configuration.schema.json +--- +indent: 2 diff --git a/.gitattributes b/.gitattributes index 9b2f3846..8719763e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -52,30 +52,33 @@ *.css text diff=css linguist-documentation whitespace=trailing-space *.h text diff=cpp linguist-language=c++ whitespace-2 *.html text diff=html linguist-documentation whitespace=trailing-space -*.imp text linguist-language=json whitespace-2 +*.imp text linguist-language=yaml whitespace-2 *.json text whitespace-2 *.license text linguist-documentation whitespace-0 *.md text diff=markdown whitespace-md *.options text diff=python linguist-language=meson whitespace-4 *.pc.in text whitespace-2 +*.toml text whitespace-2 *.txt text +*.xml text whitespace-2 *.yaml text whitespace-2 *.yml text whitespace-2 .bazelignore text whitespace-4 .bazelrc text whitespace-4 -.bazelversion text whitespace-4 +.bazelversion text whitespace-0 .clang-format text whitespace-2 .clang-tidy text whitespace-2 .dockerignore text whitespace-2 .editorconfig text whitespace-2 +.gersemirc text whitespace-2 .gitattributes text export-ignore whitespace-2 .gitignore text export-ignore whitespace-2 +.secrets.baseline text whitespace-2 .zenodo.json export-ignore linguist-documentation Brewfile text diff=ruby export-ignore whitespace-4 CMakeLists.txt whitespace-2 CODEOWNERS text whitespace-2 -dep5 text linguist-documentation whitespace-1 Dockerfile text whitespace-2 LICENSE text linguist-documentation linguist-vendored whitespace-0 README.md linguist-documentation diff --git a/.github/actionlint-matcher.json b/.github/actionlint-matcher.json new file mode 100644 index 00000000..bad02897 --- /dev/null +++ b/.github/actionlint-matcher.json @@ -0,0 +1,17 @@ +{ + "problemMatcher": [ + { + "owner": "actionlint", + "pattern": [ + { + "regexp": "^(.+):(\\d+):(\\d+): (.+) \\[(.+)\\]$", + "file": 1, + "line": 2, + "column": 3, + "message": 4, + "code": 5 + } + ] + } + ] +} diff --git a/include-what-you-use.imp.license b/.github/actionlint-matcher.json.license similarity index 97% rename from include-what-you-use.imp.license rename to .github/actionlint-matcher.json.license index b600f00b..3686baca 100644 --- a/include-what-you-use.imp.license +++ b/.github/actionlint-matcher.json.license @@ -1,4 +1,4 @@ -include-what-you-use.imp +actionlint-matcher.json RVO2 Library SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill diff --git a/.github/buildifier-matcher.json b/.github/buildifier-matcher.json new file mode 100644 index 00000000..ead1f736 --- /dev/null +++ b/.github/buildifier-matcher.json @@ -0,0 +1,17 @@ +{ + "problemMatcher": [ + { + "owner": "buildifier", + "severity": "warning", + "pattern": [ + { + "regexp": "^(.+):(\\d+)(?::(\\d+))?\\s*:\\s*([^:]+?)\\s*:\\s*(.+)$", + "file": 1, + "line": 2, + "code": 4, + "message": 5 + } + ] + } + ] +} diff --git a/.github/buildifier-matcher.json.license b/.github/buildifier-matcher.json.license new file mode 100644 index 00000000..997b19e3 --- /dev/null +++ b/.github/buildifier-matcher.json.license @@ -0,0 +1,30 @@ +buildifier-matcher.json +RVO2 Library + +SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +SPDX-License-Identifier: Apache-2.0 + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +Please send all bug reports to . + +The authors may be contacted via: + +Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +Dept. of Computer Science +201 S. Columbia St. +Frederick P. Brooks, Jr. Computer Science Bldg. +Chapel Hill, N.C. 27599-3175 +United States of America + + diff --git a/.github/clang-tidy-matcher.json b/.github/clang-tidy-matcher.json new file mode 100644 index 00000000..353e496f --- /dev/null +++ b/.github/clang-tidy-matcher.json @@ -0,0 +1,18 @@ +{ + "problemMatcher": [ + { + "owner": "clang-tidy", + "pattern": [ + { + "regexp": "^(.+):(\\d+):(\\d+):\\s+(warning|error):\\s+(.+)\\s+\\[([^\\]]+)\\]$", + "file": 1, + "line": 2, + "column": 3, + "severity": 4, + "message": 5, + "code": 6 + } + ] + } + ] +} diff --git a/.github/clang-tidy-matcher.json.license b/.github/clang-tidy-matcher.json.license new file mode 100644 index 00000000..21ffe03a --- /dev/null +++ b/.github/clang-tidy-matcher.json.license @@ -0,0 +1,30 @@ +clang-tidy-matcher.json +RVO2 Library + +SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +SPDX-License-Identifier: Apache-2.0 + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +Please send all bug reports to . + +The authors may be contacted via: + +Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +Dept. of Computer Science +201 S. Columbia St. +Frederick P. Brooks, Jr. Computer Science Bldg. +Chapel Hill, N.C. 27599-3175 +United States of America + + diff --git a/.github/codespell-matcher.json b/.github/codespell-matcher.json new file mode 100644 index 00000000..70322a8b --- /dev/null +++ b/.github/codespell-matcher.json @@ -0,0 +1,16 @@ +{ + "problemMatcher": [ + { + "owner": "codespell", + "severity": "warning", + "pattern": [ + { + "regexp": "^(.+):(\\d+): (.+)$", + "file": 1, + "line": 2, + "message": 3 + } + ] + } + ] +} diff --git a/.github/codespell-matcher.json.license b/.github/codespell-matcher.json.license new file mode 100644 index 00000000..1d87c6d7 --- /dev/null +++ b/.github/codespell-matcher.json.license @@ -0,0 +1,30 @@ +codespell-matcher.json +RVO2 Library + +SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +SPDX-License-Identifier: Apache-2.0 + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +Please send all bug reports to . + +The authors may be contacted via: + +Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +Dept. of Computer Science +201 S. Columbia St. +Frederick P. Brooks, Jr. Computer Science Bldg. +Chapel Hill, N.C. 27599-3175 +United States of America + + diff --git a/.github/cpplint-matcher.json b/.github/cpplint-matcher.json new file mode 100644 index 00000000..39048017 --- /dev/null +++ b/.github/cpplint-matcher.json @@ -0,0 +1,17 @@ +{ + "problemMatcher": [ + { + "owner": "cpplint", + "severity": "warning", + "pattern": [ + { + "regexp": "^(.+):(\\d+):\\s+(.+)\\s+\\[([^\\]]+)\\]\\s+\\[\\d+\\]$", + "file": 1, + "line": 2, + "message": 3, + "code": 4 + } + ] + } + ] +} diff --git a/.github/cpplint-matcher.json.license b/.github/cpplint-matcher.json.license new file mode 100644 index 00000000..7015089e --- /dev/null +++ b/.github/cpplint-matcher.json.license @@ -0,0 +1,30 @@ +cpplint-matcher.json +RVO2 Library + +SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +SPDX-License-Identifier: Apache-2.0 + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +Please send all bug reports to . + +The authors may be contacted via: + +Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +Dept. of Computer Science +201 S. Columbia St. +Frederick P. Brooks, Jr. Computer Science Bldg. +Chapel Hill, N.C. 27599-3175 +United States of America + + diff --git a/.github/detect-secrets-matcher.json b/.github/detect-secrets-matcher.json new file mode 100644 index 00000000..b09ec55f --- /dev/null +++ b/.github/detect-secrets-matcher.json @@ -0,0 +1,19 @@ +{ + "problemMatcher": [ + { + "owner": "detect-secrets", + "severity": "error", + "pattern": [ + { + "regexp": "^Secret Type: (.+)$", + "message": 1 + }, + { + "regexp": "^Location:\\s+(\\S+):(\\d+)$", + "file": 1, + "line": 2 + } + ] + } + ] +} diff --git a/.github/detect-secrets-matcher.json.license b/.github/detect-secrets-matcher.json.license new file mode 100644 index 00000000..c1535456 --- /dev/null +++ b/.github/detect-secrets-matcher.json.license @@ -0,0 +1,30 @@ +detect-secrets-matcher.json +RVO2 Library + +SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +SPDX-License-Identifier: Apache-2.0 + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +Please send all bug reports to . + +The authors may be contacted via: + +Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +Dept. of Computer Science +201 S. Columbia St. +Frederick P. Brooks, Jr. Computer Science Bldg. +Chapel Hill, N.C. 27599-3175 +United States of America + + diff --git a/.github/hadolint-matcher.json b/.github/hadolint-matcher.json new file mode 100644 index 00000000..0acb3fc0 --- /dev/null +++ b/.github/hadolint-matcher.json @@ -0,0 +1,30 @@ +{ + "problemMatcher": [ + { + "owner": "hadolint-error", + "severity": "error", + "pattern": [ + { + "regexp": "^(.+):(\\d+) (\\S+) error: (.+)$", + "file": 1, + "line": 2, + "code": 3, + "message": 4 + } + ] + }, + { + "owner": "hadolint-warning", + "severity": "warning", + "pattern": [ + { + "regexp": "^(.+):(\\d+) (\\S+) (?:warning|info|style): (.+)$", + "file": 1, + "line": 2, + "code": 3, + "message": 4 + } + ] + } + ] +} diff --git a/.github/hadolint-matcher.json.license b/.github/hadolint-matcher.json.license new file mode 100644 index 00000000..efc19923 --- /dev/null +++ b/.github/hadolint-matcher.json.license @@ -0,0 +1,30 @@ +hadolint-matcher.json +RVO2 Library + +SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +SPDX-License-Identifier: Apache-2.0 + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +Please send all bug reports to . + +The authors may be contacted via: + +Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +Dept. of Computer Science +201 S. Columbia St. +Frederick P. Brooks, Jr. Computer Science Bldg. +Chapel Hill, N.C. 27599-3175 +United States of America + + diff --git a/.github/lizard-matcher.json b/.github/lizard-matcher.json new file mode 100644 index 00000000..1e92c0bf --- /dev/null +++ b/.github/lizard-matcher.json @@ -0,0 +1,16 @@ +{ + "problemMatcher": [ + { + "owner": "lizard", + "severity": "warning", + "pattern": [ + { + "regexp": "^(.+):(\\d+): warning: (.+)$", + "file": 1, + "line": 2, + "message": 3 + } + ] + } + ] +} diff --git a/.github/lizard-matcher.json.license b/.github/lizard-matcher.json.license new file mode 100644 index 00000000..527acef1 --- /dev/null +++ b/.github/lizard-matcher.json.license @@ -0,0 +1,30 @@ +lizard-matcher.json +RVO2 Library + +SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +SPDX-License-Identifier: Apache-2.0 + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +Please send all bug reports to . + +The authors may be contacted via: + +Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +Dept. of Computer Science +201 S. Columbia St. +Frederick P. Brooks, Jr. Computer Science Bldg. +Chapel Hill, N.C. 27599-3175 +United States of America + + diff --git a/.github/markdownlint-matcher.json b/.github/markdownlint-matcher.json new file mode 100644 index 00000000..9f8749d8 --- /dev/null +++ b/.github/markdownlint-matcher.json @@ -0,0 +1,18 @@ +{ + "problemMatcher": [ + { + "owner": "markdownlint", + "pattern": [ + { + "regexp": "^(.+):(\\d+):(\\d+) (error|warning) (MD\\d+/\\S+) (.+)$", + "file": 1, + "line": 2, + "column": 3, + "severity": 4, + "code": 5, + "message": 6 + } + ] + } + ] +} diff --git a/.github/markdownlint-matcher.json.license b/.github/markdownlint-matcher.json.license new file mode 100644 index 00000000..65ac8642 --- /dev/null +++ b/.github/markdownlint-matcher.json.license @@ -0,0 +1,30 @@ +markdownlint-matcher.json +RVO2 Library + +SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +SPDX-License-Identifier: Apache-2.0 + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +Please send all bug reports to . + +The authors may be contacted via: + +Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +Dept. of Computer Science +201 S. Columbia St. +Frederick P. Brooks, Jr. Computer Science Bldg. +Chapel Hill, N.C. 27599-3175 +United States of America + + diff --git a/.github/workflows/actionlint.yml b/.github/workflows/actionlint.yml new file mode 100644 index 00000000..fb4c47a5 --- /dev/null +++ b/.github/workflows/actionlint.yml @@ -0,0 +1,90 @@ +# +# actionlint.yml +# RVO2 Library +# +# SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Please send all bug reports to . +# +# The authors may be contacted via: +# +# Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +# Dept. of Computer Science +# 201 S. Columbia St. +# Frederick P. Brooks, Jr. Computer Science Bldg. +# Chapel Hill, N.C. 27599-3175 +# United States of America +# +# +# + +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +--- +name: actionlint + +on: # yamllint disable-line rule:truthy + push: + branches: + - main + pull_request: + branches: + - main + schedule: + - cron: '30 6 * * *' + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + actionlint: + name: debian arm64 + runs-on: ubuntu-24.04-arm + container: debian:trixie-slim + timeout-minutes: 15 + steps: + - name: setup + run: | + apt-get -qq -o APT::Acquire::Retries=4 update \ + || (sleep 15; apt-get -qq -o APT::Acquire::Retries=4 update) + apt-get -qq -o APT::Acquire::Retries=4 -o Dpkg::Use-Pty=0 \ + --no-install-recommends install \ + ca-certificates \ + git \ + golang-go \ + pyflakes3 \ + shellcheck + apt-get -qq -o Dpkg::Use-Pty=0 autoremove + rm -rf /var/lib/apt/lists/* + go install github.com/rhysd/actionlint/cmd/actionlint@v1.7.12 + env: + DEBIAN_FRONTEND: noninteractive + shell: bash + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: add problem matcher + run: | + echo ::add-matcher::.github/actionlint-matcher.json + shell: bash + - name: actionlint + run: | + "$(go env GOPATH)/bin/actionlint" -oneline + shell: bash diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml new file mode 100644 index 00000000..d33fcdd0 --- /dev/null +++ b/.github/workflows/bazel.yml @@ -0,0 +1,556 @@ +# +# bazel.yml +# RVO2 Library +# +# SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Please send all bug reports to . +# +# The authors may be contacted via: +# +# Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +# Dept. of Computer Science +# 201 S. Columbia St. +# Frederick P. Brooks, Jr. Computer Science Bldg. +# Chapel Hill, N.C. 27599-3175 +# United States of America +# +# +# + +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +--- +name: bazel + +on: # yamllint disable-line rule:truthy + push: + branches: + - main + pull_request: + branches: + - main + schedule: + - cron: '0 6 * * *' + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + bazel-almalinux: + name: bazel almalinux amd64 + runs-on: ubuntu-latest + container: almalinux:10 + timeout-minutes: 30 + steps: + - name: setup + run: | + dnf makecache -q --refresh || (sleep 15; dnf makecache -q --refresh) + dnf install -q -y \ + ca-certificates \ + git \ + glibc-devel \ + wget \ + which + dnf clean all + rm -rf /var/cache/yum + wget -qO /usr/local/bin/bazelisk \ + https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 + chmod +x /usr/local/bin/bazelisk + ln -s /usr/local/bin/bazelisk /usr/local/bin/bazel + shell: bash + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: cache + uses: actions/cache@v5 + with: + path: | + ~/.cache/bazel + ~/.cache/bazelisk + key: >- + ${{ runner.os }}-${{ runner.arch }}-bazel-${{ + hashFiles('.bazelversion', 'MODULE.bazel', + '**/*.bazel', '**/*.bzl') }} + restore-keys: ${{ runner.os }}-${{ runner.arch }}-bazel- + - name: build test package + run: | + bazel test \ + --features=treat_warnings_as_errors \ + --flaky_test_attempts=3 \ + ... + shell: bash + + bazel-alpine: + name: bazel alpine linux amd64 + runs-on: ubuntu-latest + container: alpine:3 + timeout-minutes: 30 + steps: + - name: setup + run: | + echo "https://dl-cdn.alpinelinux.org/alpine/edge/testing" \ + >> /etc/apk/repositories + apk add --no-cache \ + bazel8 \ + ca-certificates \ + git + shell: sh + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: cache + uses: actions/cache@v5 + with: + path: ~/.cache/bazel + key: >- + ${{ runner.os }}-${{ runner.arch }}-bazel-${{ + hashFiles('MODULE.bazel', '**/*.bazel', '**/*.bzl') }} + restore-keys: ${{ runner.os }}-${{ runner.arch }}-bazel- + - name: build test package + run: | + bazel test \ + --config=alpine \ + --features=treat_warnings_as_errors \ + --flaky_test_attempts=3 \ + ... + shell: sh + + bazel-arch: + name: bazel arch linux amd64 + runs-on: ubuntu-latest + container: archlinux:latest + timeout-minutes: 30 + steps: + - name: setup + run: | + pacman --needed --noconfirm --noprogressbar -Sy \ + ca-certificates \ + git \ + wget \ + which + rm -rf \ + /var/cache/pacman/pkg/* \ + /var/lib/pacman/sync/* + wget -qO /usr/local/bin/bazelisk \ + https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 + chmod +x /usr/local/bin/bazelisk + ln -s /usr/local/bin/bazelisk /usr/local/bin/bazel + shell: bash + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: cache + uses: actions/cache@v5 + with: + path: | + ~/.cache/bazel + ~/.cache/bazelisk + key: >- + ${{ runner.os }}-${{ runner.arch }}-bazel-${{ + hashFiles('.bazelversion', 'MODULE.bazel', + '**/*.bazel', '**/*.bzl') }} + restore-keys: ${{ runner.os }}-${{ runner.arch }}-bazel- + - name: build test package + run: | + bazel test \ + --features=treat_warnings_as_errors \ + --flaky_test_attempts=3 \ + ... + shell: bash + + bazel-fedora: + name: bazel fedora linux amd64 + runs-on: ubuntu-latest + container: fedora:44 + timeout-minutes: 30 + steps: + - name: setup + run: | + dnf makecache -q --refresh || (sleep 15; dnf makecache -q --refresh) + dnf install -q -y \ + ca-certificates \ + git \ + glibc-devel \ + wget \ + which + dnf clean all + rm -rf /var/cache/yum + wget -qO /usr/local/bin/bazelisk \ + https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 + chmod +x /usr/local/bin/bazelisk + ln -s /usr/local/bin/bazelisk /usr/local/bin/bazel + shell: bash + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: cache + uses: actions/cache@v5 + with: + path: | + ~/.cache/bazel + ~/.cache/bazelisk + key: >- + ${{ runner.os }}-${{ runner.arch }}-bazel-${{ + hashFiles('.bazelversion', 'MODULE.bazel', + '**/*.bazel', '**/*.bzl') }} + restore-keys: ${{ runner.os }}-${{ runner.arch }}-bazel- + - name: build test package + run: | + bazel test \ + --features=treat_warnings_as_errors \ + --flaky_test_attempts=3 \ + ... + shell: bash + + bazel-macos: + name: bazel macos arm64 + runs-on: macos-26 + timeout-minutes: 30 + steps: + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: cache homebrew + uses: actions/cache@v5 + with: + path: ~/Library/Caches/Homebrew/downloads + key: >- + ${{ runner.os }}-${{ runner.arch }}-brew-${{ + hashFiles('Brewfile') }} + restore-keys: ${{ runner.os }}-${{ runner.arch }}-brew- + - name: setup + run: | + brew update -q || (sleep 15; brew update -q) + brew bundle install -q + brew cleanup -q -s + env: + HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + HOMEBREW_NO_ANALYTICS: 1 + HOMEBREW_NO_AUTO_UPDATE: 1 + HOMEBREW_NO_INSTALL_CLEANUP: 1 + shell: zsh -efuo pipefail {0} + - name: cache bazel + uses: actions/cache@v5 + with: + path: | + ~/.cache/bazel + ~/Library/Caches/bazelisk + key: >- + ${{ runner.os }}-${{ runner.arch }}-bazel-${{ + hashFiles('.bazelversion', 'MODULE.bazel', + '**/*.bazel', '**/*.bzl') }} + restore-keys: ${{ runner.os }}-${{ runner.arch }}-bazel- + - name: build test package + run: | + bazel test \ + --features=treat_warnings_as_errors \ + --flaky_test_attempts=3 \ + ... + shell: zsh -efuo pipefail {0} + + bazel-macos-x86_64: + name: bazel macos x86_64 + runs-on: macos-26-intel + timeout-minutes: 30 + steps: + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: cache homebrew + uses: actions/cache@v5 + with: + path: ~/Library/Caches/Homebrew/downloads + key: >- + ${{ runner.os }}-${{ runner.arch }}-brew-${{ + hashFiles('Brewfile') }} + restore-keys: ${{ runner.os }}-${{ runner.arch }}-brew- + - name: setup + run: | + brew update -q || (sleep 15; brew update -q) + brew bundle install -q + brew cleanup -q -s + env: + HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + HOMEBREW_NO_ANALYTICS: 1 + HOMEBREW_NO_AUTO_UPDATE: 1 + HOMEBREW_NO_INSTALL_CLEANUP: 1 + shell: zsh -efuo pipefail {0} + - name: cache bazel + uses: actions/cache@v5 + with: + path: | + ~/.cache/bazel + ~/Library/Caches/bazelisk + key: >- + ${{ runner.os }}-${{ runner.arch }}-bazel-${{ + hashFiles('.bazelversion', 'MODULE.bazel', + '**/*.bazel', '**/*.bzl') }} + restore-keys: ${{ runner.os }}-${{ runner.arch }}-bazel- + - name: build test package + run: | + bazel test \ + --features=treat_warnings_as_errors \ + --flaky_test_attempts=3 \ + ... + shell: zsh -efuo pipefail {0} + + bazel-opensuse: + name: bazel opensuse leap amd64 + runs-on: ubuntu-latest + container: opensuse/leap:16.0 + timeout-minutes: 30 + steps: + - name: setup + run: | + zypper -n -q ref || (sleep 15; zypper -n -q ref) + zypper -n -q in --no-recommends \ + ca-certificates \ + git \ + glibc-devel \ + wget \ + which + zypper -n -q cc -a + wget -qO /usr/local/bin/bazelisk \ + https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 + chmod +x /usr/local/bin/bazelisk + ln -s /usr/local/bin/bazelisk /usr/local/bin/bazel + shell: bash + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: cache + uses: actions/cache@v5 + with: + path: | + ~/.cache/bazel + ~/.cache/bazelisk + key: >- + ${{ runner.os }}-${{ runner.arch }}-bazel-${{ + hashFiles('.bazelversion', 'MODULE.bazel', + '**/*.bazel', '**/*.bzl') }} + restore-keys: ${{ runner.os }}-${{ runner.arch }}-bazel- + - name: build test package + run: | + bazel test \ + --features=treat_warnings_as_errors \ + --flaky_test_attempts=3 \ + ... + shell: bash + + bazel-ubuntu: + name: bazel ubuntu amd64 + runs-on: ubuntu-latest + container: ubuntu:26.04 + timeout-minutes: 30 + steps: + - name: setup + run: | + apt-get -qq -o APT::Acquire::Retries=4 update \ + || (sleep 15; apt-get -qq -o APT::Acquire::Retries=4 update) + apt-get -qq -o APT::Acquire::Retries=4 -o Dpkg::Use-Pty=0 \ + --no-install-recommends install \ + ca-certificates \ + g++ \ + git \ + wget + apt-get -qq -o Dpkg::Use-Pty=0 autoremove + rm -rf /var/lib/apt/lists/* + wget -q \ + https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-amd64.deb + dpkg -i bazelisk-amd64.deb + rm -rf bazelisk-amd64.deb + env: + DEBIAN_FRONTEND: noninteractive + shell: bash + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: cache + uses: actions/cache@v5 + with: + path: | + ~/.cache/bazel + ~/.cache/bazelisk + key: >- + ${{ runner.os }}-${{ runner.arch }}-bazel-${{ + hashFiles('.bazelversion', 'MODULE.bazel', + '**/*.bazel', '**/*.bzl') }} + restore-keys: ${{ runner.os }}-${{ runner.arch }}-bazel- + - name: build test package + run: | + bazel test \ + --features=treat_warnings_as_errors \ + --flaky_test_attempts=3 \ + ... + shell: bash + + bazel-ubuntu-arm64: + name: bazel ubuntu arm64 + runs-on: ubuntu-24.04-arm + container: ubuntu:26.04 + timeout-minutes: 30 + steps: + - name: setup + run: | + apt-get -qq -o APT::Acquire::Retries=4 update \ + || (sleep 15; apt-get -qq -o APT::Acquire::Retries=4 update) + apt-get -qq -o APT::Acquire::Retries=4 -o Dpkg::Use-Pty=0 \ + --no-install-recommends install \ + ca-certificates \ + g++ \ + git \ + wget + apt-get -qq -o Dpkg::Use-Pty=0 autoremove + rm -rf /var/lib/apt/lists/* + wget -q \ + https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-arm64.deb + dpkg -i bazelisk-arm64.deb + rm -rf bazelisk-arm64.deb + env: + DEBIAN_FRONTEND: noninteractive + shell: bash + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: cache + uses: actions/cache@v5 + with: + path: | + ~/.cache/bazel + ~/.cache/bazelisk + key: >- + ${{ runner.os }}-${{ runner.arch }}-bazel-${{ + hashFiles('.bazelversion', 'MODULE.bazel', + '**/*.bazel', '**/*.bzl') }} + restore-keys: ${{ runner.os }}-${{ runner.arch }}-bazel- + - name: build test package + run: | + bazel test \ + --features=treat_warnings_as_errors \ + --flaky_test_attempts=3 \ + ... + shell: bash + + bazel-windows: + name: bazel windows x64 + runs-on: windows-latest + timeout-minutes: 30 + steps: + - name: cache winget + uses: actions/cache@v5 + with: + path: | + ~\AppData\Local\Microsoft\WinGet\Links + ~\AppData\Local\Microsoft\WinGet\SourceData + key: >- + ${{ runner.os }}-${{ runner.arch }}-winget-${{ + hashFiles('.github/workflows/*.yml') }} + restore-keys: ${{ runner.os }}-${{ runner.arch }}-winget- + - name: setup + run: | + winget install -e --accept-package-agreements ` + --accept-source-agreements --id Git.Git + winget install -e -r bazel --accept-package-agreements ` + --accept-source-agreements --id Bazel.Bazelisk + Add-Content $env:GITHUB_PATH ( + [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ` + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")) + shell: pwsh + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: cache bazel + uses: actions/cache@v5 + with: + path: | + ~\_bazel_RUNNERADMIN + ~\AppData\Local\bazelisk + key: >- + ${{ runner.os }}-${{ runner.arch }}-bazel-${{ + hashFiles('.bazelversion', 'MODULE.bazel', + '**/*.bazel', '**/*.bzl') }} + restore-keys: ${{ runner.os }}-${{ runner.arch }}-bazel- + - name: build test package + run: | + bazel test ` + --features=treat_warnings_as_errors ` + --flaky_test_attempts=3 ` + ... + shell: pwsh + + bazel-windows-arm64: + name: bazel windows arm64 + runs-on: windows-11-arm + timeout-minutes: 30 + steps: + - name: cache winget + uses: actions/cache@v5 + with: + path: | + ~\AppData\Local\Microsoft\WinGet\Links + ~\AppData\Local\Microsoft\WinGet\SourceData + key: >- + ${{ runner.os }}-${{ runner.arch }}-winget-${{ + hashFiles('.github/workflows/*.yml') }} + restore-keys: ${{ runner.os }}-${{ runner.arch }}-winget- + - name: setup + run: | + Install-Module -Force -Name Microsoft.WinGet.Client + Repair-WinGetPackageManager -Force -Latest + winget install -e --accept-package-agreements ` + --accept-source-agreements --id Git.Git + winget install -e -r bazel --accept-package-agreements ` + --accept-source-agreements --id Bazel.Bazelisk + Add-Content $env:GITHUB_PATH ( + [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ` + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")) + shell: pwsh + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: cache bazel + uses: actions/cache@v5 + with: + path: | + ~\_bazel_RUNNERADMIN + ~\AppData\Local\bazelisk + key: >- + ${{ runner.os }}-${{ runner.arch }}-bazel-${{ + hashFiles('.bazelversion', 'MODULE.bazel', + '**/*.bazel', '**/*.bzl') }} + restore-keys: ${{ runner.os }}-${{ runner.arch }}-bazel- + - name: build test package + run: | + bazel test ` + --features=treat_warnings_as_errors ` + --flaky_test_attempts=3 ` + ... + shell: pwsh diff --git a/.github/workflows/buildifier.yml b/.github/workflows/buildifier.yml new file mode 100644 index 00000000..358c267d --- /dev/null +++ b/.github/workflows/buildifier.yml @@ -0,0 +1,90 @@ +# +# buildifier.yml +# RVO2 Library +# +# SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Please send all bug reports to . +# +# The authors may be contacted via: +# +# Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +# Dept. of Computer Science +# 201 S. Columbia St. +# Frederick P. Brooks, Jr. Computer Science Bldg. +# Chapel Hill, N.C. 27599-3175 +# United States of America +# +# +# + +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +--- +name: buildifier + +on: # yamllint disable-line rule:truthy + push: + branches: + - main + pull_request: + branches: + - main + schedule: + - cron: '35 6 * * *' + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + buildifier: + name: debian arm64 + runs-on: ubuntu-24.04-arm + container: debian:trixie-slim + timeout-minutes: 15 + steps: + - name: setup + run: | + apt-get -qq -o APT::Acquire::Retries=4 update \ + || (sleep 15; apt-get -qq -o APT::Acquire::Retries=4 update) + apt-get -qq -o APT::Acquire::Retries=4 -o Dpkg::Use-Pty=0 \ + --no-install-recommends install \ + ca-certificates \ + git \ + wget + apt-get -qq -o Dpkg::Use-Pty=0 autoremove + rm -rf /var/lib/apt/lists/* + wget -qO /usr/local/bin/buildifier \ + https://github.com/bazelbuild/buildtools/releases/latest/download/buildifier-linux-arm64 + chmod +x /usr/local/bin/buildifier + env: + DEBIAN_FRONTEND: noninteractive + shell: bash + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: add problem matcher + run: | + echo ::add-matcher::.github/buildifier-matcher.json + shell: bash + - name: buildifier + run: | + buildifier -r . + shell: bash diff --git a/.github/workflows/check-jsonschema.yml b/.github/workflows/check-jsonschema.yml new file mode 100644 index 00000000..a1dfe144 --- /dev/null +++ b/.github/workflows/check-jsonschema.yml @@ -0,0 +1,89 @@ +# +# check-jsonschema.yml +# RVO2 Library +# +# SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Please send all bug reports to . +# +# The authors may be contacted via: +# +# Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +# Dept. of Computer Science +# 201 S. Columbia St. +# Frederick P. Brooks, Jr. Computer Science Bldg. +# Chapel Hill, N.C. 27599-3175 +# United States of America +# +# +# + +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +--- +name: check-jsonschema + +on: # yamllint disable-line rule:truthy + push: + branches: + - main + pull_request: + branches: + - main + schedule: + - cron: '40 6 * * *' + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + check-jsonschema: + name: debian arm64 + runs-on: ubuntu-24.04-arm + container: debian:trixie-slim + timeout-minutes: 15 + steps: + - name: setup + run: | + apt-get -qq -o APT::Acquire::Retries=4 update \ + || (sleep 15; apt-get -qq -o APT::Acquire::Retries=4 update) + apt-get -qq -o APT::Acquire::Retries=4 -o Dpkg::Use-Pty=0 \ + --no-install-recommends install \ + ca-certificates \ + git \ + pipx + apt-get -qq -o Dpkg::Use-Pty=0 autoremove + rm -rf /var/lib/apt/lists/* + echo "${HOME}/.local/bin" >> "${GITHUB_PATH}" + pipx install check-jsonschema + env: + DEBIAN_FRONTEND: noninteractive + shell: bash + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: check-compose-spec + run: | + check-jsonschema --builtin-schema vendor.compose-spec compose.yaml + shell: bash + - name: check-renovate + run: | + check-jsonschema --builtin-schema vendor.renovate renovate.json + shell: bash diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml new file mode 100644 index 00000000..0fc3c733 --- /dev/null +++ b/.github/workflows/clang-format.yml @@ -0,0 +1,97 @@ +# +# clang-format.yml +# RVO2 Library +# +# SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Please send all bug reports to . +# +# The authors may be contacted via: +# +# Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +# Dept. of Computer Science +# 201 S. Columbia St. +# Frederick P. Brooks, Jr. Computer Science Bldg. +# Chapel Hill, N.C. 27599-3175 +# United States of America +# +# +# + +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +--- +name: clang-format + +on: # yamllint disable-line rule:truthy + push: + branches: + - main + pull_request: + branches: + - main + schedule: + - cron: '45 6 * * *' + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + clang-format: + name: debian arm64 + runs-on: ubuntu-24.04-arm + container: debian:trixie-slim + timeout-minutes: 15 + steps: + - name: setup + run: | + apt-get -qq -o APT::Acquire::Retries=4 update \ + || (sleep 15; apt-get -qq -o APT::Acquire::Retries=4 update) + apt-get -qq -o APT::Acquire::Retries=4 -o Dpkg::Use-Pty=0 \ + --no-install-recommends install \ + ca-certificates \ + clang \ + clang-format \ + git \ + meson \ + ninja-build \ + pkgconf + apt-get -qq -o Dpkg::Use-Pty=0 autoremove + rm -rf /var/lib/apt/lists/* + env: + DEBIAN_FRONTEND: noninteractive + shell: bash + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: setup build + env: + CC: clang + CXX: clang++ + run: | + meson setup \ + -Db_lto=false \ + -Dopenmp=disabled \ + _build + shell: bash + - name: clang-format + run: | + ninja -C _build clang-format-check + shell: bash diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml new file mode 100644 index 00000000..7f26e6df --- /dev/null +++ b/.github/workflows/clang-tidy.yml @@ -0,0 +1,102 @@ +# +# clang-tidy.yml +# RVO2 Library +# +# SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Please send all bug reports to . +# +# The authors may be contacted via: +# +# Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +# Dept. of Computer Science +# 201 S. Columbia St. +# Frederick P. Brooks, Jr. Computer Science Bldg. +# Chapel Hill, N.C. 27599-3175 +# United States of America +# +# +# + +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +--- +name: clang-tidy + +on: # yamllint disable-line rule:truthy + push: + branches: + - main + pull_request: + branches: + - main + schedule: + - cron: '50 6 * * *' + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + clang-tidy: + name: debian arm64 + runs-on: ubuntu-24.04-arm + container: debian:trixie-slim + timeout-minutes: 15 + steps: + - name: setup + run: | + apt-get -qq -o APT::Acquire::Retries=4 update \ + || (sleep 15; apt-get -qq -o APT::Acquire::Retries=4 update) + apt-get -qq -o APT::Acquire::Retries=4 -o Dpkg::Use-Pty=0 \ + --no-install-recommends install \ + ca-certificates \ + clang \ + clang-tidy \ + clang-tools \ + git \ + meson \ + ninja-build \ + pkgconf + apt-get -qq -o Dpkg::Use-Pty=0 autoremove + rm -rf /var/lib/apt/lists/* + env: + DEBIAN_FRONTEND: noninteractive + shell: bash + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: setup build + env: + CC: clang + CXX: clang++ + run: | + meson setup \ + -Db_lto=false \ + -Dopenmp=disabled \ + _build + shell: bash + - name: add problem matcher + run: | + echo ::add-matcher::.github/clang-tidy-matcher.json + shell: bash + - name: clang-tidy + run: | + ninja -C _build clang-tidy + shell: bash diff --git a/.github/workflows/ci.yml b/.github/workflows/cmake.yml similarity index 50% rename from .github/workflows/ci.yml rename to .github/workflows/cmake.yml index a4a18588..2080cf0a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/cmake.yml @@ -1,5 +1,5 @@ # -# ci.yml +# cmake.yml # RVO2 Library # # SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill @@ -31,8 +31,9 @@ # # +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json --- -name: ci +name: cmake on: # yamllint disable-line rule:truthy push: @@ -42,485 +43,21 @@ on: # yamllint disable-line rule:truthy branches: - main schedule: - - cron: '0 5 * * *' + - cron: '10 6 * * *' -jobs: - bazel-almalinux: - name: bazel almalinux amd64 - runs-on: ubuntu-latest - container: almalinux:10 - timeout-minutes: 30 - steps: - - name: setup - run: | - dnf makecache -q --refresh || (sleep 15; dnf makecache -q --refresh) - dnf install -q -y \ - ca-certificates \ - git \ - glibc-devel \ - wget \ - which - dnf clean all - rm -rf /var/cache/yum - wget -qO /usr/local/bin/bazelisk \ - https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 - chmod +x /usr/local/bin/bazelisk - ln -s /usr/local/bin/bazelisk /usr/local/bin/bazel - shell: bash - - name: checkout - uses: actions/checkout@v6 - - name: cache - uses: actions/cache@v5 - with: - path: | - ~/.cache/bazel - ~/.cache/bazelisk - key: | - ${{ runner.os }}-${{ runner.arch }}-bazel-${{ hashFiles('.bazelversion', 'MODULE.bazel', '**/*.bazel', '**/*.bzl') }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-bazel- - - name: build test package - run: | - bazel test \ - --features=treat_warnings_as_errors \ - --flaky_test_attempts=3 \ - ... - shell: bash - - bazel-alpine: - name: bazel alpine linux amd64 - runs-on: ubuntu-latest - container: alpine:3 - timeout-minutes: 30 - steps: - - name: setup - run: | - echo "https://dl-cdn.alpinelinux.org/alpine/edge/testing" \ - >> /etc/apk/repositories - apk add --no-cache \ - bazel8 \ - ca-certificates \ - git - shell: sh - - name: checkout - uses: actions/checkout@v6 - - name: cache - uses: actions/cache@v5 - with: - path: ~/.cache/bazel - key: | - ${{ runner.os }}-${{ runner.arch }}-bazel-${{ hashFiles('MODULE.bazel', '**/*.bazel', '**/*.bzl') }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-bazel- - - name: build test package - run: | - bazel test \ - --config=alpine \ - --features=treat_warnings_as_errors \ - --flaky_test_attempts=3 \ - ... - shell: sh - - bazel-arch: - name: bazel arch linux amd64 - runs-on: ubuntu-latest - container: archlinux:latest - timeout-minutes: 30 - steps: - - name: setup - run: | - pacman --needed --noconfirm --noprogressbar -Sy \ - ca-certificates \ - git \ - wget \ - which - rm -rf \ - /var/cache/pacman/pkg/* \ - /var/lib/pacman/sync/* - wget -qO /usr/local/bin/bazelisk \ - https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 - chmod +x /usr/local/bin/bazelisk - ln -s /usr/local/bin/bazelisk /usr/local/bin/bazel - shell: bash - - name: checkout - uses: actions/checkout@v6 - - name: cache - uses: actions/cache@v5 - with: - path: | - ~/.cache/bazel - ~/.cache/bazelisk - key: | - ${{ runner.os }}-${{ runner.arch }}-bazel-${{ hashFiles('.bazelversion', 'MODULE.bazel', '**/*.bazel', '**/*.bzl') }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-bazel- - - name: build test package - run: | - bazel test \ - --features=treat_warnings_as_errors \ - --flaky_test_attempts=3 \ - ... - shell: bash - - bazel-fedora: - name: bazel fedora linux amd64 - runs-on: ubuntu-latest - container: fedora:44 - timeout-minutes: 30 - steps: - - name: setup - run: | - dnf makecache -q --refresh || (sleep 15; dnf makecache -q --refresh) - dnf install -q -y \ - ca-certificates \ - git \ - glibc-devel \ - wget \ - which - dnf clean all - rm -rf /var/cache/yum - wget -qO /usr/local/bin/bazelisk \ - https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 - chmod +x /usr/local/bin/bazelisk - ln -s /usr/local/bin/bazelisk /usr/local/bin/bazel - shell: bash - - name: checkout - uses: actions/checkout@v6 - - name: cache - uses: actions/cache@v5 - with: - path: | - ~/.cache/bazel - ~/.cache/bazelisk - key: | - ${{ runner.os }}-${{ runner.arch }}-bazel-${{ hashFiles('.bazelversion', 'MODULE.bazel', '**/*.bazel', '**/*.bzl') }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-bazel- - - name: build test package - run: | - bazel test \ - --features=treat_warnings_as_errors \ - --flaky_test_attempts=3 \ - ... - shell: bash - - bazel-macos: - name: bazel macos arm64 - runs-on: macos-26 - timeout-minutes: 30 - steps: - - name: checkout - uses: actions/checkout@v6 - - name: cache homebrew - uses: actions/cache@v5 - with: - path: ~/Library/Caches/Homebrew/downloads - key: | - ${{ runner.os }}-${{ runner.arch }}-brew-${{ hashFiles('Brewfile') }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-brew- - - name: setup - run: | - brew update -q || (sleep 15; brew update -q) - brew bundle install -q - brew cleanup -q -s - env: - HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} - HOMEBREW_NO_ANALYTICS: 1 - HOMEBREW_NO_AUTO_UPDATE: 1 - HOMEBREW_NO_INSTALL_CLEANUP: 1 - shell: zsh -efuo pipefail {0} - - name: cache bazel - uses: actions/cache@v5 - with: - path: | - ~/.cache/bazel - ~/Library/Caches/bazelisk - key: | - ${{ runner.os }}-${{ runner.arch }}-bazel-${{ hashFiles('.bazelversion', 'MODULE.bazel', '**/*.bazel', '**/*.bzl') }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-bazel- - - name: build test package - run: | - bazel test \ - --features=treat_warnings_as_errors \ - --flaky_test_attempts=3 \ - ... - shell: zsh -efuo pipefail {0} - - bazel-macos-x86_64: - name: bazel macos x86_64 - runs-on: macos-26-intel - timeout-minutes: 30 - steps: - - name: checkout - uses: actions/checkout@v6 - - name: cache homebrew - uses: actions/cache@v5 - with: - path: ~/Library/Caches/Homebrew/downloads - key: | - ${{ runner.os }}-${{ runner.arch }}-brew-${{ hashFiles('Brewfile') }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-brew- - - name: setup - run: | - brew update -q || (sleep 15; brew update -q) - brew bundle install -q - brew cleanup -q -s - env: - HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} - HOMEBREW_NO_ANALYTICS: 1 - HOMEBREW_NO_AUTO_UPDATE: 1 - HOMEBREW_NO_INSTALL_CLEANUP: 1 - shell: zsh -efuo pipefail {0} - - name: cache bazel - uses: actions/cache@v5 - with: - path: | - ~/.cache/bazel - ~/Library/Caches/bazelisk - key: | - ${{ runner.os }}-${{ runner.arch }}-bazel-${{ hashFiles('.bazelversion', 'MODULE.bazel', '**/*.bazel', '**/*.bzl') }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-bazel- - - name: build test package - run: | - bazel test \ - --features=treat_warnings_as_errors \ - --flaky_test_attempts=3 \ - ... - shell: zsh -efuo pipefail {0} - - bazel-opensuse: - name: bazel opensuse leap amd64 - runs-on: ubuntu-latest - container: opensuse/leap:16.0 - timeout-minutes: 30 - steps: - - name: setup - run: | - zypper -n -q ref || (sleep 15; zypper -n -q ref) - zypper -n -q in --no-recommends \ - ca-certificates \ - git \ - glibc-devel \ - wget \ - which - zypper -n -q cc -a - wget -qO /usr/local/bin/bazelisk \ - https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 - chmod +x /usr/local/bin/bazelisk - ln -s /usr/local/bin/bazelisk /usr/local/bin/bazel - shell: bash - - name: checkout - uses: actions/checkout@v6 - - name: cache - uses: actions/cache@v5 - with: - path: | - ~/.cache/bazel - ~/.cache/bazelisk - key: | - ${{ runner.os }}-${{ runner.arch }}-bazel-${{ hashFiles('.bazelversion', 'MODULE.bazel', '**/*.bazel', '**/*.bzl') }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-bazel- - - name: build test package - run: | - bazel test \ - --features=treat_warnings_as_errors \ - --flaky_test_attempts=3 \ - ... - shell: bash +permissions: + contents: read - bazel-ubuntu: - name: bazel ubuntu amd64 - runs-on: ubuntu-latest - container: ubuntu:26.04 - timeout-minutes: 30 - steps: - - name: setup - run: | - apt-get -qq -o APT::Acquire::Retries=4 update \ - || (sleep 15; apt-get -qq -o APT::Acquire::Retries=4 update) - apt-get -qq -o APT::Acquire::Retries=4 -o Dpkg::Use-Pty=0 \ - upgrade - apt-get -qq -o APT::Acquire::Retries=4 -o Dpkg::Use-Pty=0 \ - --no-install-recommends install \ - ca-certificates \ - g++ \ - git \ - wget - apt-get -qq -o Dpkg::Use-Pty=0 autoremove - rm -rf /var/lib/apt/lists/* - wget -q https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-amd64.deb - dpkg -i bazelisk-amd64.deb - rm -rf bazelisk-amd64.deb - env: - DEBIAN_FRONTEND: noninteractive - shell: bash - - name: checkout - uses: actions/checkout@v6 - - name: cache - uses: actions/cache@v5 - with: - path: | - ~/.cache/bazel - ~/.cache/bazelisk - key: | - ${{ runner.os }}-${{ runner.arch }}-bazel-${{ hashFiles('.bazelversion', 'MODULE.bazel', '**/*.bazel', '**/*.bzl') }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-bazel- - - name: build test package - run: | - bazel test \ - --features=treat_warnings_as_errors \ - --flaky_test_attempts=3 \ - ... - shell: bash - - bazel-ubuntu-arm64: - name: bazel ubuntu arm64 - runs-on: ubuntu-24.04-arm - container: ubuntu:26.04 - timeout-minutes: 30 - steps: - - name: setup - run: | - apt-get -qq -o APT::Acquire::Retries=4 update \ - || (sleep 15; apt-get -qq -o APT::Acquire::Retries=4 update) - apt-get -qq -o APT::Acquire::Retries=4 -o Dpkg::Use-Pty=0 \ - upgrade - apt-get -qq -o APT::Acquire::Retries=4 -o Dpkg::Use-Pty=0 \ - --no-install-recommends install \ - ca-certificates \ - g++ \ - git \ - wget - apt-get -qq -o Dpkg::Use-Pty=0 autoremove - rm -rf /var/lib/apt/lists/* - wget -q https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-arm64.deb - dpkg -i bazelisk-arm64.deb - rm -rf bazelisk-arm64.deb - env: - DEBIAN_FRONTEND: noninteractive - shell: bash - - name: checkout - uses: actions/checkout@v6 - - name: cache - uses: actions/cache@v5 - with: - path: | - ~/.cache/bazel - ~/.cache/bazelisk - key: | - ${{ runner.os }}-${{ runner.arch }}-bazel-${{ hashFiles('.bazelversion', 'MODULE.bazel', '**/*.bazel', '**/*.bzl') }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-bazel- - - name: build test package - run: | - bazel test \ - --features=treat_warnings_as_errors \ - --flaky_test_attempts=3 \ - ... - shell: bash - - bazel-windows: - name: bazel windows x64 - runs-on: windows-latest - timeout-minutes: 30 - steps: - - name: cache winget - uses: actions/cache@v5 - with: - path: | - ~\AppData\Local\Microsoft\WinGet\Links - ~\AppData\Local\Microsoft\WinGet\SourceData - key: | - ${{ runner.os }}-${{ runner.arch }}-winget-${{ hashFiles('.github/workflows/*.yml') }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-winget- - - name: setup - run: | - winget install -e --accept-package-agreements --accept-source-agreements ` - --id Git.Git - winget install -e -r bazel --accept-package-agreements ` - --accept-source-agreements --id Bazel.Bazelisk - Add-Content $env:GITHUB_PATH ( - [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + ` - [System.Environment]::GetEnvironmentVariable("Path", "User")) - shell: pwsh - - name: checkout - uses: actions/checkout@v6 - - name: cache bazel - uses: actions/cache@v5 - with: - path: | - ~\_bazel_RUNNERADMIN - ~\AppData\Local\bazelisk - key: | - ${{ runner.os }}-${{ runner.arch }}-bazel-${{ hashFiles('.bazelversion', 'MODULE.bazel', '**/*.bazel', '**/*.bzl') }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-bazel- - - name: build test package - run: | - bazel test ` - --features=treat_warnings_as_errors ` - --flaky_test_attempts=3 ` - ... - shell: pwsh - - bazel-windows-arm64: - name: bazel windows arm64 - runs-on: windows-11-arm - timeout-minutes: 30 - steps: - - name: cache winget - uses: actions/cache@v5 - with: - path: | - ~\AppData\Local\Microsoft\WinGet\Links - ~\AppData\Local\Microsoft\WinGet\SourceData - key: | - ${{ runner.os }}-${{ runner.arch }}-winget-${{ hashFiles('.github/workflows/*.yml') }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-winget- - - name: setup - run: | - Install-Module -Force -Name Microsoft.WinGet.Client - Repair-WinGetPackageManager -Force -Latest - winget install -e --accept-package-agreements --accept-source-agreements ` - --id Git.Git - winget install -e -r bazel --accept-package-agreements ` - --accept-source-agreements --id Bazel.Bazelisk - Add-Content $env:GITHUB_PATH ( - [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + ` - [System.Environment]::GetEnvironmentVariable("Path", "User")) - shell: pwsh - - name: checkout - uses: actions/checkout@v6 - - name: cache bazel - uses: actions/cache@v5 - with: - path: | - ~\_bazel_RUNNERADMIN - ~\AppData\Local\bazelisk - key: | - ${{ runner.os }}-${{ runner.arch }}-bazel-${{ hashFiles('.bazelversion', 'MODULE.bazel', '**/*.bazel', '**/*.bzl') }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-bazel- - - name: build test package - run: | - bazel test ` - --features=treat_warnings_as_errors ` - --flaky_test_attempts=3 ` - ... - shell: pwsh +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: cmake-almalinux: - name: cmake almalinux amd64 + name: almalinux amd64 runs-on: ubuntu-latest container: almalinux:10 + timeout-minutes: 30 steps: - name: setup run: | @@ -543,6 +80,8 @@ jobs: shell: bash - name: checkout uses: actions/checkout@v6 + with: + persist-credentials: false - name: build test package run: | mkdir _build @@ -567,9 +106,10 @@ jobs: shell: bash cmake-alpine: - name: cmake alpine linux amd64 + name: alpine linux amd64 runs-on: ubuntu-latest container: alpine:3 + timeout-minutes: 30 steps: - name: setup run: | @@ -585,6 +125,8 @@ jobs: shell: sh - name: checkout uses: actions/checkout@v6 + with: + persist-credentials: false - name: build test package run: | mkdir _build @@ -609,9 +151,10 @@ jobs: shell: sh cmake-arch: - name: cmake arch linux amd64 + name: arch linux amd64 runs-on: ubuntu-latest container: archlinux:latest + timeout-minutes: 30 steps: - name: setup run: | @@ -630,6 +173,8 @@ jobs: shell: bash - name: checkout uses: actions/checkout@v6 + with: + persist-credentials: false - name: build test package run: | mkdir _build @@ -654,9 +199,10 @@ jobs: shell: bash cmake-fedora: - name: cmake fedora linux amd64 + name: fedora linux amd64 runs-on: ubuntu-latest container: fedora:44 + timeout-minutes: 30 steps: - name: setup run: | @@ -677,6 +223,8 @@ jobs: shell: bash - name: checkout uses: actions/checkout@v6 + with: + persist-credentials: false - name: build test package run: | mkdir _build @@ -703,17 +251,20 @@ jobs: cmake-macos: name: cmake macos arm64 runs-on: macos-26 + timeout-minutes: 30 steps: - name: checkout uses: actions/checkout@v6 - - name: cache + with: + persist-credentials: false + - name: cache homebrew uses: actions/cache@v5 with: path: ~/Library/Caches/Homebrew/downloads - key: | - ${{ runner.os }}-${{ runner.arch }}-brew-${{ hashFiles('Brewfile') }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-brew- + key: >- + ${{ runner.os }}-${{ runner.arch }}-brew-${{ + hashFiles('Brewfile') }} + restore-keys: ${{ runner.os }}-${{ runner.arch }}-brew- - name: setup run: | brew update -q || (sleep 15; brew update -q) @@ -754,14 +305,16 @@ jobs: steps: - name: checkout uses: actions/checkout@v6 + with: + persist-credentials: false - name: cache uses: actions/cache@v5 with: path: ~/Library/Caches/Homebrew/downloads - key: | - ${{ runner.os }}-${{ runner.arch }}-brew-${{ hashFiles('Brewfile') }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-brew- + key: >- + ${{ runner.os }}-${{ runner.arch }}-brew-${{ + hashFiles('Brewfile') }} + restore-keys: ${{ runner.os }}-${{ runner.arch }}-brew- - name: setup run: | brew update -q || (sleep 15; brew update -q) @@ -797,9 +350,10 @@ jobs: shell: zsh -efuo pipefail {0} cmake-opensuse: - name: cmake opensuse leap amd64 + name: opensuse leap amd64 runs-on: ubuntu-latest container: opensuse/leap:16.0 + timeout-minutes: 30 steps: - name: setup run: | @@ -818,6 +372,8 @@ jobs: shell: bash - name: checkout uses: actions/checkout@v6 + with: + persist-credentials: false - name: build test package run: | mkdir _build @@ -842,9 +398,10 @@ jobs: shell: bash cmake-ubuntu: - name: cmake ubuntu amd64 + name: ubuntu amd64 runs-on: ubuntu-latest container: ubuntu:26.04 + timeout-minutes: 30 steps: - name: setup run: | @@ -869,6 +426,8 @@ jobs: shell: bash - name: checkout uses: actions/checkout@v6 + with: + persist-credentials: false - name: build test package run: | mkdir _build @@ -893,9 +452,10 @@ jobs: shell: bash cmake-ubuntu-arm64: - name: cmake ubuntu arm64 + name: ubuntu arm64 runs-on: ubuntu-24.04-arm container: ubuntu:26.04 + timeout-minutes: 30 steps: - name: setup run: | @@ -920,6 +480,8 @@ jobs: shell: bash - name: checkout uses: actions/checkout@v6 + with: + persist-credentials: false - name: build test package run: | mkdir _build @@ -946,6 +508,7 @@ jobs: cmake-windows: name: cmake windows x64 runs-on: windows-latest + timeout-minutes: 30 steps: - name: cache uses: actions/cache@v5 @@ -953,22 +516,24 @@ jobs: path: | ~\AppData\Local\Microsoft\WinGet\Links ~\AppData\Local\Microsoft\WinGet\SourceData - key: | - ${{ runner.os }}-${{ runner.arch }}-winget-${{ hashFiles('.github/workflows/*.yml') }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-winget- + key: >- + ${{ runner.os }}-${{ runner.arch }}-winget-${{ + hashFiles('.github/workflows/*.yml') }} + restore-keys: ${{ runner.os }}-${{ runner.arch }}-winget- - name: setup run: | - winget install -e --accept-package-agreements --accept-source-agreements ` - --id Git.Git - winget install -e --accept-package-agreements --accept-source-agreements ` - --id Kitware.CMake + winget install -e --accept-package-agreements ` + --accept-source-agreements --id Git.Git + winget install -e --accept-package-agreements ` + --accept-source-agreements --id Kitware.CMake Add-Content $env:GITHUB_PATH ( - [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + ` - [System.Environment]::GetEnvironmentVariable("Path", "User")) + [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ` + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")) shell: pwsh - name: checkout uses: actions/checkout@v6 + with: + persist-credentials: false - name: build test package run: | mkdir _build @@ -1002,24 +567,26 @@ jobs: path: | ~\AppData\Local\Microsoft\WinGet\Links ~\AppData\Local\Microsoft\WinGet\SourceData - key: | - ${{ runner.os }}-${{ runner.arch }}-winget-${{ hashFiles('.github/workflows/*.yml') }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-winget- + key: >- + ${{ runner.os }}-${{ runner.arch }}-winget-${{ + hashFiles('.github/workflows/*.yml') }} + restore-keys: ${{ runner.os }}-${{ runner.arch }}-winget- - name: setup run: | Install-Module -Force -Name Microsoft.WinGet.Client Repair-WinGetPackageManager -Force -Latest - winget install -e --accept-package-agreements --accept-source-agreements ` - --id Git.Git - winget install -e --accept-package-agreements --accept-source-agreements ` - --id Kitware.CMake + winget install -e --accept-package-agreements ` + --accept-source-agreements --id Git.Git + winget install -e --accept-package-agreements ` + --accept-source-agreements --id Kitware.CMake Add-Content $env:GITHUB_PATH ( - [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + ` - [System.Environment]::GetEnvironmentVariable("Path", "User")) + [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ` + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")) shell: pwsh - name: checkout uses: actions/checkout@v6 + with: + persist-credentials: false - name: build test package run: | mkdir _build diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 707ea3a7..95e60ee5 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -31,6 +31,7 @@ # # +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json --- name: codeql @@ -42,18 +43,31 @@ on: # yamllint disable-line rule:truthy branches: - main schedule: - - cron: '0 6 * * 3' + - cron: '20 4 * * 3' + +permissions: + actions: read + contents: read + security-events: write + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: analyze: name: analyze runs-on: ubuntu-latest + timeout-minutes: 60 steps: - name: checkout uses: actions/checkout@v6 + with: + persist-credentials: false - name: initialize codeql uses: github/codeql-action/init@v4 with: + build-mode: none languages: cpp - name: autobuild uses: github/codeql-action/autobuild@v4 diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 00000000..6d9c4a15 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,87 @@ +# +# codespell.yml +# RVO2 Library +# +# SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Please send all bug reports to . +# +# The authors may be contacted via: +# +# Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +# Dept. of Computer Science +# 201 S. Columbia St. +# Frederick P. Brooks, Jr. Computer Science Bldg. +# Chapel Hill, N.C. 27599-3175 +# United States of America +# +# +# + +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +--- +name: codespell + +on: # yamllint disable-line rule:truthy + push: + branches: + - main + pull_request: + branches: + - main + schedule: + - cron: '55 6 * * *' + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + codespell: + name: debian arm64 + runs-on: ubuntu-24.04-arm + container: debian:trixie-slim + timeout-minutes: 15 + steps: + - name: setup + run: | + apt-get -qq -o APT::Acquire::Retries=4 update \ + || (sleep 15; apt-get -qq -o APT::Acquire::Retries=4 update) + apt-get -qq -o APT::Acquire::Retries=4 -o Dpkg::Use-Pty=0 \ + --no-install-recommends install \ + ca-certificates \ + codespell \ + git + apt-get -qq -o Dpkg::Use-Pty=0 autoremove + rm -rf /var/lib/apt/lists/* + env: + DEBIAN_FRONTEND: noninteractive + shell: bash + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: add problem matcher + run: | + echo ::add-matcher::.github/codespell-matcher.json + shell: bash + - name: codespell + run: | + codespell + shell: bash diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 00000000..bb804394 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,204 @@ +# +# coverage.yml +# RVO2 Library +# +# SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Please send all bug reports to . +# +# The authors may be contacted via: +# +# Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +# Dept. of Computer Science +# 201 S. Columbia St. +# Frederick P. Brooks, Jr. Computer Science Bldg. +# Chapel Hill, N.C. 27599-3175 +# United States of America +# +# +# + +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +--- +name: coverage + +on: # yamllint disable-line rule:truthy + push: + branches: + - main + pull_request: + branches: + - main + schedule: + - cron: '0 5 * * *' + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + coverage: + name: debian ${{ matrix.arch }} + runs-on: ${{ matrix.runner }} + container: debian:trixie-slim + timeout-minutes: 60 + strategy: + matrix: + include: + - arch: amd64 + runner: ubuntu-latest + - arch: arm64 + runner: ubuntu-24.04-arm + steps: + - name: setup + run: | + apt-get -qq -o APT::Acquire::Retries=4 update \ + || (sleep 15; apt-get -qq -o APT::Acquire::Retries=4 update) + apt-get -qq -o APT::Acquire::Retries=4 -o Dpkg::Use-Pty=0 \ + --no-install-recommends install \ + ca-certificates \ + g++ \ + gcovr \ + git \ + meson \ + ninja-build \ + pkgconf \ + python3 + apt-get -qq -o Dpkg::Use-Pty=0 autoremove + rm -rf /var/lib/apt/lists/* + env: + DEBIAN_FRONTEND: noninteractive + shell: bash + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: setup build + run: | + meson setup \ + -Db_coverage=true \ + -Db_lto=false \ + -Dbuildtype=debug \ + -Dopenmp=disabled \ + -Dwerror=true \ + _build + shell: bash + - name: build + run: | + ninja -C _build + shell: bash + - name: test + run: | + meson test -C _build --print-errorlogs + shell: bash + - name: coverage-xml + run: | + ninja -C _build coverage-xml + shell: bash + - name: summary + run: | + python3 - <<'EOF' >> "$GITHUB_STEP_SUMMARY" + import xml.etree.ElementTree as ET + root = ET.parse('_build/meson-logs/coverage.xml').getroot() + lr = float(root.get('line-rate', 0)) + lc = int(root.get('lines-covered', 0)) + lv = int(root.get('lines-valid', 0)) + br = float(root.get('branch-rate', 0)) + bc = int(root.get('branches-covered', 0)) + bv = int(root.get('branches-valid', 0)) + print('## Coverage') + print() + print('| Metric | Covered | Total | Rate |') + print('|--------|---------|-------|------|') + print(f'| Lines | {lc} | {lv} | {lr:.1%} |') + if bv > 0: + print(f'| Branches | {bc} | {bv} | {br:.1%} |') + EOF + shell: bash + - name: upload + if: always() + uses: actions/upload-artifact@v7 + with: + name: coverage-xml-${{ matrix.arch }} + path: _build/meson-logs/coverage.xml + retention-days: 1 + if-no-files-found: ignore + + merge: + name: merge + needs: coverage + runs-on: ubuntu-24.04-arm + container: debian:trixie-slim + timeout-minutes: 15 + steps: + - name: setup + run: | + apt-get -qq -o APT::Acquire::Retries=4 update \ + || (sleep 15; apt-get -qq -o APT::Acquire::Retries=4 update) + apt-get -qq -o APT::Acquire::Retries=4 -o Dpkg::Use-Pty=0 \ + --no-install-recommends install gcovr + apt-get -qq -o Dpkg::Use-Pty=0 autoremove + rm -rf /var/lib/apt/lists/* + env: + DEBIAN_FRONTEND: noninteractive + shell: bash + - name: download amd64 + uses: actions/download-artifact@v8 + continue-on-error: true + with: + name: coverage-xml-amd64 + path: coverage-xml-amd64 + - name: download arm64 + uses: actions/download-artifact@v8 + continue-on-error: true + with: + name: coverage-xml-arm64 + path: coverage-xml-arm64 + - name: merge + run: | + GCOVR_ARGS=() + if [ -s coverage-xml-amd64/coverage.xml ]; then + GCOVR_ARGS+=(--cobertura-add-tracefile coverage-xml-amd64/coverage.xml) + fi + if [ -s coverage-xml-arm64/coverage.xml ]; then + GCOVR_ARGS+=(--cobertura-add-tracefile coverage-xml-arm64/coverage.xml) + fi + if [ ${#GCOVR_ARGS[@]} -gt 0 ]; then + gcovr "${GCOVR_ARGS[@]}" --xml coverage.xml + else + echo 'coverage.xml files could not be found' >&2 + exit 1 + fi + shell: bash + - name: upload + uses: actions/upload-artifact@v7 + with: + name: coverage-xml + path: coverage.xml + retention-days: 7 + if-no-files-found: ignore + - name: publish to deepsource + if: >- + github.event_name == 'push' || + github.event.pull_request.head.repo.full_name == github.repository + uses: deepsourcelabs/test-coverage-action@master + with: + key: cxx + coverage-file: coverage.xml + dsn: ${{ secrets.DEEPSOURCE_DSN }} diff --git a/.github/workflows/cppcheck.yml b/.github/workflows/cppcheck.yml new file mode 100644 index 00000000..620d7482 --- /dev/null +++ b/.github/workflows/cppcheck.yml @@ -0,0 +1,125 @@ +# +# cppcheck.yml +# RVO2 Library +# +# SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Please send all bug reports to . +# +# The authors may be contacted via: +# +# Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +# Dept. of Computer Science +# 201 S. Columbia St. +# Frederick P. Brooks, Jr. Computer Science Bldg. +# Chapel Hill, N.C. 27599-3175 +# United States of America +# +# +# + +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +--- +name: cppcheck + +on: # yamllint disable-line rule:truthy + push: + branches: + - main + pull_request: + branches: + - main + schedule: + - cron: '0 7 * * *' + +permissions: + contents: read + security-events: write + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + cppcheck: + name: debian arm64 + runs-on: ubuntu-24.04-arm + container: debian:trixie-slim + timeout-minutes: 15 + steps: + - name: setup + run: | + apt-get -qq -o APT::Acquire::Retries=4 update \ + || (sleep 15; apt-get -qq -o APT::Acquire::Retries=4 update) + apt-get -qq -o APT::Acquire::Retries=4 -o Dpkg::Use-Pty=0 \ + --no-install-recommends install \ + ca-certificates \ + cppcheck \ + g++ \ + git \ + jq \ + meson \ + ninja-build \ + pkgconf + apt-get -qq -o Dpkg::Use-Pty=0 autoremove + rm -rf /var/lib/apt/lists/* + env: + DEBIAN_FRONTEND: noninteractive + shell: bash + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: setup build + run: | + meson setup \ + -Db_lto=false \ + -Dopenmp=disabled \ + _build + shell: bash + - name: cppcheck + run: | + cppcheck \ + -q \ + --check-level=exhaustive \ + --cppcheck-build-dir=_build \ + --enable=all \ + --inline-suppr \ + --library=std \ + --max-ctu-depth=10 \ + --output-file=/dev/stdout \ + --output-format=sarif \ + --platform=unix64 \ + --project=_build/compile_commands.json \ + --safety \ + --suppress-xml=.cppcheck-suppressions.xml | \ + jq '.["$schema"] = "https://schemastore.org" | .runs[].artifacts = []' \ + > /tmp/cppcheck-results.sarif + jq -e '[.runs[].results[]] | length == 0' /tmp/cppcheck-results.sarif + shell: bash + - name: upload sarif + if: always() + uses: github/codeql-action/upload-sarif@v4 + with: + sarif_file: /tmp/cppcheck-results.sarif + category: cppcheck + - name: upload + uses: actions/upload-artifact@v7 + with: + name: cppcheck-results + path: /tmp/cppcheck-results.sarif + retention-days: 7 + if-no-files-found: ignore diff --git a/.github/workflows/cpplint.yml b/.github/workflows/cpplint.yml new file mode 100644 index 00000000..3f688786 --- /dev/null +++ b/.github/workflows/cpplint.yml @@ -0,0 +1,87 @@ +# +# cpplint.yml +# RVO2 Library +# +# SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Please send all bug reports to . +# +# The authors may be contacted via: +# +# Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +# Dept. of Computer Science +# 201 S. Columbia St. +# Frederick P. Brooks, Jr. Computer Science Bldg. +# Chapel Hill, N.C. 27599-3175 +# United States of America +# +# +# + +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +--- +name: cpplint + +on: # yamllint disable-line rule:truthy + push: + branches: + - main + pull_request: + branches: + - main + schedule: + - cron: '5 7 * * *' + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + cpplint: + name: debian arm64 + runs-on: ubuntu-24.04-arm + container: debian:trixie-slim + timeout-minutes: 15 + steps: + - name: setup + run: | + apt-get -qq -o APT::Acquire::Retries=4 update \ + || (sleep 15; apt-get -qq -o APT::Acquire::Retries=4 update) + apt-get -qq -o APT::Acquire::Retries=4 -o Dpkg::Use-Pty=0 \ + --no-install-recommends install \ + ca-certificates \ + cpplint \ + git + apt-get -qq -o Dpkg::Use-Pty=0 autoremove + rm -rf /var/lib/apt/lists/* + env: + DEBIAN_FRONTEND: noninteractive + shell: bash + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: add problem matcher + run: | + echo ::add-matcher::.github/cpplint-matcher.json + shell: bash + - name: cpplint + run: | + cpplint --recursive examples/ src/ + shell: bash diff --git a/.github/workflows/detect-secrets.yml b/.github/workflows/detect-secrets.yml new file mode 100644 index 00000000..b266a886 --- /dev/null +++ b/.github/workflows/detect-secrets.yml @@ -0,0 +1,90 @@ +# +# detect-secrets.yml +# RVO2 Library +# +# SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Please send all bug reports to . +# +# The authors may be contacted via: +# +# Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +# Dept. of Computer Science +# 201 S. Columbia St. +# Frederick P. Brooks, Jr. Computer Science Bldg. +# Chapel Hill, N.C. 27599-3175 +# United States of America +# +# +# + +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +--- +name: detect-secrets + +on: # yamllint disable-line rule:truthy + push: + branches: + - main + pull_request: + branches: + - main + schedule: + - cron: '10 7 * * *' + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + detect-secrets: + name: debian arm64 + runs-on: ubuntu-24.04-arm + container: debian:trixie-slim + timeout-minutes: 15 + steps: + - name: setup + run: | + apt-get -qq -o APT::Acquire::Retries=4 update \ + || (sleep 15; apt-get -qq -o APT::Acquire::Retries=4 update) + apt-get -qq -o APT::Acquire::Retries=4 -o Dpkg::Use-Pty=0 \ + --no-install-recommends install \ + ca-certificates \ + git \ + pipx + apt-get -qq -o Dpkg::Use-Pty=0 autoremove + rm -rf /var/lib/apt/lists/* + echo "${HOME}/.local/bin" >> "${GITHUB_PATH}" + pipx install detect-secrets + env: + DEBIAN_FRONTEND: noninteractive + shell: bash + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: add problem matcher + run: | + echo ::add-matcher::.github/detect-secrets-matcher.json + shell: bash + - name: detect-secrets + run: | + readarray -t files < <(git ls-files) + detect-secrets-hook --baseline .secrets.baseline "${files[@]}" + shell: bash diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 00000000..6030f06c --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,81 @@ +# +# docker.yml +# RVO2 Library +# +# SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Please send all bug reports to . +# +# The authors may be contacted via: +# +# Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +# Dept. of Computer Science +# 201 S. Columbia St. +# Frederick P. Brooks, Jr. Computer Science Bldg. +# Chapel Hill, N.C. 27599-3175 +# United States of America +# +# +# + +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +--- +name: docker + +on: # yamllint disable-line rule:truthy + push: + branches: + - main + pull_request: + branches: + - main + schedule: + - cron: '40 4 * * 3' + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + docker: + name: docker ${{ matrix.arch }} + runs-on: ${{ matrix.runner }} + timeout-minutes: 60 + strategy: + matrix: + include: + - arch: amd64 + runner: ubuntu-latest + - arch: arm64 + runner: ubuntu-24.04-arm + steps: + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: setup buildx + uses: docker/setup-buildx-action@v3 + - name: build + uses: docker/build-push-action@v6 + with: + context: . + platforms: linux/${{ matrix.arch }} + push: false + cache-from: type=gha,scope=${{ matrix.arch }} + cache-to: type=gha,mode=max,scope=${{ matrix.arch }} diff --git a/.github/workflows/gersemi.yml b/.github/workflows/gersemi.yml new file mode 100644 index 00000000..1f09ad94 --- /dev/null +++ b/.github/workflows/gersemi.yml @@ -0,0 +1,85 @@ +# +# gersemi.yml +# RVO2 Library +# +# SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Please send all bug reports to . +# +# The authors may be contacted via: +# +# Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +# Dept. of Computer Science +# 201 S. Columbia St. +# Frederick P. Brooks, Jr. Computer Science Bldg. +# Chapel Hill, N.C. 27599-3175 +# United States of America +# +# +# + +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +--- +name: gersemi + +on: # yamllint disable-line rule:truthy + push: + branches: + - main + pull_request: + branches: + - main + schedule: + - cron: '15 7 * * *' + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + gersemi: + name: debian arm64 + runs-on: ubuntu-24.04-arm + container: debian:trixie-slim + timeout-minutes: 15 + steps: + - name: setup + run: | + apt-get -qq -o APT::Acquire::Retries=4 update \ + || (sleep 15; apt-get -qq -o APT::Acquire::Retries=4 update) + apt-get -qq -o APT::Acquire::Retries=4 -o Dpkg::Use-Pty=0 \ + --no-install-recommends install \ + ca-certificates \ + git \ + pipx + apt-get -qq -o Dpkg::Use-Pty=0 autoremove + rm -rf /var/lib/apt/lists/* + echo "${HOME}/.local/bin" >> "${GITHUB_PATH}" + pipx install gersemi + env: + DEBIAN_FRONTEND: noninteractive + shell: bash + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: gersemi + run: | + gersemi --check . + shell: bash diff --git a/.github/workflows/hadolint.yml b/.github/workflows/hadolint.yml new file mode 100644 index 00000000..9c1aea13 --- /dev/null +++ b/.github/workflows/hadolint.yml @@ -0,0 +1,90 @@ +# +# hadolint.yml +# RVO2 Library +# +# SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Please send all bug reports to . +# +# The authors may be contacted via: +# +# Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +# Dept. of Computer Science +# 201 S. Columbia St. +# Frederick P. Brooks, Jr. Computer Science Bldg. +# Chapel Hill, N.C. 27599-3175 +# United States of America +# +# +# + +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +--- +name: hadolint + +on: # yamllint disable-line rule:truthy + push: + branches: + - main + pull_request: + branches: + - main + schedule: + - cron: '20 7 * * *' + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + hadolint: + name: debian arm64 + runs-on: ubuntu-24.04-arm + container: debian:trixie-slim + timeout-minutes: 15 + steps: + - name: setup + run: | + apt-get -qq -o APT::Acquire::Retries=4 update \ + || (sleep 15; apt-get -qq -o APT::Acquire::Retries=4 update) + apt-get -qq -o APT::Acquire::Retries=4 -o Dpkg::Use-Pty=0 \ + --no-install-recommends install \ + ca-certificates \ + git \ + wget + apt-get -qq -o Dpkg::Use-Pty=0 autoremove + rm -rf /var/lib/apt/lists/* + wget -qO /usr/local/bin/hadolint \ + https://github.com/hadolint/hadolint/releases/latest/download/hadolint-linux-arm64 + chmod +x /usr/local/bin/hadolint + env: + DEBIAN_FRONTEND: noninteractive + shell: bash + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: add matcher + run: | + echo ::add-matcher::.github/hadolint-matcher.json + shell: bash + - name: hadolint + run: | + hadolint Dockerfile + shell: bash diff --git a/.github/workflows/iwyu.yml b/.github/workflows/iwyu.yml new file mode 100644 index 00000000..5826f640 --- /dev/null +++ b/.github/workflows/iwyu.yml @@ -0,0 +1,97 @@ +# +# iwyu.yml +# RVO2 Library +# +# SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Please send all bug reports to . +# +# The authors may be contacted via: +# +# Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +# Dept. of Computer Science +# 201 S. Columbia St. +# Frederick P. Brooks, Jr. Computer Science Bldg. +# Chapel Hill, N.C. 27599-3175 +# United States of America +# +# +# + +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +--- +name: iwyu + +on: # yamllint disable-line rule:truthy + push: + branches: + - main + pull_request: + branches: + - main + schedule: + - cron: '25 7 * * *' + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + iwyu: + name: debian arm64 + runs-on: ubuntu-24.04-arm + container: debian:trixie-slim + timeout-minutes: 15 + steps: + - name: setup + run: | + apt-get -qq -o APT::Acquire::Retries=4 update \ + || (sleep 15; apt-get -qq -o APT::Acquire::Retries=4 update) + apt-get -qq -o APT::Acquire::Retries=4 -o Dpkg::Use-Pty=0 \ + --no-install-recommends install \ + ca-certificates \ + g++ \ + git \ + iwyu \ + meson \ + ninja-build \ + pkgconf + apt-get -qq -o Dpkg::Use-Pty=0 autoremove + rm -rf /var/lib/apt/lists/* + env: + DEBIAN_FRONTEND: noninteractive + shell: bash + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: setup build + run: | + meson setup \ + -Db_lto=false \ + -Dopenmp=disabled \ + -Dwerror=true \ + _build + ninja -C _build + shell: bash + - name: iwyu + run: | + iwyu_tool -j "$(nproc)" -p _build -- \ + --mapping_file="$(pwd)/.iwyu_mappings.imp" + shell: bash diff --git a/.github/workflows/lizard.yml b/.github/workflows/lizard.yml new file mode 100644 index 00000000..10885984 --- /dev/null +++ b/.github/workflows/lizard.yml @@ -0,0 +1,134 @@ +# +# lizard.yml +# RVO2 Library +# +# SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Please send all bug reports to . +# +# The authors may be contacted via: +# +# Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +# Dept. of Computer Science +# 201 S. Columbia St. +# Frederick P. Brooks, Jr. Computer Science Bldg. +# Chapel Hill, N.C. 27599-3175 +# United States of America +# +# +# + +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +--- +name: lizard + +on: # yamllint disable-line rule:truthy + push: + branches: + - main + pull_request: + branches: + - main + schedule: + - cron: '30 7 * * *' + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + lizard: + name: debian arm64 + runs-on: ubuntu-24.04-arm + container: debian:trixie-slim + timeout-minutes: 15 + steps: + - name: setup + run: | + apt-get -qq -o APT::Acquire::Retries=4 update \ + || (sleep 15; apt-get -qq -o APT::Acquire::Retries=4 update) + apt-get -qq -o APT::Acquire::Retries=4 -o Dpkg::Use-Pty=0 \ + --no-install-recommends install \ + ca-certificates \ + git \ + pipx + apt-get -qq -o Dpkg::Use-Pty=0 autoremove + rm -rf /var/lib/apt/lists/* + echo "${HOME}/.local/bin" >> "${GITHUB_PATH}" + pipx install lizard + env: + DEBIAN_FRONTEND: noninteractive + shell: bash + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: add problem matcher + run: | + echo ::add-matcher::.github/lizard-matcher.json + shell: bash + - name: lizard + run: | + lizard --CCN 54 src/ examples/ 2>&1 | tee /tmp/lizard-output.txt + shell: bash + - name: summary + if: always() + run: | + python3 - <<'EOF' >> "$GITHUB_STEP_SUMMARY" + lines = open('/tmp/lizard-output.txt').readlines() + file_hdr = next( + (i for i, l in enumerate(lines) + if l.strip().startswith('NLOC') and 'function_cnt' in l), None + ) + total_hdr = next( + (i for i, l in enumerate(lines) + if l.strip().startswith('Total nloc')), None + ) + if file_hdr is not None: + headers = lines[file_hdr].split() + rows = [] + for line in lines[file_hdr + 2:]: + s = line.strip() + if not s or s.startswith('='): + break + parts = s.split(None, len(headers) - 1) + if parts: + rows.append(parts) + print('## Lizard Complexity') + print() + print('| ' + ' | '.join(headers) + ' |') + print('| ' + ' | '.join(['---'] * len(headers)) + ' |') + for row in rows: + print('| ' + ' | '.join(row) + ' |') + print() + if total_hdr is not None: + cols = ['Total nloc', 'Avg.NLOC', 'AvgCCN', 'Avg.token', + 'Fun Cnt', 'Warning cnt', 'Fun Rt', 'nloc Rt'] + data = ( + lines[total_hdr + 2].split() + if total_hdr + 2 < len(lines) else [] + ) + if data: + print('### Totals') + print() + print('| ' + ' | '.join(cols) + ' |') + print('| ' + ' | '.join(['---'] * len(cols)) + ' |') + print('| ' + ' | '.join(data) + ' |') + EOF + shell: bash diff --git a/.github/workflows/markdownlint.yml b/.github/workflows/markdownlint.yml new file mode 100644 index 00000000..1ed559a2 --- /dev/null +++ b/.github/workflows/markdownlint.yml @@ -0,0 +1,89 @@ +# +# markdownlint.yml +# RVO2 Library +# +# SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Please send all bug reports to . +# +# The authors may be contacted via: +# +# Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +# Dept. of Computer Science +# 201 S. Columbia St. +# Frederick P. Brooks, Jr. Computer Science Bldg. +# Chapel Hill, N.C. 27599-3175 +# United States of America +# +# +# + +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +--- +name: markdownlint + +on: # yamllint disable-line rule:truthy + push: + branches: + - main + pull_request: + branches: + - main + schedule: + - cron: '35 7 * * *' + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + markdownlint: + name: debian arm64 + runs-on: ubuntu-24.04-arm + container: debian:trixie-slim + timeout-minutes: 15 + steps: + - name: setup + run: | + apt-get -qq -o APT::Acquire::Retries=4 update \ + || (sleep 15; apt-get -qq -o APT::Acquire::Retries=4 update) + apt-get -qq -o APT::Acquire::Retries=4 -o Dpkg::Use-Pty=0 \ + --no-install-recommends install \ + ca-certificates \ + git \ + nodejs \ + npm + apt-get -qq -o Dpkg::Use-Pty=0 autoremove + rm -rf /var/lib/apt/lists/* + npm install -g markdownlint-cli@0.48.0 + env: + DEBIAN_FRONTEND: noninteractive + shell: bash + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: add problem matcher + run: | + echo ::add-matcher::.github/markdownlint-matcher.json + shell: bash + - name: markdownlint + run: | + markdownlint '**/*.md' + shell: bash diff --git a/.github/workflows/meson-format.yml b/.github/workflows/meson-format.yml new file mode 100644 index 00000000..3cba400f --- /dev/null +++ b/.github/workflows/meson-format.yml @@ -0,0 +1,85 @@ +# +# meson-format.yml +# RVO2 Library +# +# SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Please send all bug reports to . +# +# The authors may be contacted via: +# +# Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +# Dept. of Computer Science +# 201 S. Columbia St. +# Frederick P. Brooks, Jr. Computer Science Bldg. +# Chapel Hill, N.C. 27599-3175 +# United States of America +# +# +# + +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +--- +name: meson-format + +on: # yamllint disable-line rule:truthy + push: + branches: + - main + pull_request: + branches: + - main + schedule: + - cron: '40 7 * * *' + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + meson-format: + name: debian arm64 + runs-on: ubuntu-24.04-arm + container: debian:trixie-slim + timeout-minutes: 15 + steps: + - name: setup + run: | + apt-get -qq -o APT::Acquire::Retries=4 update \ + || (sleep 15; apt-get -qq -o APT::Acquire::Retries=4 update) + apt-get -qq -o APT::Acquire::Retries=4 -o Dpkg::Use-Pty=0 \ + --no-install-recommends install \ + ca-certificates \ + git \ + meson + apt-get -qq -o Dpkg::Use-Pty=0 autoremove + rm -rf /var/lib/apt/lists/* + env: + DEBIAN_FRONTEND: noninteractive + shell: bash + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: meson format + run: | + git config --global --add safe.directory "${GITHUB_WORKSPACE}" + meson format -i -r . + git diff --color --exit-code + shell: bash diff --git a/.github/workflows/meson.yml b/.github/workflows/meson.yml index dc12842d..02d02870 100644 --- a/.github/workflows/meson.yml +++ b/.github/workflows/meson.yml @@ -43,7 +43,7 @@ on: # yamllint disable-line rule:truthy branches: - main schedule: - - cron: '30 5 * * *' + - cron: '20 6 * * *' permissions: contents: read @@ -77,10 +77,13 @@ jobs: shell: bash - name: checkout uses: actions/checkout@v6 + with: + persist-credentials: false - name: build test package run: | meson setup \ --prefix "$(pwd)/_build/install" \ + -Dbuildtype=release \ -Db_lto=true \ -Dopenmp=enabled \ -Dwerror=true \ @@ -110,10 +113,13 @@ jobs: shell: sh - name: checkout uses: actions/checkout@v6 + with: + persist-credentials: false - name: build test package run: | meson setup \ --prefix "$(pwd)/_build/install" \ + -Dbuildtype=release \ -Db_lto=true \ -Dopenmp=enabled \ -Dwerror=true \ @@ -146,10 +152,13 @@ jobs: shell: bash - name: checkout uses: actions/checkout@v6 + with: + persist-credentials: false - name: build test package run: | meson setup \ --prefix "$(pwd)/_build/install" \ + -Dbuildtype=release \ -Db_lto=true \ -Dopenmp=enabled \ -Dwerror=true \ @@ -183,10 +192,13 @@ jobs: shell: bash - name: checkout uses: actions/checkout@v6 + with: + persist-credentials: false - name: build test package run: | meson setup \ --prefix "$(pwd)/_build/install" \ + -Dbuildtype=release \ -Db_lto=true \ -Dopenmp=enabled \ -Dwerror=true \ @@ -205,14 +217,16 @@ jobs: steps: - name: checkout uses: actions/checkout@v6 + with: + persist-credentials: false - name: cache homebrew uses: actions/cache@v5 with: path: ~/Library/Caches/Homebrew/downloads - key: | - ${{ runner.os }}-${{ runner.arch }}-brew-${{ hashFiles('Brewfile') }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-brew- + key: >- + ${{ runner.os }}-${{ runner.arch }}-brew-${{ + hashFiles('Brewfile') }} + restore-keys: ${{ runner.os }}-${{ runner.arch }}-brew- - name: setup run: | brew update -q || (sleep 15; brew update -q) @@ -228,6 +242,7 @@ jobs: run: | meson setup \ --prefix "$(pwd)/_build/install" \ + -Dbuildtype=release \ -Db_lto=true \ -Dopenmp=disabled \ -Dwerror=true \ @@ -246,14 +261,16 @@ jobs: steps: - name: checkout uses: actions/checkout@v6 + with: + persist-credentials: false - name: cache homebrew uses: actions/cache@v5 with: path: ~/Library/Caches/Homebrew/downloads - key: | - ${{ runner.os }}-${{ runner.arch }}-brew-${{ hashFiles('Brewfile') }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-brew- + key: >- + ${{ runner.os }}-${{ runner.arch }}-brew-${{ + hashFiles('Brewfile') }} + restore-keys: ${{ runner.os }}-${{ runner.arch }}-brew- - name: setup run: | brew update -q || (sleep 15; brew update -q) @@ -269,6 +286,7 @@ jobs: run: | meson setup \ --prefix "$(pwd)/_build/install" \ + -Dbuildtype=release \ -Db_lto=true \ -Dopenmp=disabled \ -Dwerror=true \ @@ -300,10 +318,13 @@ jobs: shell: bash - name: checkout uses: actions/checkout@v6 + with: + persist-credentials: false - name: build test package run: | meson setup \ --prefix "$(pwd)/_build/install" \ + -Dbuildtype=release \ -Db_lto=true \ -Dopenmp=enabled \ -Dwerror=true \ @@ -340,10 +361,13 @@ jobs: shell: bash - name: checkout uses: actions/checkout@v6 + with: + persist-credentials: false - name: build test package run: | meson setup \ --prefix "$(pwd)/_build/install" \ + -Dbuildtype=release \ -Db_lto=true \ -Dopenmp=enabled \ -Dwerror=true \ @@ -380,10 +404,13 @@ jobs: shell: bash - name: checkout uses: actions/checkout@v6 + with: + persist-credentials: false - name: build test package run: | meson setup \ --prefix "$(pwd)/_build/install" \ + -Dbuildtype=release \ -Db_lto=true \ -Dopenmp=enabled \ -Dwerror=true \ @@ -406,28 +433,31 @@ jobs: path: | ~\AppData\Local\Microsoft\WinGet\Links ~\AppData\Local\Microsoft\WinGet\SourceData - key: | - ${{ runner.os }}-${{ runner.arch }}-winget-${{ hashFiles('.github/workflows/*.yml') }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-winget- + key: >- + ${{ runner.os }}-${{ runner.arch }}-winget-${{ + hashFiles('.github/workflows/*.yml') }} + restore-keys: ${{ runner.os }}-${{ runner.arch }}-winget- - name: setup run: | - winget install -e --accept-package-agreements --accept-source-agreements ` - --id Git.Git - winget install -e --accept-package-agreements --accept-source-agreements ` - --id mesonbuild.meson - winget install -e --accept-package-agreements --accept-source-agreements ` - --id Ninja-build.Ninja + winget install -e --accept-package-agreements ` + --accept-source-agreements --id Git.Git + winget install -e --accept-package-agreements ` + --accept-source-agreements --id mesonbuild.meson + winget install -e --accept-package-agreements ` + --accept-source-agreements --id Ninja-build.Ninja Add-Content $env:GITHUB_PATH ( - [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + ` - [System.Environment]::GetEnvironmentVariable("Path", "User")) + [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ` + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")) shell: pwsh - name: checkout uses: actions/checkout@v6 + with: + persist-credentials: false - name: build test package run: | meson setup ` --prefix "${PWD}/_build/install" ` + -Dbuildtype=release ` -Db_lto=true ` -Ddefault_library=static ` -Dopenmp=disabled ` @@ -451,30 +481,33 @@ jobs: path: | ~\AppData\Local\Microsoft\WinGet\Links ~\AppData\Local\Microsoft\WinGet\SourceData - key: | - ${{ runner.os }}-${{ runner.arch }}-winget-${{ hashFiles('.github/workflows/*.yml') }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-winget- + key: >- + ${{ runner.os }}-${{ runner.arch }}-winget-${{ + hashFiles('.github/workflows/*.yml') }} + restore-keys: ${{ runner.os }}-${{ runner.arch }}-winget- - name: setup run: | Install-Module -Force -Name Microsoft.WinGet.Client Repair-WinGetPackageManager -Force -Latest - winget install -e --accept-package-agreements --accept-source-agreements ` - --id Git.Git - winget install -e --accept-package-agreements --accept-source-agreements ` - --id mesonbuild.meson - winget install -e --accept-package-agreements --accept-source-agreements ` - --id Ninja-build.Ninja + winget install -e --accept-package-agreements ` + --accept-source-agreements --id Git.Git + winget install -e --accept-package-agreements ` + --accept-source-agreements --id mesonbuild.meson + winget install -e --accept-package-agreements ` + --accept-source-agreements --id Ninja-build.Ninja Add-Content $env:GITHUB_PATH ( - [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + ` - [System.Environment]::GetEnvironmentVariable("Path", "User")) + [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ` + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")) shell: pwsh - name: checkout uses: actions/checkout@v6 + with: + persist-credentials: false - name: build test package run: | meson setup ` --prefix "${PWD}/_build/install" ` + -Dbuildtype=release ` -Db_lto=true ` -Ddefault_library=static ` -Dopenmp=disabled ` diff --git a/.github/workflows/reuse.yml b/.github/workflows/reuse.yml new file mode 100644 index 00000000..d3336d2c --- /dev/null +++ b/.github/workflows/reuse.yml @@ -0,0 +1,66 @@ +# +# reuse.yml +# RVO2 Library +# +# SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Please send all bug reports to . +# +# The authors may be contacted via: +# +# Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +# Dept. of Computer Science +# 201 S. Columbia St. +# Frederick P. Brooks, Jr. Computer Science Bldg. +# Chapel Hill, N.C. 27599-3175 +# United States of America +# +# +# + +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +--- +name: reuse + +on: # yamllint disable-line rule:truthy + push: + branches: + - main + pull_request: + branches: + - main + schedule: + - cron: '45 7 * * *' + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + reuse: + name: reuse arm64 + runs-on: ubuntu-24.04-arm + timeout-minutes: 15 + steps: + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: reuse lint + uses: fsfe/reuse-action@v5 diff --git a/.github/workflows/sanitizer.yml b/.github/workflows/sanitizer.yml new file mode 100644 index 00000000..5d7d944c --- /dev/null +++ b/.github/workflows/sanitizer.yml @@ -0,0 +1,214 @@ +# +# sanitizer.yml +# RVO2 Library +# +# SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Please send all bug reports to . +# +# The authors may be contacted via: +# +# Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +# Dept. of Computer Science +# 201 S. Columbia St. +# Frederick P. Brooks, Jr. Computer Science Bldg. +# Chapel Hill, N.C. 27599-3175 +# United States of America +# +# +# + +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +--- +name: sanitizer + +on: # yamllint disable-line rule:truthy + push: + branches: + - main + pull_request: + branches: + - main + schedule: + - cron: '20 5 * * *' + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + sanitizer-asan: + name: asan debian ${{ matrix.arch }} + runs-on: ${{ matrix.runner }} + container: debian:trixie-slim + timeout-minutes: 60 + strategy: + matrix: + include: + - arch: amd64 + runner: ubuntu-latest + - arch: arm64 + runner: ubuntu-24.04-arm + steps: + - name: setup + run: | + apt-get -qq -o APT::Acquire::Retries=4 update \ + || (sleep 15; apt-get -qq -o APT::Acquire::Retries=4 update) + apt-get -qq -o APT::Acquire::Retries=4 -o Dpkg::Use-Pty=0 \ + --no-install-recommends install \ + ca-certificates \ + g++ \ + git \ + meson \ + ninja-build \ + pkgconf + apt-get -qq -o Dpkg::Use-Pty=0 autoremove + rm -rf /var/lib/apt/lists/* + env: + DEBIAN_FRONTEND: noninteractive + shell: bash + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: build + run: | + meson setup \ + -Db_lto=false \ + -Db_lundef=false \ + -Db_sanitize=address \ + -Dbuildtype=debug \ + -Dopenmp=disabled \ + -Dwerror=true \ + _build + ninja -C _build + shell: bash + - name: test + env: + ASAN_OPTIONS: halt_on_error=1:print_stacktrace=1 + LSAN_OPTIONS: print_suppressions=0 + run: | + meson test -C _build --print-errorlogs + shell: bash + + sanitizer-tsan: + name: tsan debian ${{ matrix.arch }} + runs-on: ${{ matrix.runner }} + container: debian:trixie-slim + timeout-minutes: 60 + strategy: + matrix: + include: + - arch: amd64 + runner: ubuntu-latest + - arch: arm64 + runner: ubuntu-24.04-arm + steps: + - name: setup + run: | + apt-get -qq -o APT::Acquire::Retries=4 update \ + || (sleep 15; apt-get -qq -o APT::Acquire::Retries=4 update) + apt-get -qq -o APT::Acquire::Retries=4 -o Dpkg::Use-Pty=0 \ + --no-install-recommends install \ + ca-certificates \ + g++ \ + git \ + meson \ + ninja-build \ + pkgconf + apt-get -qq -o Dpkg::Use-Pty=0 autoremove + rm -rf /var/lib/apt/lists/* + env: + DEBIAN_FRONTEND: noninteractive + shell: bash + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: build + run: | + meson setup \ + -Db_lto=false \ + -Db_lundef=false \ + -Db_sanitize=thread \ + -Dbuildtype=debug \ + -Dopenmp=disabled \ + -Dwerror=true \ + _build + ninja -C _build + shell: bash + - name: test + env: + TSAN_OPTIONS: halt_on_error=1:second_deadlock_stack=1 + run: | + meson test -C _build --print-errorlogs + shell: bash + + sanitizer-ubsan: + name: ubsan debian ${{ matrix.arch }} + runs-on: ${{ matrix.runner }} + container: debian:trixie-slim + timeout-minutes: 60 + strategy: + matrix: + include: + - arch: amd64 + runner: ubuntu-latest + - arch: arm64 + runner: ubuntu-24.04-arm + steps: + - name: setup + run: | + apt-get -qq -o APT::Acquire::Retries=4 update \ + || (sleep 15; apt-get -qq -o APT::Acquire::Retries=4 update) + apt-get -qq -o APT::Acquire::Retries=4 -o Dpkg::Use-Pty=0 \ + --no-install-recommends install \ + ca-certificates \ + g++ \ + git \ + meson \ + ninja-build \ + pkgconf + apt-get -qq -o Dpkg::Use-Pty=0 autoremove + rm -rf /var/lib/apt/lists/* + env: + DEBIAN_FRONTEND: noninteractive + shell: bash + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: build + run: | + meson setup \ + -Db_lto=false \ + -Db_lundef=false \ + -Db_sanitize=undefined \ + -Dbuildtype=debug \ + -Dopenmp=disabled \ + -Dwerror=true \ + _build + ninja -C _build + shell: bash + - name: test + env: + UBSAN_OPTIONS: halt_on_error=1:print_stacktrace=1 + run: | + meson test -C _build --print-errorlogs + shell: bash diff --git a/.github/workflows/valgrind.yml b/.github/workflows/valgrind.yml new file mode 100644 index 00000000..c53c27b2 --- /dev/null +++ b/.github/workflows/valgrind.yml @@ -0,0 +1,113 @@ +# +# valgrind.yml +# RVO2 Library +# +# SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Please send all bug reports to . +# +# The authors may be contacted via: +# +# Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +# Dept. of Computer Science +# 201 S. Columbia St. +# Frederick P. Brooks, Jr. Computer Science Bldg. +# Chapel Hill, N.C. 27599-3175 +# United States of America +# +# +# + +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +--- +name: valgrind + +on: # yamllint disable-line rule:truthy + push: + branches: + - main + pull_request: + branches: + - main + schedule: + - cron: '40 5 * * *' + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + valgrind: + name: debian ${{ matrix.arch }} + runs-on: ${{ matrix.runner }} + container: debian:trixie-slim + timeout-minutes: 60 + strategy: + matrix: + include: + - arch: amd64 + runner: ubuntu-latest + - arch: arm64 + runner: ubuntu-24.04-arm + steps: + - name: setup + run: | + apt-get -qq -o APT::Acquire::Retries=4 update \ + || (sleep 15; apt-get -qq -o APT::Acquire::Retries=4 update) + apt-get -qq -o APT::Acquire::Retries=4 -o Dpkg::Use-Pty=0 \ + --no-install-recommends install \ + ca-certificates \ + g++ \ + git \ + meson \ + ninja-build \ + pkgconf \ + valgrind + apt-get -qq -o Dpkg::Use-Pty=0 autoremove + rm -rf /var/lib/apt/lists/* + env: + DEBIAN_FRONTEND: noninteractive + shell: bash + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: build + run: | + meson setup \ + -Db_lto=false \ + -Dbuildtype=debug \ + -Dopenmp=disabled \ + -Dwerror=true \ + _build + ninja -C _build + shell: bash + - name: test + run: | + meson test -C _build \ + --print-errorlogs \ + --timeout-multiplier 8 \ + --wrapper \ + 'valgrind + --error-exitcode=1 + --errors-for-leak-kinds=definite,indirect + --leak-check=full + --show-leak-kinds=definite,indirect + --track-origins=yes' + shell: bash diff --git a/.github/workflows/validate-cff.yml b/.github/workflows/validate-cff.yml new file mode 100644 index 00000000..ba16a020 --- /dev/null +++ b/.github/workflows/validate-cff.yml @@ -0,0 +1,85 @@ +# +# validate-cff.yml +# RVO2 Library +# +# SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Please send all bug reports to . +# +# The authors may be contacted via: +# +# Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +# Dept. of Computer Science +# 201 S. Columbia St. +# Frederick P. Brooks, Jr. Computer Science Bldg. +# Chapel Hill, N.C. 27599-3175 +# United States of America +# +# +# + +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +--- +name: cffconvert + +on: # yamllint disable-line rule:truthy + push: + branches: + - main + pull_request: + branches: + - main + schedule: + - cron: '50 7 * * *' + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + cffconvert: + name: debian arm64 + runs-on: ubuntu-24.04-arm + container: debian:trixie-slim + timeout-minutes: 15 + steps: + - name: setup + run: | + apt-get -qq -o APT::Acquire::Retries=4 update \ + || (sleep 15; apt-get -qq -o APT::Acquire::Retries=4 update) + apt-get -qq -o APT::Acquire::Retries=4 -o Dpkg::Use-Pty=0 \ + --no-install-recommends install \ + ca-certificates \ + git \ + pipx + apt-get -qq -o Dpkg::Use-Pty=0 autoremove + rm -rf /var/lib/apt/lists/* + echo "${HOME}/.local/bin" >> "${GITHUB_PATH}" + pipx install cffconvert + env: + DEBIAN_FRONTEND: noninteractive + shell: bash + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: cffconvert validate + run: | + cffconvert --validate + shell: bash diff --git a/.github/workflows/yamllint.yml b/.github/workflows/yamllint.yml new file mode 100644 index 00000000..2689763e --- /dev/null +++ b/.github/workflows/yamllint.yml @@ -0,0 +1,83 @@ +# +# yamllint.yml +# RVO2 Library +# +# SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Please send all bug reports to . +# +# The authors may be contacted via: +# +# Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +# Dept. of Computer Science +# 201 S. Columbia St. +# Frederick P. Brooks, Jr. Computer Science Bldg. +# Chapel Hill, N.C. 27599-3175 +# United States of America +# +# +# + +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +--- +name: yamllint + +on: # yamllint disable-line rule:truthy + push: + branches: + - main + pull_request: + branches: + - main + schedule: + - cron: '55 7 * * *' + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + yamllint: + name: debian arm64 + runs-on: ubuntu-24.04-arm + container: debian:trixie-slim + timeout-minutes: 15 + steps: + - name: setup + run: | + apt-get -qq -o APT::Acquire::Retries=4 update \ + || (sleep 15; apt-get -qq -o APT::Acquire::Retries=4 update) + apt-get -qq -o APT::Acquire::Retries=4 -o Dpkg::Use-Pty=0 \ + --no-install-recommends install \ + ca-certificates \ + git \ + yamllint + apt-get -qq -o Dpkg::Use-Pty=0 autoremove + rm -rf /var/lib/apt/lists/* + env: + DEBIAN_FRONTEND: noninteractive + shell: bash + - name: checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: yamllint + run: | + yamllint --format github . + shell: bash diff --git a/.hadolint.yaml b/.hadolint.yaml new file mode 100644 index 00000000..c27bebfc --- /dev/null +++ b/.hadolint.yaml @@ -0,0 +1,54 @@ +# +# .hadolint.yaml +# RVO2 Library +# +# SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Please send all bug reports to . +# +# The authors may be contacted via: +# +# Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +# Dept. of Computer Science +# 201 S. Columbia St. +# Frederick P. Brooks, Jr. Computer Science Bldg. +# Chapel Hill, N.C. 27599-3175 +# United States of America +# +# +# + +# yamllint disable-line rule:line-length +# yaml-language-server: $schema=https://raw.githubusercontent.com/hadolint/hadolint/master/contrib/hadolint.json +--- +ignored: + - DL3008 + - DL3013 + - DL3018 + +label-schema: + org.opencontainers.image.authors: text + org.opencontainers.image.base.name: text + org.opencontainers.image.description: text + org.opencontainers.image.licenses: spdx + org.opencontainers.image.source: url + org.opencontainers.image.title: text + org.opencontainers.image.url: url + org.opencontainers.image.vendor: text + org.opencontainers.image.version: semver + +trustedRegistries: + - docker.io diff --git a/.iwyu_mappings.imp b/.iwyu_mappings.imp new file mode 100644 index 00000000..e0e85c20 --- /dev/null +++ b/.iwyu_mappings.imp @@ -0,0 +1,42 @@ +# -*- mode: yaml; -*- +# vi: set ft=yaml: +# +# .iwyu_mappings.imp +# RVO2 Library +# +# SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Please send all bug reports to . +# +# The authors may be contacted via: +# +# Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +# Dept. of Computer Science +# 201 S. Columbia St. +# Frederick P. Brooks, Jr. Computer Science Bldg. +# Chapel Hill, N.C. 27599-3175 +# United States of America +# +# + +[ + { + "include": ["@<__algorithm/.*>", "private", "", "public"] + }, + { + "include": ["@<__utility/.*>", "private", "", "public"] + } +] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index da6d4b6c..78bd225c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,37 @@ +# +# .pre-commit-config.yaml +# RVO2 Library +# +# SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Please send all bug reports to . +# +# The authors may be contacted via: +# +# Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +# Dept. of Computer Science +# 201 S. Columbia St. +# Frederick P. Brooks, Jr. Computer Science Bldg. +# Chapel Hill, N.C. 27599-3175 +# United States of America +# +# +# + +# yaml-language-server: $schema=https://json.schemastore.org/pre-commit-config.json --- repos: - repo: https://codeberg.org/fsfe/reuse-tool diff --git a/.secrets.baseline b/.secrets.baseline new file mode 100644 index 00000000..ceeefd68 --- /dev/null +++ b/.secrets.baseline @@ -0,0 +1,127 @@ +{ + "version": "1.5.0", + "plugins_used": [ + { + "name": "ArtifactoryDetector" + }, + { + "name": "AWSKeyDetector" + }, + { + "name": "AzureStorageKeyDetector" + }, + { + "name": "Base64HighEntropyString", + "limit": 4.5 + }, + { + "name": "BasicAuthDetector" + }, + { + "name": "CloudantDetector" + }, + { + "name": "DiscordBotTokenDetector" + }, + { + "name": "GitHubTokenDetector" + }, + { + "name": "GitLabTokenDetector" + }, + { + "name": "HexHighEntropyString", + "limit": 3.0 + }, + { + "name": "IbmCloudIamDetector" + }, + { + "name": "IbmCosHmacDetector" + }, + { + "name": "IPPublicDetector" + }, + { + "name": "JwtTokenDetector" + }, + { + "name": "KeywordDetector", + "keyword_exclude": "" + }, + { + "name": "MailchimpDetector" + }, + { + "name": "NpmDetector" + }, + { + "name": "OpenAIDetector" + }, + { + "name": "PrivateKeyDetector" + }, + { + "name": "PypiTokenDetector" + }, + { + "name": "SendGridDetector" + }, + { + "name": "SlackDetector" + }, + { + "name": "SoftlayerDetector" + }, + { + "name": "SquareOAuthDetector" + }, + { + "name": "StripeDetector" + }, + { + "name": "TelegramBotTokenDetector" + }, + { + "name": "TwilioKeyDetector" + } + ], + "filters_used": [ + { + "path": "detect_secrets.filters.allowlist.is_line_allowlisted" + }, + { + "path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies", + "min_level": 2 + }, + { + "path": "detect_secrets.filters.heuristic.is_indirect_reference" + }, + { + "path": "detect_secrets.filters.heuristic.is_likely_id_string" + }, + { + "path": "detect_secrets.filters.heuristic.is_lock_file" + }, + { + "path": "detect_secrets.filters.heuristic.is_not_alphanumeric_string" + }, + { + "path": "detect_secrets.filters.heuristic.is_potential_uuid" + }, + { + "path": "detect_secrets.filters.heuristic.is_prefixed_with_dollar_sign" + }, + { + "path": "detect_secrets.filters.heuristic.is_sequential_string" + }, + { + "path": "detect_secrets.filters.heuristic.is_swagger_file" + }, + { + "path": "detect_secrets.filters.heuristic.is_templated_secret" + } + ], + "results": {}, + "generated_at": "2026-04-25T16:22:07Z" +} diff --git a/.secrets.baseline.license b/.secrets.baseline.license new file mode 100644 index 00000000..db8420f2 --- /dev/null +++ b/.secrets.baseline.license @@ -0,0 +1,30 @@ +.secrets.baseline +RVO2 Library + +SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill +SPDX-License-Identifier: Apache-2.0 + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +Please send all bug reports to . + +The authors may be contacted via: + +Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha +Dept. of Computer Science +201 S. Columbia St. +Frederick P. Brooks, Jr. Computer Science Bldg. +Chapel Hill, N.C. 27599-3175 +United States of America + + diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 84938368..a7357b40 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,4 +1,5 @@ { + "$schema": "vscode://schemas/vscode-extensions", "recommendations": [ "bazelbuild.vscode-bazel", "editorconfig.editorconfig", diff --git a/.vscode/settings.json b/.vscode/settings.json index ff487dd9..85c9fec4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,5 @@ { + "$schema": "vscode://schemas/settings/workspace", "cmake.buildDirectory": "${workspaceFolder}/_build", "cmake.preferredGenerators": [ "Ninja Multi-Config", diff --git a/.yamllint.yaml b/.yamllint.yaml index b94204f1..4a85bd34 100644 --- a/.yamllint.yaml +++ b/.yamllint.yaml @@ -31,10 +31,25 @@ # # +# yaml-language-server: $schema=https://json.schemastore.org/yamllint.json --- extends: default +ignore: + - .venv/ + +yaml-files: + - .clang-format + - .clang-tidy + - .gersemirc + - .yamllint + - CITATION.cff + - '*.yaml' + - '*.yml' + rules: line-length: - max: 80 + allow-non-breakable-inline-mappings: true + allow-non-breakable-words: true level: warning + max: 100 diff --git a/Brewfile b/Brewfile index a2fcb56f..f50c8261 100644 --- a/Brewfile +++ b/Brewfile @@ -34,20 +34,31 @@ # # +brew 'actionlint' brew 'bazelisk', conflicts_with: ['bazel'] brew 'buildifier' brew 'buildozer' +brew 'check-jsonschema' brew 'cmake' +brew 'codespell' brew 'cppcheck' brew 'cpplint' +brew 'detect-secrets' brew 'doxygen' +brew 'gcc' +brew 'gcovr' brew 'git' brew 'graphviz' +brew 'hadolint' brew 'include-what-you-use' brew 'jsonlint' +brew 'lcov' +brew 'lizard' +brew 'llvm' brew 'markdownlint-cli' brew 'meson' brew 'ninja' brew 'pkgconf', conflicts_with: ['pkg-config'] brew 'python' +brew 'reuse' brew 'yamllint' diff --git a/CITATION.cff b/CITATION.cff index 65bab98e..bc0ee4f3 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -58,6 +58,8 @@ # # +# yamllint disable-line rule:line-length +# yaml-language-server: $schema=https://raw.githubusercontent.com/citation-file-format/citation-file-format/1.2.0/schema.json --- cff-version: 1.2.0 abstract: >- diff --git a/CMakeLists.txt b/CMakeLists.txt index 3750749b..63248d41 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,31 +35,45 @@ # cmake_minimum_required(VERSION 3.26) -project(RVO +project( + RVO VERSION 2.0.3 DESCRIPTION "Optimal Reciprocal Collision Avoidance" HOMEPAGE_URL https://gamma.cs.unc.edu/RVO2/ - LANGUAGES CXX) + LANGUAGES CXX +) if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) # cmake-lint: disable=C0301 - set(CMAKE_BUILD_TYPE Release CACHE STRING + set( + CMAKE_BUILD_TYPE + Release + CACHE STRING "Choose the type of build; options are Debug Release RelWithDebInfo MinSizeRel" - FORCE) - set_property(CACHE CMAKE_BUILD_TYPE PROPERTY - STRINGS Debug Release RelWithDebInfo MinSizeRel) + FORCE + ) + set_property( + CACHE CMAKE_BUILD_TYPE + PROPERTY STRINGS Debug Release RelWithDebInfo MinSizeRel + ) endif() -option(ENABLE_CMAKE_EXPERIMENTAL_FEATURES - "Enable CMake experimental features" OFF) +option( + ENABLE_CMAKE_EXPERIMENTAL_FEATURES + "Enable CMake experimental features" + OFF +) include(CTest) if(WIN32) set(BUILD_SHARED_LIBS OFF) else() - option(BUILD_SHARED_LIBS "Build all libraries as shared" - ${PROJECT_IS_TOP_LEVEL}) + option( + BUILD_SHARED_LIBS + "Build all libraries as shared" + ${PROJECT_IS_TOP_LEVEL} + ) endif() include(GNUInstallDirs) @@ -88,14 +102,19 @@ if(ENABLE_OPENMP) find_package(OpenMP MODULE) endif() -option(ENABLE_INTERPROCEDURAL_OPTIMIZATION - "Enable interprocedural optimization if supported" OFF) +option( + ENABLE_INTERPROCEDURAL_OPTIMIZATION + "Enable interprocedural optimization if supported" + OFF +) if(ENABLE_INTERPROCEDURAL_OPTIMIZATION) include(CheckIPOSupported) - check_ipo_supported(RESULT RVO_INTERPROCEDURAL_OPTIMIZATION_SUPPORTED - LANGUAGES CXX) + check_ipo_supported( + RESULT RVO_INTERPROCEDURAL_OPTIMIZATION_SUPPORTED + LANGUAGES CXX + ) if(RVO_INTERPROCEDURAL_OPTIMIZATION_SUPPORTED) message(STATUS "Interprocedural optimization is supported") @@ -109,8 +128,11 @@ endif() include(CheckCXXCompilerFlag) include(CheckLinkerFlag) -option(ENABLE_HARDENING - "Enable hardening compiler and linker flags if supported" ON) +option( + ENABLE_HARDENING + "Enable hardening compiler and linker flags if supported" + ON +) if(ENABLE_HARDENING) if(MSVC) @@ -125,9 +147,11 @@ if(ENABLE_HARDENING) check_linker_flag(CXX /GUARD:CF RVO_LINKER_SUPPORTS_GUARD_CF) check_linker_flag(CXX /NXCOMPAT RVO_LINKER_SUPPORTS_NXCOMPAT) - if(RVO_COMPILER_SUPPORTS_GUARD_CF - AND RVO_LINKER_SUPPORTS_DYNAMICBASE - AND RVO_LINKER_SUPPORTS_GUARD_CF) + if( + RVO_COMPILER_SUPPORTS_GUARD_CF + AND RVO_LINKER_SUPPORTS_DYNAMICBASE + AND RVO_LINKER_SUPPORTS_GUARD_CF + ) add_compile_options(/guard:cf) add_link_options(/DYNAMICBASE /GUARD:CF) endif() @@ -139,32 +163,48 @@ if(ENABLE_HARDENING) if(APPLE) set(RVO_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") - check_cxx_compiler_flag(-Werror=unused-command-line-argument - RVO_COMPILER_SUPPORTS_WERROR_UNUSED_COMMAND_LINE_ARGUMENT) + check_cxx_compiler_flag( + -Werror=unused-command-line-argument + RVO_COMPILER_SUPPORTS_WERROR_UNUSED_COMMAND_LINE_ARGUMENT + ) if(RVO_COMPILER_SUPPORTS_WERROR_UNUSED_COMMAND_LINE_ARGUMENT) - set(CMAKE_REQUIRED_FLAGS - "${CMAKE_REQUIRED_FLAGS} -Werror=unused-command-line-argument") + set( + CMAKE_REQUIRED_FLAGS + "${CMAKE_REQUIRED_FLAGS} -Werror=unused-command-line-argument" + ) endif() endif() - check_cxx_compiler_flag(-D_FORTIFY_SOURCE=2 - RVO_COMPILER_SUPPORTS_D_FORTIFY_SOURCE_2) - check_cxx_compiler_flag(-fcf-protection - RVO_COMPILER_SUPPORTS_FCF_PROTECTION) + check_cxx_compiler_flag( + -D_FORTIFY_SOURCE=2 + RVO_COMPILER_SUPPORTS_D_FORTIFY_SOURCE_2 + ) + check_cxx_compiler_flag( + -fcf-protection + RVO_COMPILER_SUPPORTS_FCF_PROTECTION + ) check_cxx_compiler_flag(-fno-common RVO_COMPILER_SUPPORTS_FNO_COMMON) - check_cxx_compiler_flag(-fsanitize=safe-stack - RVO_COMPILER_SUPPORTS_FSANITIZE_SAFE_STACK) - check_cxx_compiler_flag(-fstack-clash-protection - RVO_COMPILER_SUPPORTS_FSTACK_CLASH_PROTECTION) - check_cxx_compiler_flag(-fstack-protector-strong - RVO_COMPILER_SUPPORTS_FSTACK_PROTECTOR_STRONG) + check_cxx_compiler_flag( + -fsanitize=safe-stack + RVO_COMPILER_SUPPORTS_FSANITIZE_SAFE_STACK + ) + check_cxx_compiler_flag( + -fstack-clash-protection + RVO_COMPILER_SUPPORTS_FSTACK_CLASH_PROTECTION + ) + check_cxx_compiler_flag( + -fstack-protector-strong + RVO_COMPILER_SUPPORTS_FSTACK_PROTECTOR_STRONG + ) if(RVO_COMPILER_SUPPORTS_FSTACK_PROTECTOR_STRONG) set(RVO_COMPILER_SUPPORTS_FSTACK_PROTECTOR) else() - check_cxx_compiler_flag(-fstack-protector - RVO_COMPILER_SUPPORTS_FSTACK_PROTECTOR) + check_cxx_compiler_flag( + -fstack-protector + RVO_COMPILER_SUPPORTS_FSTACK_PROTECTOR + ) endif() if(RVO_COMPILER_SUPPORTS_D_FORTIFY_SOURCE_2) @@ -185,23 +225,34 @@ if(ENABLE_HARDENING) add_compile_options(-fstack-protector) endif() - check_linker_flag(CXX -Wl,-Bsymbolic-functions - RVO_LINKER_SUPPORTS_BSYMBOLIC_FUNCTIONS) - check_linker_flag(CXX -fsanitize=safe-stack - RVO_LINKER_SUPPORTS_FSANITIZE_SAFE_STACK) + check_linker_flag( + CXX + -Wl,-Bsymbolic-functions + RVO_LINKER_SUPPORTS_BSYMBOLIC_FUNCTIONS + ) + check_linker_flag( + CXX + -fsanitize=safe-stack + RVO_LINKER_SUPPORTS_FSANITIZE_SAFE_STACK + ) check_linker_flag(CXX -Wl,-z,defs RVO_LINKER_SUPPORTS_Z_DEFS) check_linker_flag(CXX -Wl,-z,noexecheap RVO_LINKER_SUPPORTS_Z_NOEXECHEAP) - check_linker_flag(CXX -Wl,-z,noexecstack - RVO_LINKER_SUPPORTS_Z_NOEXECSTACK) + check_linker_flag(CXX -Wl,-z,noexecstack RVO_LINKER_SUPPORTS_Z_NOEXECSTACK) check_linker_flag(CXX -Wl,-z,now RVO_LINKER_SUPPORTS_Z_NOW) check_linker_flag(CXX -Wl,-z,relro RVO_LINKER_SUPPORTS_Z_RELRO) - check_linker_flag(CXX -Wl,-z,separate-code RVO_LINKER_SUPPORTS_Z_SEPARATE_CODE) + check_linker_flag( + CXX + -Wl,-z,separate-code + RVO_LINKER_SUPPORTS_Z_SEPARATE_CODE + ) if(RVO_LINKER_SUPPORTS_BSYMBOLIC_FUNCTIONS) add_link_options($<$>:-Wl,-Bsymbolic-functions>) endif() - if(RVO_COMPILER_SUPPORTS_FSANITIZE_SAFE_STACK - AND RVO_LINKER_SUPPORTS_FSANITIZE_SAFE_STACK) + if( + RVO_COMPILER_SUPPORTS_FSANITIZE_SAFE_STACK + AND RVO_LINKER_SUPPORTS_FSANITIZE_SAFE_STACK + ) add_compile_options($<$>:-fsanitize=safe-stack>) add_link_options($<$>:-fsanitize=safe-stack>) endif() @@ -239,10 +290,14 @@ if(MSVC) endif() else() check_cxx_compiler_flag(-Wall RVO_COMPILER_SUPPORTS_WALL) - check_cxx_compiler_flag(-Wformat-security - RVO_COMPILER_SUPPORTS_WFORMAT_SECURITY) - check_cxx_compiler_flag(-Werror=format-security - RVO_COMPILER_SUPPORTS_WERROR_FORMAT_SECURITY) + check_cxx_compiler_flag( + -Wformat-security + RVO_COMPILER_SUPPORTS_WFORMAT_SECURITY + ) + check_cxx_compiler_flag( + -Werror=format-security + RVO_COMPILER_SUPPORTS_WERROR_FORMAT_SECURITY + ) if(RVO_COMPILER_SUPPORTS_WALL) add_compile_options(-Wall) @@ -259,7 +314,7 @@ if(NOT MSVC) check_linker_flag(CXX -Wl,--as-needed RVO_LINKER_SUPPORTS__AS_NEEDED) if(RVO_LINKER_SUPPORTS__AS_NEEDED) - add_link_options(-Wl,--as-needed) + add_link_options(-Wl,--as-needed) endif() endif() @@ -288,33 +343,39 @@ add_subdirectory(examples) add_subdirectory(doc) if(ENABLE_INSTALLATION) - install(FILES LICENSE - COMPONENT runtime - TYPE DOC) + install(FILES LICENSE COMPONENT runtime TYPE DOC) include(CMakePackageConfigHelpers) configure_package_config_file( - ${PROJECT_NAME}Config.cmake.in ${PROJECT_NAME}Config.cmake + ${PROJECT_NAME}Config.cmake.in + ${PROJECT_NAME}Config.cmake INSTALL_DESTINATION ${RVO_DIR} - PATH_VARS RVO_INCLUDE_DIR RVO_LIBRARY_DIR) - - write_basic_package_version_file(${PROJECT_NAME}ConfigVersion.cmake - COMPATIBILITY SameMajorVersion) - - install(FILES - "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" - "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" + PATH_VARS RVO_INCLUDE_DIR RVO_LIBRARY_DIR + ) + + write_basic_package_version_file( + ${PROJECT_NAME}ConfigVersion.cmake + COMPATIBILITY SameMajorVersion + ) + + install( + FILES + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" COMPONENT development - DESTINATION ${RVO_DIR}) + DESTINATION ${RVO_DIR} + ) find_package(PkgConfig MODULE) if(PkgConfig_FOUND) configure_file(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" + install( + FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" COMPONENT development - DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig + ) endif() endif() @@ -333,9 +394,16 @@ if(ENABLE_PACKAGING) set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") set(CPACK_STRIP_FILES ON) - set(CPACK_SOURCE_IGNORE_FILES - _build/ \\\\.git/ \\\\.gitattributes \\\\.github/ \\\\.gitignore bazel- - Brewfile) + set( + CPACK_SOURCE_IGNORE_FILES + _build/ + \\\\.git/ + \\\\.gitattributes + \\\\.github/ + \\\\.gitignore + bazel- + Brewfile + ) set(CPACK_SOURCE_STRIP_FILES ON) set(CPACK_DEBIAN_COMPRESSION_TYPE zstd) diff --git a/CMakePresets.json b/CMakePresets.json index 3c468d69..dd71b5c6 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -1,5 +1,6 @@ { - "version": 6, + "$schema": "https://raw.githubusercontent.com/Kitware/CMake/master/Help/manual/presets/schema.json", + "version": 8, "cmakeMinimumRequired": { "major": 3, "minor": 26, diff --git a/Dockerfile b/Dockerfile index ada7b263..700ee676 100644 --- a/Dockerfile +++ b/Dockerfile @@ -112,9 +112,13 @@ RUN export DEBIAN_FRONTEND=noninteractive \ && curl -fsSL \ https://github.com/bazelbuild/buildtools/releases/latest/download/buildozer-linux-${TARGETARCH:-amd64} \ -o /usr/local/bin/buildozer \ + && curl -fsSL \ + "https://github.com/hadolint/hadolint/releases/latest/download/hadolint-Linux-$([ "${TARGETARCH:-amd64}" = amd64 ] && echo x86_64 || echo "${TARGETARCH:-amd64}")" \ + -o /usr/local/bin/hadolint \ && chmod +x \ /usr/local/bin/buildifier \ /usr/local/bin/buildozer \ + /usr/local/bin/hadolint \ && curl -fsSL \ https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash \ | bash -s -- '' /usr/local/bin \ @@ -122,6 +126,8 @@ RUN export DEBIAN_FRONTEND=noninteractive \ && . /home/ubuntu/.venv/bin/activate \ && pip install --no-cache-dir -qq \ cffconvert \ + check-jsonschema \ + detect-secrets \ lizard \ pre-commit \ && echo "ubuntu ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/ubuntu \ diff --git a/QUALITY_DECLARATION.md b/QUALITY_DECLARATION.md index 1172960f..c84f6b8a 100644 --- a/QUALITY_DECLARATION.md +++ b/QUALITY_DECLARATION.md @@ -115,23 +115,72 @@ maintainer [@snape](https://github.com/snape) before merging. ### Continuous Integration [2.iv] CI is performed via GitHub Actions on every push and pull request to `main`, -and on a daily schedule: - -- [`.github/workflows/ci.yml`](.github/workflows/ci.yml): builds and tests - with CMake and Bazel on AlmaLinux, Alpine Linux, Arch Linux, Fedora, - openSUSE, and Ubuntu (amd64 and arm64), macOS (arm64 and x86_64), and - Windows (amd64 and arm64). - CMake builds enable `BUILD_TESTING`, `ENABLE_HARDENING`, +and on a daily or weekly schedule: + +- [`.github/workflows/actionlint.yml`](.github/workflows/actionlint.yml): + validates GitHub Actions workflow files with actionlint. +- [`.github/workflows/bazel.yml`](.github/workflows/bazel.yml): builds and + tests with Bazel on AlmaLinux, Alpine Linux, Arch Linux, Fedora, openSUSE, + and Ubuntu (amd64 and arm64), macOS (arm64 and x86_64), and Windows + (amd64 and arm64). +- [`.github/workflows/buildifier.yml`](.github/workflows/buildifier.yml): + enforces Bazel file formatting with buildifier. +- [`.github/workflows/check-jsonschema.yml`](.github/workflows/check-jsonschema.yml): + validates [`compose.yaml`](compose.yaml) and [`renovate.json`](renovate.json) + against their respective schemas. +- [`.github/workflows/clang-format.yml`](.github/workflows/clang-format.yml): + enforces code formatting via clang-format. +- [`.github/workflows/clang-tidy.yml`](.github/workflows/clang-tidy.yml): + runs clang-tidy static analysis with warnings as errors. +- [`.github/workflows/cmake.yml`](.github/workflows/cmake.yml): builds and + tests with CMake on AlmaLinux, Alpine Linux, Arch Linux, Fedora, openSUSE + Leap, Ubuntu (amd64 and arm64), macOS (arm64 and x86_64), and Windows + (amd64 and arm64), enabling `BUILD_TESTING`, `ENABLE_HARDENING`, `ENABLE_INTERPROCEDURAL_OPTIMIZATION`, `ENABLE_OPENMP`, and `WARNINGS_AS_ERRORS`. -- [`.github/workflows/meson.yml`](.github/workflows/meson.yml): builds and - tests with Meson on AlmaLinux, Arch Linux, Fedora, openSUSE, and Ubuntu - (amd64 and arm64), Alpine Linux, macOS (arm64 and x86_64), and Windows - (amd64 and arm64). Meson - builds enable LTO (`-Db_lto=true`), `openmp`, and `werror`. - [`.github/workflows/codeql.yml`](.github/workflows/codeql.yml): runs GitHub - CodeQL semantic code analysis for C++ on every push, pull request, and on - a weekly schedule. + CodeQL semantic code analysis for C++ on a weekly schedule. +- [`.github/workflows/codespell.yml`](.github/workflows/codespell.yml): + checks spelling in source files and documentation with codespell. +- [`.github/workflows/coverage.yml`](.github/workflows/coverage.yml): + measures code coverage with gcovr on Debian (amd64 and arm64), publishes + an XML report, and uploads results to DeepSource on each push to `main`. +- [`.github/workflows/cppcheck.yml`](.github/workflows/cppcheck.yml): runs + cppcheck static analysis with all checks enabled and suppressions configured + via [`.cppcheck-suppressions.xml`](.cppcheck-suppressions.xml); results are + uploaded to GitHub Code Scanning as SARIF. +- [`.github/workflows/cpplint.yml`](.github/workflows/cpplint.yml): enforces + Google C++ style with cpplint. +- [`.github/workflows/detect-secrets.yml`](.github/workflows/detect-secrets.yml): + scans for accidentally committed secrets against a maintained baseline. +- [`.github/workflows/docker.yml`](.github/workflows/docker.yml): builds the + development environment Docker image for amd64 and arm64 on a weekly + schedule. +- [`.github/workflows/gersemi.yml`](.github/workflows/gersemi.yml): enforces + CMake file formatting with gersemi. +- [`.github/workflows/hadolint.yml`](.github/workflows/hadolint.yml): lints + the Dockerfile with hadolint. +- [`.github/workflows/iwyu.yml`](.github/workflows/iwyu.yml): checks include + hygiene with include-what-you-use. +- [`.github/workflows/lizard.yml`](.github/workflows/lizard.yml): measures + cyclomatic complexity with lizard. +- [`.github/workflows/meson.yml`](.github/workflows/meson.yml): builds and + tests with Meson on AlmaLinux, Alpine Linux, Arch Linux, Fedora, openSUSE + Leap, Ubuntu (amd64 and arm64), macOS (arm64 and x86_64), and Windows + (amd64 and arm64), enabling `hardening`, `openmp`, and `werror`. +- [`.github/workflows/meson-format.yml`](.github/workflows/meson-format.yml): + enforces Meson build file formatting with `meson format`. +- [`.github/workflows/reuse.yml`](.github/workflows/reuse.yml): verifies + REUSE license compliance. +- [`.github/workflows/sanitizer.yml`](.github/workflows/sanitizer.yml): + builds and tests with AddressSanitizer, ThreadSanitizer, and + UndefinedBehaviorSanitizer on Debian (amd64 and arm64). +- [`.github/workflows/valgrind.yml`](.github/workflows/valgrind.yml): runs + tests under Valgrind for memory error detection on Debian (amd64 and arm64). +- [`.github/workflows/validate-cff.yml`](.github/workflows/validate-cff.yml): + validates [`CITATION.cff`](CITATION.cff) against the CFF schema. +- [`.github/workflows/yamllint.yml`](.github/workflows/yamllint.yml): lints + all YAML files with yamllint. ### Documentation Policy [2.v] @@ -167,14 +216,15 @@ Public License. The project uses the [REUSE Specification](https://reuse.software/) for license compliance. Every source file contains machine-readable SPDX license and copyright headers, and license texts are provided in the [`LICENSES/`](LICENSES/) -directory. License compliance is verified by the `reuse` pre-commit hook. +directory. License compliance is verified by the `reuse` pre-commit hook and +by the [`.github/workflows/reuse.yml`](.github/workflows/reuse.yml) CI job. ### Copyright Statement [3.iv] Copyright is held by the University of North Carolina at Chapel Hill. All source files include the SPDX copyright notice: -``` +```text SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill ``` @@ -209,10 +259,13 @@ individual API functions are not currently present. ### Coverage [4.iii] -Code coverage is not currently tracked. The three simulation scenarios provide -broad functional coverage of the library, but no formal coverage measurement -or policy is in place. This is a known gap relative to Quality Level 2 -requirements. +Code coverage is measured in CI using `gcovr` via +[`.github/workflows/coverage.yml`](.github/workflows/coverage.yml), which +builds with `-Db_coverage=true` on Debian (amd64 and arm64) and produces an +XML report. Coverage results are uploaded to +[DeepSource](https://deepsource.com/) on each push to `main`. The three +simulation scenarios provide broad functional coverage of the library, but no +minimum coverage threshold is currently enforced. ### Performance [4.iv] @@ -223,23 +276,65 @@ processing), but no automated performance benchmarks are run in CI. ### Linters and Static Analysis [4.v] -The following linters and static analysis tools are enforced, with all warnings -treated as errors in CI: +The following formatters and linters are enforced in CI: +- **actionlint**: GitHub Actions workflow validation via + [`.github/workflows/actionlint.yml`](.github/workflows/actionlint.yml) +- **buildifier**: Bazel file formatting via [`.buildifier.json`](.buildifier.json) + and [`.github/workflows/buildifier.yml`](.github/workflows/buildifier.yml) +- **check-jsonschema**: JSON schema validation of `compose.yaml` and + `renovate.json` via + [`.github/workflows/check-jsonschema.yml`](.github/workflows/check-jsonschema.yml) - **clang-format**: code formatting enforced via [`.clang-format`](.clang-format) (Google style with `PointerAlignment: Right`) +- **codespell**: spell checking via + [`.github/workflows/codespell.yml`](.github/workflows/codespell.yml) +- **cpplint**: Google C++ style enforcement via [`CPPLINT.cfg`](CPPLINT.cfg) + and [`.github/workflows/cpplint.yml`](.github/workflows/cpplint.yml) +- **detect-secrets**: secret scanning against a maintained baseline via + [`.secrets.baseline`](.secrets.baseline) and + [`.github/workflows/detect-secrets.yml`](.github/workflows/detect-secrets.yml) +- **gersemi**: CMake file formatting via [`.gersemirc`](.gersemirc) and + [`.github/workflows/gersemi.yml`](.github/workflows/gersemi.yml) +- **hadolint**: Dockerfile linting via [`.hadolint.yaml`](.hadolint.yaml) and + [`.github/workflows/hadolint.yml`](.github/workflows/hadolint.yml) +- **meson format**: Meson build file formatting enforced via + [`.github/workflows/meson-format.yml`](.github/workflows/meson-format.yml) +- **validate-cff**: CFF schema validation via + [`.github/workflows/validate-cff.yml`](.github/workflows/validate-cff.yml) +- **yamllint**: YAML file linting via + [`.github/workflows/yamllint.yml`](.github/workflows/yamllint.yml) and + [`.yamllint.yaml`](.yamllint.yaml) +- **pre-commit hooks**: `codespell` (spell checking), `yamllint`, `actionlint` + (workflow validation), REUSE compliance, case-conflict, JSON, YAML, and + merge-conflict detection, end-of-file and trailing-whitespace normalization + via [`.pre-commit-config.yaml`](.pre-commit-config.yaml) + +The following static analysis tools are enforced in CI: + - **clang-tidy**: static analysis via [`.clang-tidy`](.clang-tidy), enabling `bugprone-*`, `cert-*`, `clang-analyzer-*`, `cppcoreguidelines-*`, `google-*`, `performance-*`, `portability-*`, `readability-*`, and `openmp-*` checks, with `WarningsAsErrors: '*'` -- **cpplint**: Google C++ style enforcement via [`CPPLINT.cfg`](CPPLINT.cfg) -- **buildifier**: Bazel file formatting via [`.buildifier.json`](.buildifier.json) - **CodeQL**: GitHub's semantic code analysis for C++ via [`.github/workflows/codeql.yml`](.github/workflows/codeql.yml) -- **pre-commit hooks**: `codespell` (spell checking), `yamllint`, `actionlint` - (workflow validation), REUSE compliance, case-conflict, JSON, YAML, and - merge-conflict detection, end-of-file and trailing-whitespace normalization - via [`.pre-commit-config.yaml`](.pre-commit-config.yaml) +- **cppcheck**: static analysis with all checks enabled and suppressions + configured via [`.cppcheck-suppressions.xml`](.cppcheck-suppressions.xml); + results uploaded to GitHub Code Scanning as SARIF +- **include-what-you-use**: include hygiene checked via + [`.iwyu_mappings.imp`](.iwyu_mappings.imp) +- **lizard**: cyclomatic complexity analysis via + [`.github/workflows/lizard.yml`](.github/workflows/lizard.yml) + +The following dynamic analysis tools are run against the test suite in CI: + +- **AddressSanitizer, ThreadSanitizer, UndefinedBehaviorSanitizer**: enabled + via [`.github/workflows/sanitizer.yml`](.github/workflows/sanitizer.yml) + on Debian (amd64 and arm64) with `halt_on_error=1` +- **Valgrind**: memory error detection via + [`.github/workflows/valgrind.yml`](.github/workflows/valgrind.yml) on + Debian (amd64 and arm64) with `--leak-check=full` and + `--errors-for-leak-kinds=definite,indirect` ## Dependencies [5] @@ -264,16 +359,16 @@ None. `RVO2 Library` is built and tested continuously via GitHub Actions on the following platforms: -| Platform | Architecture | Build System | -|----------------|--------------|---------------------| -| AlmaLinux | amd64 | CMake, Bazel, Meson | -| Alpine Linux | amd64 | CMake, Bazel, Meson | -| Arch Linux | amd64 | CMake, Bazel, Meson | -| Fedora | amd64 | CMake, Bazel, Meson | -| openSUSE Leap | amd64 | CMake, Bazel, Meson | -| Ubuntu | amd64, arm64 | CMake, Bazel, Meson | -| macOS | arm64, x86_64 | CMake, Bazel, Meson | -| Windows | amd64, arm64 | CMake, Bazel, Meson | +| Platform | Architecture | Build System | +|----------------|---------------|---------------------| +| AlmaLinux | amd64 | CMake, Bazel, Meson | +| Alpine Linux | amd64 | CMake, Bazel, Meson | +| Arch Linux | amd64 | CMake, Bazel, Meson | +| Fedora | amd64 | CMake, Bazel, Meson | +| openSUSE Leap | amd64 | CMake, Bazel, Meson | +| Ubuntu | amd64, arm64 | CMake, Bazel, Meson | +| macOS | arm64, x86_64 | CMake, Bazel, Meson | +| Windows | amd64, arm64 | CMake, Bazel, Meson | ## Security [7] diff --git a/README.md b/README.md index 42812833..64457a83 100644 --- a/README.md +++ b/README.md @@ -82,8 +82,6 @@ simulation is fully accessible and manipulable during runtime. The library exploits multiple processors if they are available using OpenMP for efficient parallelization of the simulation. -![Build Status](https://github.com/snape/RVO2/actions/workflows/ci.yml/badge.svg?branch=main) - SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill SPDX-License-Identifier: Apache-2.0 diff --git a/compose.yaml b/compose.yaml index 08e57431..be23fbf1 100644 --- a/compose.yaml +++ b/compose.yaml @@ -31,6 +31,8 @@ # # +# yamllint disable-line rule:line-length +# yaml-language-server: $schema=https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json --- services: dev: diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 36e61ed1..a67ead32 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -39,8 +39,11 @@ if(BUILD_DOCUMENTATION AND Doxygen_FOUND) set(DOXYGEN_PROJECT_NUMBER ${PROJECT_VERSION}) set(DOXYGEN_PROJECT_BRIEF "${PROJECT_DESCRIPTION}") - set(DOXYGEN_STRIP_FROM_PATH - "${PROJECT_BINARY_DIR}/src" "${PROJECT_SOURCE_DIR}/src") + set( + DOXYGEN_STRIP_FROM_PATH + "${PROJECT_BINARY_DIR}/src" + "${PROJECT_SOURCE_DIR}/src" + ) set(DOXYGEN_BUILTIN_STL_SUPPORT YES) set(DOXYGEN_EXTRACT_ALL YES) @@ -51,25 +54,31 @@ if(BUILD_DOCUMENTATION AND Doxygen_FOUND) set(DOXYGEN_HTML_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/header.html") set(DOXYGEN_HTML_FOOTER "${CMAKE_CURRENT_SOURCE_DIR}/footer.html") - set(DOXYGEN_HTML_EXTRA_STYLESHEET - "${CMAKE_CURRENT_SOURCE_DIR}/stylesheet.css") + set( + DOXYGEN_HTML_EXTRA_STYLESHEET + "${CMAKE_CURRENT_SOURCE_DIR}/stylesheet.css" + ) set(DOXYGEN_SEARCHENGINE NO) set(DOXYGEN_DOT_IMAGE_FORMAT svg) set(DOXYGEN_INTERACTIVE_SVG YES) - doxygen_add_docs(documentation + doxygen_add_docs( + documentation "${PROJECT_BINARY_DIR}/src/Export.h" "${PROJECT_SOURCE_DIR}/src/Line.h" "${PROJECT_SOURCE_DIR}/src/RVO.h" "${PROJECT_SOURCE_DIR}/src/RVOSimulator.h" "${PROJECT_SOURCE_DIR}/src/Vector2.h" ALL - USE_STAMP_FILE) + USE_STAMP_FILE + ) if(ENABLE_INSTALLATION) - install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html" + install( + DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html" COMPONENT documentation - TYPE DOC) + TYPE DOC + ) endif() endif() diff --git a/examples/Blocks.cc b/examples/Blocks.cc index 7f3ff9b3..528cd990 100644 --- a/examples/Blocks.cc +++ b/examples/Blocks.cc @@ -174,12 +174,14 @@ void setPreferredVelocities(RVO::RVOSimulator *simulator, } simulator->setAgentPrefVelocity(i, goalVector); + } + for (std::size_t i = 0U; i < simulator->getNumAgents(); ++i) { /* Perturb a little to avoid deadlocks due to perfect symmetry. */ - float angle = static_cast(std::rand()) * RVO_TWO_PI / - static_cast(RAND_MAX); - float dist = static_cast(std::rand()) * 0.0001F / - static_cast(RAND_MAX); + const float angle = static_cast(std::rand()) * RVO_TWO_PI / + static_cast(RAND_MAX); + const float dist = static_cast(std::rand()) * 0.0001F / + static_cast(RAND_MAX); simulator->setAgentPrefVelocity( i, simulator->getAgentPrefVelocity(i) + @@ -187,7 +189,7 @@ void setPreferredVelocities(RVO::RVOSimulator *simulator, } } -bool reachedGoal(RVO::RVOSimulator *simulator, +bool reachedGoal(const RVO::RVOSimulator *simulator, const std::vector &goals) { /* Check if all agents have reached their goals. */ for (std::size_t i = 0U; i < simulator->getNumAgents(); ++i) { diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index e0076f84..8303ef7d 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -48,15 +48,21 @@ if(BUILD_EXAMPLES) option(SEED_RANDOM_NUMBER_GENERATOR "Seed random number generator" ON) if(SEED_RANDOM_NUMBER_GENERATOR) - list(APPEND RVO_EXAMPLES_COMPILE_DEFINITIONS - RVO_SEED_RANDOM_NUMBER_GENERATOR=1) + list( + APPEND RVO_EXAMPLES_COMPILE_DEFINITIONS + RVO_SEED_RANDOM_NUMBER_GENERATOR=1 + ) else() - list(APPEND RVO_EXAMPLES_COMPILE_DEFINITIONS - RVO_SEED_RANDOM_NUMBER_GENERATOR=0) + list( + APPEND RVO_EXAMPLES_COMPILE_DEFINITIONS + RVO_SEED_RANDOM_NUMBER_GENERATOR=0 + ) endif() - if(ENABLE_INTERPROCEDURAL_OPTIMIZATION - AND RVO_INTERPROCEDURAL_OPTIMIZATION_SUPPORTED) + if( + ENABLE_INTERPROCEDURAL_OPTIMIZATION + AND RVO_INTERPROCEDURAL_OPTIMIZATION_SUPPORTED + ) set(RVO_EXAMPLES_INTERPROCEDURAL_OPTIMIZATION ON) else() set(RVO_EXAMPLES_INTERPROCEDURAL_OPTIMIZATION OFF) @@ -66,56 +72,56 @@ if(BUILD_EXAMPLES) check_pie_supported() add_executable(Blocks Blocks.cc) - target_compile_definitions(Blocks PRIVATE - ${RVO_EXAMPLES_COMPILE_DEFINITIONS}) + target_compile_definitions(Blocks PRIVATE ${RVO_EXAMPLES_COMPILE_DEFINITIONS}) target_link_libraries(Blocks PRIVATE ${RVO_LIBRARY}) if(ENABLE_OPENMP AND OpenMP_FOUND) target_link_libraries(Blocks PRIVATE OpenMP::OpenMP_CXX) endif() - set_target_properties(Blocks PROPERTIES - INTERPROCEDURAL_OPTIMIZATION ${RVO_EXAMPLES_INTERPROCEDURAL_OPTIMIZATION}) + set_target_properties( + Blocks + PROPERTIES + INTERPROCEDURAL_OPTIMIZATION ${RVO_EXAMPLES_INTERPROCEDURAL_OPTIMIZATION} + ) if(CMAKE_VERSION VERSION_GREATER_EQUAL 4.1) - set_target_properties(Blocks PROPERTIES - SPDX_LICENSE Apache-2.0) + set_target_properties(Blocks PROPERTIES SPDX_LICENSE Apache-2.0) endif() add_test(NAME Blocks COMMAND Blocks) - set_tests_properties(Blocks PROPERTIES - LABELS medium - TIMEOUT 60) + set_tests_properties(Blocks PROPERTIES LABELS medium TIMEOUT 60) add_executable(Circle Circle.cc) - target_compile_definitions(Circle PRIVATE - ${RVO_EXAMPLES_COMPILE_DEFINITIONS}) + target_compile_definitions(Circle PRIVATE ${RVO_EXAMPLES_COMPILE_DEFINITIONS}) target_link_libraries(Circle PRIVATE ${RVO_LIBRARY}) if(ENABLE_OPENMP AND OpenMP_FOUND) target_link_libraries(Circle PRIVATE OpenMP::OpenMP_CXX) endif() - set_target_properties(Circle PROPERTIES - INTERPROCEDURAL_OPTIMIZATION ${RVO_EXAMPLES_INTERPROCEDURAL_OPTIMIZATION}) + set_target_properties( + Circle + PROPERTIES + INTERPROCEDURAL_OPTIMIZATION ${RVO_EXAMPLES_INTERPROCEDURAL_OPTIMIZATION} + ) if(CMAKE_VERSION VERSION_GREATER_EQUAL 4.1) - set_target_properties(Circle PROPERTIES - SPDX_LICENSE Apache-2.0) + set_target_properties(Circle PROPERTIES SPDX_LICENSE Apache-2.0) endif() add_test(NAME Circle COMMAND Circle) - set_tests_properties(Circle PROPERTIES - LABELS medium - TIMEOUT 60) + set_tests_properties(Circle PROPERTIES LABELS medium TIMEOUT 60) add_executable(Roadmap Roadmap.cc) - target_compile_definitions(Roadmap PRIVATE - ${RVO_EXAMPLES_COMPILE_DEFINITIONS}) + target_compile_definitions( + Roadmap + PRIVATE ${RVO_EXAMPLES_COMPILE_DEFINITIONS} + ) target_link_libraries(Roadmap PRIVATE ${RVO_LIBRARY}) if(ENABLE_OPENMP AND OpenMP_FOUND) target_link_libraries(Roadmap PRIVATE OpenMP::OpenMP_CXX) endif() - set_target_properties(Roadmap PROPERTIES - INTERPROCEDURAL_OPTIMIZATION ${RVO_EXAMPLES_INTERPROCEDURAL_OPTIMIZATION}) + set_target_properties( + Roadmap + PROPERTIES + INTERPROCEDURAL_OPTIMIZATION ${RVO_EXAMPLES_INTERPROCEDURAL_OPTIMIZATION} + ) if(CMAKE_VERSION VERSION_GREATER_EQUAL 4.1) - set_target_properties(Roadmap PROPERTIES - SPDX_LICENSE Apache-2.0) + set_target_properties(Roadmap PROPERTIES SPDX_LICENSE Apache-2.0) endif() add_test(NAME Roadmap COMMAND Roadmap) - set_tests_properties(Roadmap PROPERTIES - LABELS medium - TIMEOUT 60) + set_tests_properties(Roadmap PROPERTIES LABELS medium TIMEOUT 60) endif() diff --git a/examples/Circle.cc b/examples/Circle.cc index 0b739f19..afaf5bdc 100644 --- a/examples/Circle.cc +++ b/examples/Circle.cc @@ -111,7 +111,7 @@ void setPreferredVelocities(RVO::RVOSimulator *simulator, } } -bool reachedGoal(RVO::RVOSimulator *simulator, +bool reachedGoal(const RVO::RVOSimulator *simulator, const std::vector &goals) { /* Check if all agents have reached their goals. */ for (std::size_t i = 0U; i < simulator->getNumAgents(); ++i) { diff --git a/examples/Roadmap.cc b/examples/Roadmap.cc index 30f6f6f6..85c6b60a 100644 --- a/examples/Roadmap.cc +++ b/examples/Roadmap.cc @@ -83,7 +83,7 @@ class RoadmapVertex { void setupScenario( RVO::RVOSimulator *simulator, std::vector &roadmap, /* NOLINT(runtime/references) */ - std::vector &goals) { /* NOLINT(runtime/references) */ + std::vector &goals) { /* NOLINT(runtime/references) */ #if RVO_SEED_RANDOM_NUMBER_GENERATOR std::srand(static_cast(std::time(NULL))); #endif /* RVO_SEED_RANDOM_NUMBER_GENERATOR */ @@ -214,7 +214,7 @@ void updateVisualization(RVO::RVOSimulator *simulator) { #endif /* RVO_OUTPUT_TIME_AND_POSITIONS */ void buildRoadmap( - RVO::RVOSimulator *simulator, + const RVO::RVOSimulator *simulator, std::vector &roadmap) { /* NOLINT(runtime/references) */ /* Connect the roadmap vertices by edges if mutually visible. */ #ifdef _OPENMP @@ -239,8 +239,8 @@ void buildRoadmap( #endif /* _OPENMP */ for (std::size_t i = 0U; i < 4U; ++i) { std::multimap Q; - std::vector::iterator> posInQ(roadmap.size(), - Q.end()); + std::vector::iterator> posInQ( + roadmap.size(), Q.end()); roadmap[i].distToGoal[i] = 0.0F; posInQ[i] = Q.insert(std::make_pair(0.0F, i)); @@ -316,12 +316,14 @@ void setPreferredVelocities(RVO::RVOSimulator *simulator, simulator->getAgentPosition(i))); } } + } + for (std::size_t i = 0U; i < simulator->getNumAgents(); ++i) { /* Perturb a little to avoid deadlocks due to perfect symmetry. */ - float angle = static_cast(std::rand()) * RVO_TWO_PI / - static_cast(RAND_MAX); - float dist = static_cast(std::rand()) * 0.0001F / - static_cast(RAND_MAX); + const float angle = static_cast(std::rand()) * RVO_TWO_PI / + static_cast(RAND_MAX); + const float dist = static_cast(std::rand()) * 0.0001F / + static_cast(RAND_MAX); simulator->setAgentPrefVelocity( i, simulator->getAgentPrefVelocity(i) + @@ -329,7 +331,7 @@ void setPreferredVelocities(RVO::RVOSimulator *simulator, } } -bool reachedGoal(RVO::RVOSimulator *simulator, +bool reachedGoal(const RVO::RVOSimulator *simulator, const std::vector &roadmap, const std::vector &goals) { /* Check if all agents have reached their goals. */ diff --git a/examples/meson.build b/examples/meson.build index 1b35c277..7bf078de 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -53,11 +53,5 @@ foreach name : ['Blocks', 'Circle', 'Roadmap'] install: false, ) - test( - name, - exe, - is_parallel: false, - suite: 'examples', - timeout: 60, - ) + test(name, exe, is_parallel: false, suite: 'examples', timeout: 60) endforeach diff --git a/include-what-you-use.imp b/include-what-you-use.imp deleted file mode 100644 index 756d5da4..00000000 --- a/include-what-you-use.imp +++ /dev/null @@ -1,8 +0,0 @@ -[ - { - "include": ["@<__algorithm/.*>", "private", "", "public"] - }, - { - "include": ["@<__utility/.*>", "private", "", "public"] - } -] diff --git a/meson.build b/meson.build index 51d6c524..c01eb5c6 100644 --- a/meson.build +++ b/meson.build @@ -79,15 +79,23 @@ optimized_build = not get_option('debug') and get_option('optimization') != '0' if is_msvc hardening_compile_flags += cpp_compiler.get_supported_arguments('/GS') - if cpp_compiler.has_argument('/guard:cf') and cpp_compiler.has_link_argument('/DYNAMICBASE') and cpp_compiler.has_link_argument('/GUARD:CF') + if cpp_compiler.has_argument('/guard:cf') and cpp_compiler.has_link_argument( + '/DYNAMICBASE', + ) and cpp_compiler.has_link_argument( + '/GUARD:CF', + ) hardening_compile_flags += ['/guard:cf'] hardening_link_flags += ['/DYNAMICBASE', '/GUARD:CF'] endif - hardening_link_flags += cpp_compiler.get_supported_link_arguments('/NXCOMPAT') + hardening_link_flags += cpp_compiler.get_supported_link_arguments( + '/NXCOMPAT', + ) else if optimized_build - hardening_compile_flags += cpp_compiler.get_supported_arguments('-D_FORTIFY_SOURCE=2') + hardening_compile_flags += cpp_compiler.get_supported_arguments( + '-D_FORTIFY_SOURCE=2', + ) endif hardening_compile_flags += cpp_compiler.get_supported_arguments( @@ -103,7 +111,9 @@ else endif if optimized_build - if cpp_compiler.has_argument('-fsanitize=safe-stack') and cpp_compiler.has_link_argument('-fsanitize=safe-stack') + if cpp_compiler.has_argument('-fsanitize=safe-stack') and cpp_compiler.has_link_argument( + '-fsanitize=safe-stack', + ) hardening_compile_flags += ['-fsanitize=safe-stack'] hardening_link_flags += ['-fsanitize=safe-stack'] endif @@ -147,7 +157,11 @@ if host_os == 'windows' and get_option('default_library') == 'shared' endif examples_opt = get_option('examples') -examples_enabled = not (examples_opt.disabled() or (examples_opt.auto() and meson.is_subproject())) +examples_enabled = not ( + examples_opt.disabled() + or (examples_opt.auto() + and meson.is_subproject()) +) # ---- Subdirectories ---------------------------------------------------------- diff --git a/requirements.txt b/requirements.txt index d482fd6b..e0fa513d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -31,7 +31,12 @@ # # -cffconvert -cmakelang -cpplint -reuse +cffconvert==2.0.0 +check-jsonschema==0.13.0 +codespell==2.4.2 +cpplint==2.0.2 +detect-secrets==1.5.0 +gersemi==0.27.6 +lizard==1.22.2 +reuse==6.2.0 +yamllint==1.38.0 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7cae7b35..511fff68 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -38,47 +38,52 @@ add_library(${RVO_LIBRARY}) include(GenerateExportHeader) -generate_export_header(${RVO_LIBRARY} - EXPORT_FILE_NAME Export.h) +generate_export_header(${RVO_LIBRARY} EXPORT_FILE_NAME Export.h) -target_sources(${RVO_LIBRARY} +target_sources( + ${RVO_LIBRARY} PUBLIC FILE_SET HEADERS - BASE_DIRS - "${CMAKE_CURRENT_BINARY_DIR}" - "${CMAKE_CURRENT_SOURCE_DIR}" - FILES - "${CMAKE_CURRENT_BINARY_DIR}/Export.h" - Line.h - RVO.h - RVOSimulator.h - Vector2.h - PRIVATE - Agent.cc - Agent.h - KdTree.cc - KdTree.h - Line.cc - Obstacle.cc - Obstacle.h - RVOSimulator.cc - Vector2.cc) - -set_target_properties(${RVO_LIBRARY} PROPERTIES - CXX_VISIBILITY_PRESET hidden - SOVERSION ${PROJECT_VERSION_MAJOR} - VERSION ${PROJECT_VERSION} - VISIBILITY_INLINES_HIDDEN ON) - -if(ENABLE_INTERPROCEDURAL_OPTIMIZATION - AND RVO_INTERPROCEDURAL_OPTIMIZATION_SUPPORTED) - set_target_properties(${RVO_LIBRARY} PROPERTIES - INTERPROCEDURAL_OPTIMIZATION ON) + BASE_DIRS "${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}" + FILES + "${CMAKE_CURRENT_BINARY_DIR}/Export.h" + Line.h + RVO.h + RVOSimulator.h + Vector2.h + PRIVATE + Agent.cc + Agent.h + KdTree.cc + KdTree.h + Line.cc + Obstacle.cc + Obstacle.h + RVOSimulator.cc + Vector2.cc +) + +set_target_properties( + ${RVO_LIBRARY} + PROPERTIES + CXX_VISIBILITY_PRESET hidden + SOVERSION ${PROJECT_VERSION_MAJOR} + VERSION ${PROJECT_VERSION} + VISIBILITY_INLINES_HIDDEN ON +) + +if( + ENABLE_INTERPROCEDURAL_OPTIMIZATION + AND RVO_INTERPROCEDURAL_OPTIMIZATION_SUPPORTED +) + set_target_properties( + ${RVO_LIBRARY} + PROPERTIES INTERPROCEDURAL_OPTIMIZATION ON + ) endif() if(CMAKE_VERSION VERSION_GREATER_EQUAL 4.1) - set_target_properties(${RVO_LIBRARY} PROPERTIES - SPDX_LICENSE Apache-2.0) + set_target_properties(${RVO_LIBRARY} PROPERTIES SPDX_LICENSE Apache-2.0) endif() if(WIN32) @@ -91,59 +96,69 @@ endif() add_library(${PROJECT_NAME}::${RVO_LIBRARY} ALIAS ${RVO_LIBRARY}) -export(TARGETS ${RVO_LIBRARY} NAMESPACE ${PROJECT_NAME}:: - FILE "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake") +export( + TARGETS ${RVO_LIBRARY} + NAMESPACE ${PROJECT_NAME}:: + FILE "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake" +) if(ENABLE_INSTALLATION) - install(TARGETS ${RVO_LIBRARY} + install( + TARGETS ${RVO_LIBRARY} + EXPORT ${PROJECT_NAME}Targets + ARCHIVE COMPONENT development + FILE_SET HEADERS COMPONENT development DESTINATION ${RVO_INCLUDE_DIR} + LIBRARY COMPONENT runtime NAMELINK_COMPONENT development + RUNTIME COMPONENT runtime + INCLUDES DESTINATION ${RVO_INCLUDE_DIR} + ) + + install( EXPORT ${PROJECT_NAME}Targets - ARCHIVE - COMPONENT development - FILE_SET HEADERS - COMPONENT development - DESTINATION ${RVO_INCLUDE_DIR} - LIBRARY - COMPONENT runtime - NAMELINK_COMPONENT development - RUNTIME - COMPONENT runtime - INCLUDES DESTINATION ${RVO_INCLUDE_DIR}) - - install(EXPORT ${PROJECT_NAME}Targets COMPONENT development DESTINATION ${RVO_DIR} - NAMESPACE ${PROJECT_NAME}::) + NAMESPACE ${PROJECT_NAME}:: + ) if(CMAKE_VERSION VERSION_GREATER_EQUAL 4.3) - install(PACKAGE_INFO ${RVO_LIBRARY} + install( + PACKAGE_INFO ${RVO_LIBRARY} EXPORT ${PROJECT_NAME}Targets COMPONENT development VERSION ${PROJECT_VERSION} - COMPAT_VERSION ${PROJECT_VERSION_MAJOR} - VERSION_SCHEMA simple + COMPAT_VERSION ${PROJECT_VERSION_MAJOR} + VERSION_SCHEMA simple DEFAULT_TARGETS ${RVO_LIBRARY} - LICENSE Apache-2.0) + LICENSE Apache-2.0 + ) - export(PACKAGE_INFO ${RVO_LIBRARY} + export( + PACKAGE_INFO ${RVO_LIBRARY} EXPORT ${PROJECT_NAME}Targets VERSION ${PROJECT_VERSION} - COMPAT_VERSION ${PROJECT_VERSION_MAJOR} - VERSION_SCHEMA simple + COMPAT_VERSION ${PROJECT_VERSION_MAJOR} + VERSION_SCHEMA simple DEFAULT_TARGETS ${RVO_LIBRARY} - LICENSE Apache-2.0) + LICENSE Apache-2.0 + ) if(ENABLE_CMAKE_EXPERIMENTAL_FEATURES) - set(CMAKE_EXPERIMENTAL_GENERATE_SBOM - ca494ed3-b261-4205-a01f-603c95e4cae0) + set(CMAKE_EXPERIMENTAL_GENERATE_SBOM ca494ed3-b261-4205-a01f-603c95e4cae0) - install(SBOM ${RVO_LIBRARY} + install( + SBOM + ${RVO_LIBRARY} EXPORT ${PROJECT_NAME}Targets COMPONENT development - LICENSE Apache-2.0) + LICENSE + Apache-2.0 + ) - export(SBOM ${RVO_LIBRARY} + export( + SBOM ${RVO_LIBRARY} EXPORT ${PROJECT_NAME}Targets - LICENSE Apache-2.0) + LICENSE Apache-2.0 + ) endif() endif() endif() diff --git a/src/Export.h b/src/Export.h index 0e48d175..c5c22ab7 100644 --- a/src/Export.h +++ b/src/Export.h @@ -35,17 +35,17 @@ #define RVO_EXPORT_H_ #ifdef RVO_STATIC_DEFINE -# define RVO_EXPORT +#define RVO_EXPORT #else -# ifdef _WIN32 -# ifdef RVO_EXPORTS -# define RVO_EXPORT __declspec(dllexport) -# else -# define RVO_EXPORT __declspec(dllimport) -# endif -# else -# define RVO_EXPORT __attribute__((visibility("default"))) -# endif +#ifdef _WIN32 +#ifdef RVO_EXPORTS +#define RVO_EXPORT __declspec(dllexport) +#else +#define RVO_EXPORT __declspec(dllimport) +#endif +#else +#define RVO_EXPORT __attribute__((visibility("default"))) +#endif #endif #endif /* RVO_EXPORT_H_ */ diff --git a/src/KdTree.cc b/src/KdTree.cc index d1d4f018..dacf74f2 100644 --- a/src/KdTree.cc +++ b/src/KdTree.cc @@ -229,7 +229,6 @@ void KdTree::buildAgentTreeRecursive(std::size_t begin, std::size_t end, if (left == begin) { ++left; - ++right; } agentTree_[node].left = node + 1U; diff --git a/src/meson.build b/src/meson.build index 994874a6..fb917982 100644 --- a/src/meson.build +++ b/src/meson.build @@ -67,7 +67,9 @@ default_library = get_option('default_library') # Keep inline-visibility tightening on the library target only: this is part of # the exported ABI/symbol policy for RVO itself, not a project-wide policy that # needs to affect example executables. -compile_args += cpp_compiler.get_supported_arguments('-fvisibility-inlines-hidden') +compile_args += cpp_compiler.get_supported_arguments( + '-fvisibility-inlines-hidden', +) if host_os == 'windows' compile_args += ['-DNOMINMAX'] @@ -115,10 +117,7 @@ dep_rvo = declare_dependency( meson.override_dependency('rvo', dep_rvo) if not meson.is_subproject() - install_headers( - public_headers, - subdir: 'RVO', - ) + install_headers(public_headers, subdir: 'RVO') pkgconfig = import('pkgconfig') pkgconfig.generate(