1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-09-16 09:06:18 +02:00

Remove clang static analysis.

This analysis never produced anything but false positives (var might be NULL) but took over a minute per test run and added 600MB to the test container.
This commit is contained in:
David Steele
2019-07-05 18:34:15 -04:00
parent 488fb67294
commit 5e1ed2e8a5
7 changed files with 12 additions and 52 deletions

View File

@@ -137,7 +137,7 @@ doc/release.pl --deploy
Build to generate files and test documentation:
```
test/test.pl --no-lint --vm=u18 --build-only
test/test.pl --vm=u18 --build-only
```
Commit and push to integration:

View File

@@ -211,7 +211,7 @@ eval
# Generate coverage summmary
&log(INFO, "Generate Coverage Summary");
executeTest(
"${strTestExe} --no-lint --no-package --no-valgrind --no-optimize --vm-max=3 --coverage-summary",
"${strTestExe} --no-package --no-valgrind --no-optimize --vm-max=3 --coverage-summary",
{bShowOutputAsync => true});
}

View File

@@ -13,8 +13,10 @@
# - docker tag pgbackrest/test:{vm}-base pgbackrest/test:{vm}-base-YYYYMMDDA
# - docker push pgbackrest/test:{vm}-base-YYYYMMDDA
# **********************************************************************************************************************************
20190705A:
u18: de2136d4a4ed6a7b8eaf6934c7e6f8e5c59f5ad4
20190701A:
u18: 83dfd805383db9b990f69647056638f2278f2325
co6: b3812cda61c33e959f309a9eceb23ef731fc0da2
co7: d645dbac2f094d980ac266094d0c26e84aca3ca6
u12: c919aa8562ff89713ee9ecf7dd41479798dde4d7

View File

@@ -420,11 +420,6 @@ sub containerBuild
{
$strScript .= ' libjson-pp-perl liblz4-dev';
}
if (vmLintC($strOS))
{
$strScript .= ' clang-6.0 clang-tools-6.0';
}
}
#---------------------------------------------------------------------------------------------------------------------------

View File

@@ -35,8 +35,6 @@ use constant VM_DEPRECATED => 'deprecat
push @EXPORT, qw(VM_DEPRECATED);
use constant VM_IMAGE => 'image';
push @EXPORT, qw(VM_IMAGE);
# Will static code analysis be run for C?
use constant VMDEF_LINT_C => 'lint-c';
use constant VM_OS => 'os';
push @EXPORT, qw(VM_OS);
use constant VM_OS_BASE => 'os-base';
@@ -340,7 +338,6 @@ my $oyVm =
&VM_IMAGE => 'ubuntu:18.04',
&VM_ARCH => VM_ARCH_AMD64,
&VMDEF_COVERAGE_C => true,
&VMDEF_LINT_C => true,
&VMDEF_PGSQL_BIN => '/usr/lib/postgresql/{[version]}/bin',
&VMDEF_PERL_ARCH_PATH => '/usr/local/lib/x86_64-linux-gnu/perl/5.26.1',
@@ -452,18 +449,6 @@ sub vmCoverageC
push @EXPORT, qw(vmCoverageC);
####################################################################################################################################
# vmLintC
####################################################################################################################################
sub vmLintC
{
my $strVm = shift;
return $oyVm->{$strVm}{&VMDEF_LINT_C} ? true : false;
}
push @EXPORT, qw(vmLintC);
####################################################################################################################################
# Get vm architecture bits
####################################################################################################################################

View File

