Skip to content

Commit

Permalink
Remove unused libraries from the linking phase
Browse files Browse the repository at this point in the history
Dummy file with errors

Change coverity options
  • Loading branch information
vasil-pashov committed Oct 18, 2024
1 parent 629e63c commit 81cea8e
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 16 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
name: Polaris Coverity Static Analysis
permissions:
packages: write
pull-requests: write
discussions: write
contents: write
runs-on: ubuntu-latest
env:
VCPKG_NUGET_USER: ${{secrets.VCPKG_NUGET_USER || github.repository_owner}}
Expand All @@ -24,7 +27,7 @@
- name: Setup build dependencies
run: |
sudo apt-get update
sudo apt-get install -y gcc-10 g++-10 make mono-complete libtool autoconf-archive autoconf
sudo apt-get install -y gcc-10 g++-10 make mono-complete libkrb5-dev libsasl2-dev
- name: Setup VCPKG cache
run: |
Expand Down Expand Up @@ -55,4 +58,9 @@
coverity_build_command: make -j ${{ steps.cpu-cores.outputs.count }}
coverity_clean_command: make clean
github_token: ${{ secrets.GITHUB_TOKEN }}
project_directory: ${{github.workspace}}/cpp/out/linux-debug-build
project_directory: ${{github.workspace}}/cpp/out/linux-debug-build
include_diagnostics: true
polaris_reports_sarif_create: true
polaris_reports_sarif_groupSCAIssues: true
polaris_upload_sarif_report: true
polaris_prComment_severities: "high,critical,medium,low"
7 changes: 4 additions & 3 deletions cpp/arcticdb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,10 @@ set(arcticdb_srcs
version/version_store_objects.hpp
version/version_utils.hpp
# CPP files

# TODO: Remove used only to test Coverity PR comments
test_coverity_pr_comments.cpp

async/async_store.cpp
async/bit_rate_stats.cpp
async/task_scheduler.cpp
Expand Down Expand Up @@ -998,9 +1002,6 @@ if(${TEST})
GTest::gtest
GTest::gmock
Python::Python # + pybind11::pybind11 (transitively included) = pybind11::embed, but latter is sometimes not found...
curl
krb5support
k5crypto
util # TODO: find out where we lost the transitive link to it
)
if(NOT APPLE)
Expand Down
20 changes: 20 additions & 0 deletions cpp/arcticdb/test_coverity_pr_comments.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <vector>
#include <iostream>

void my_function_with_errors() {
{
std::vector<int> a = { 1, 2, 3 };
auto b = std::move(a);

// Use after move
std::cout << a.size();
}

{
int* b = new int(5);
delete b;

// Use after free
std::cout << *b;
}
}
12 changes: 1 addition & 11 deletions cpp/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,7 @@
"azure-core-cpp",
"azure-identity-cpp",
"azure-storage-blobs-cpp",
"benchmark",
{
"name": "krb5",
"platform": "!windows"
},
{
"name": "cyrus-sasl",
"platform": "!windows"
}
"benchmark"
],
"overrides": [
{ "name": "openssl", "version-string": "3.3.0" },
Expand Down Expand Up @@ -158,14 +150,12 @@
{ "name": "boost-vcpkg-helpers", "version": "1.84.0" },
{ "name": "boost-winapi", "version": "1.84.0" },
{ "name": "curl", "version": "8.4.0" },
{ "name": "cyrus-sasl", "version": "2.1.28#2" },
{ "name": "double-conversion", "version": "3.2.1" },
{ "name": "fmt", "version": "10.2.1" },
{ "name": "folly", "version-string": "2023.09.25.00" },
{ "name": "gflags", "version": "2.2.2#5" },
{ "name": "glog", "version": "0.6.0#2" },
{ "name": "gtest", "version": "1.12.1" },
{ "name": "krb5", "version": "1.21.3#1" },
{ "name": "libbson", "version": "1.28.0" },
{ "name": "libevent", "version": "2.1.12#7" },
{ "name": "libiconv", "version": "1.17#0" },
Expand Down

0 comments on commit 81cea8e

Please sign in to comment.