git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] travis-ci: run scan-build every time

From
Samuel Lijin <sxlijin@gmail.com>
Date
Feb 24, 2017, 17:29 UTC
Message-ID
<CAJZjrdXP3n5fOLx4rEEkbJT7JBMPUqk4Qdutm6KpvMVUMwCSPQ@mail.gmail.com>

Introduces the scan-build static code analysis tool from the Clang project to all Travis CI builds. Installs clang (since scan-build needs clang as a dependency) to make this possible (on macOS, also updates PATH to allow scan-build to be invoked without referencing the full path). ---

A build with this patch can be found at [1]. Note that if reports *are* generated, this doesn't allow us to access them, and if we dumped the reports as build artifacts, I'm not sure where we would want to dump them to.

It's worth noting that there seems to be a weird issue with scan-build where it *will* generate a report for something locally, but won't do it on Travis. See [2] for an example where I have a C program with a very obvious memory leak but scan-build on Travis doesn't generate a report (despite complaining about it in stdout), even though it does on my local machine.

[1] https://travis-ci.org/sxlijin/git/builds/204853233 [2] https://travis-ci.org/sxlijin/travis-testing/jobs/205025319#L331-L342

 .travis.yml | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 9c63c8c3f..1038b1b3d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -20,6 +20,7 @@ addons:
     - language-pack-is
     - git-svn
     - apache2
+    - clang

 env:
   global:
@@ -78,9 +79,8 @@ before_install:
       brew update --quiet
       # Uncomment this if you want to run perf tests:
       # brew install gnu-time
-      brew install git-lfs gettext
-      brew link --force gettext
-      brew install caskroom/cask/perforce
+      brew install git-lfs gettext caskroom/cask/perforce llvm
+      brew link --force gettext llvm
       ;;
     esac;
     echo "$(tput setaf 6)Perforce Server Version$(tput sgr0)";
@@ -92,9 +92,9 @@ before_install:
     mkdir -p $HOME/travis-cache;
     ln -s $HOME/travis-cache/.prove t/.prove;

-before_script: make --jobs=2
+before_script: scan-build make --jobs=2

-script: make --quiet test
+script: scan-build make --quiet test

 after_failure:
   - >
--
2.11.1
Next: Lars Schneider
Message 1 of 7 in “travis-ci: run scan-build every time”
  1. travis-ci: run scan-build every timeSamuel Lijin, Feb 24, 2017
  2. Lars SchneiderFeb 25, 2017
  3. Jeff KingFeb 25, 2017
  4. Lars SchneiderFeb 25, 2017
  5. Samuel LijinFeb 26, 2017
  6. Lars SchneiderFeb 26, 2017
  7. Samuel LijinFeb 27, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.