@@ -77,7 +77,6 @@ test.pl [options]
--no-cleanup don't cleaup after the last test is complete - useful for debugging
--pg-version version of postgres to test (all, defaults to minimal)
--log-force force overwrite of current test log files
--no-lint disable static source code analysis
--build-only compile the test library / packages and run tests only
--build-max max processes to use for builds (default 4)
--coverage-only only run coverage tests (as a subset of selected tests)
@@ -88,9 +87,9 @@ test.pl [options]
--smart perform libc/package builds only when source timestamps have changed
--no-package do not build packages
--no-ci-config don't overwrite the current continuous integration config
--dev --no-lint --smart --no-package --no-optimize
--dev-test --no-lint --no-package
--expect --no-lint --no-package --vm=co7 --db=9.6 --log-force
--dev --smart --no-package --no-optimize
--dev-test --no-package
--expect --no-package --vm=co7 --db=9.6 --log-force
--no-valgrind don't run valgrind on C unit tests (saves time)
--no-coverage don't run coverage on C unit tests (saves time)
--no-optimize don't do compile optimization for C (saves compile time)
@@ -145,7 +144,6 @@ my $strVm;
my $strVmHost = VM_HOST_DEFAULT;
my $bVmBuild = false;
my $bVmForce = false;
my $bNoLint = false;
my $bBuildOnly = false;
my $iBuildMax = 4;
my $bCoverageOnly = false;
@@ -192,7 +190,6 @@ GetOptions ('q|quiet' => \$bQuiet,
'no-cleanup' => \$bNoCleanup,
'pg-version=s' => \$strPgVersion,
'log-force' => \$bLogForce,
'no-lint' => \$bNoLint,
'build-only' => \$bBuildOnly,
'build-max=s' => \$iBuildMax,
'no-package' => \$bNoPackage,
@@ -264,7 +261,6 @@ eval
if ($bDev)
{
$bNoLint = true;
$bSmart = true;
$bNoPackage = true;
$bNoOptimize = true;
@@ -273,7 +269,6 @@ eval
if ($bDevTest)
{
$bNoPackage = true;
$bNoLint = true;
}
################################################################################################################################
@@ -290,7 +285,6 @@ eval
################################################################################################################################
if ($bExpect)
{
$bNoLint = true;
$bNoPackage = true;
$strVm = VM_EXPECT;
$strPgVersion = '9.6';
@@ -845,9 +839,9 @@ eval
# Build configure/compile options and see if they have changed from the previous build
my $strCFlags =
"-Wfatal-errors -g -fPIC -D_FILE_OFFSET_BITS=64" .
(vmWithBackTrace($strBuildVM) && $bNoLint && $bBackTrace ? ' -DWITH_BACKTRACE' : '') .
(vmWithBackTrace($strBuildVM) && $bBackTrace ? ' -DWITH_BACKTRACE' : '') .
($bDebugTestTrace ? ' -DDEBUG_TEST_TRACE' : '');
my $strLdFlags = vmWithBackTrace($strBuildVM) && $bNoLint && $bBackTrace ? '-lbacktrace' : '';
my $strLdFlags = vmWithBackTrace($strBuildVM) && $bBackTrace ? '-lbacktrace' : '';
my $strConfigOptions = (vmDebugIntegration($strBuildVM) ? ' --enable-test' : '');
my $strBuildFlags = "CFLAGS=${strCFlags}\nLDFLAGS=${strLdFlags}\nCONFIGURE=${strConfigOptions}";
my $strBuildFlagFile = "${strBinPath}/${strBuildVM}/build.flags";
@@ -889,11 +883,6 @@ eval
" ${strBackRestBase}/ ${strBinPath}/${strBuildVM}");
buildPutDiffers($oStorageBackRest, $strBuildFlagFile, $strBuildFlags);
if (vmLintC($strVm) && !$bNoLint)
{
&log(INFO, " clang static analyzer ${strBuildVM} (${strBuildPath})");
}
if ($bBuildOptionsDiffer || !$oStorageBackRest->exists("${strBuildPath}/Makefile"))
{
executeTest(
@@ -903,7 +892,6 @@ eval
executeTest(
'docker exec -i test-build' .
(vmLintC($strVm) && !$bNoLint ? ' scan-build-6.0' : '') .
" make -j ${iBuildMax}" . ($bLogDetail ? '' : ' --silent') .
" --directory ${strBuildPath} CFLAGS='${strCFlags}' LDFLAGS='${strLdFlags}'",
{bShowOutputAsync => $bLogDetail});

View File

@@ -134,23 +134,13 @@ eval
confess &log(ERROR, '--vm is required');
}
# Only lint on U18
my $strParam = undef;
if ($strVm ne VM_U18)
{
$strParam .= '--no-lint';
}
processBegin("${strVm} build");
executeTest("${strTestExe} --vm-build --vm=${strVm}", {bShowOutputAsync => true});
processEnd();
processBegin("${strVm} test" . (defined($strParam) ? ": ${strParam}" : ''));
processBegin("${strVm} test");
executeTest(
"${strTestExe} --no-gen --no-ci-config --vm-host=" . VM_U14 . " --vm-max=2 --vm=${strVm}" .
(defined($strParam) ? " ${strParam}" : ''),
{bShowOutputAsync => true});
"${strTestExe} --no-gen --no-ci-config --vm-host=" . VM_U14 . " --vm-max=2 --vm=${strVm}", {bShowOutputAsync => true});
processEnd();
}