Running SonarQube analysis scan - SonarSource build-wrapper - c++

I'm new to running SonarQube scans and I get this error message in the log in Jenkins:
16:17:39 16:17:36.926 ERROR - The only way to get an accurate analysis of your C/C++/Objective-C project is by using the SonarSource build-wrapper. If for any reason, the use of the build-wrapper is not possible on your project, you can bypass it with the help of the "sonar.cfamily.build-wrapper-output.bypass=true" property. By using that property, you'll switch to an "at best" mode that could result in false-positives and false-negatives.
Can someone please advise where I can find and run this SonarSource build-wrapper?
Thanks a lot for your help!

To solve this issue, download the Build Wrapper directly from your SonarQube Server, so that its version perfectly matches your version of the plugin:
Build Wrapper for Linux can be downloaded from URL
http://localhost:9000/static/cpp/build-wrapper-linux-x86.zip
Unzip the downloaded Build Wrapper,
Configure it in your PATH because it's just more convenient
export PATH=$PATH:/path/where/you/unzip
Once done, Run below commands.
build-wrapper-linux-x86-64 --out-dir <dir-name> <build-command>
build-wrapper-linux-x86-64 --out-dir build_output make clean all
Once all this done, you have to modify your sonar-project.properties file with following line. Note the dir-name is same directory which we defined in previous command.
sonar.cfamily.build-wrapper-output=<dir-name>
and then you can run the sonar scanner command.
sonar-scanner
this will do the analysis against your code. For more details, you can check this link.

Contacted support, turns out this was caused by missing the argument sonar.cfamily.build-wrapper-output in the scanner begin command.

Build wrapper downloads:
Linux: https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
macOS: https://sonarcloud.io/static/cpp/build-wrapper-macosx-x86.zip
Windows: https://sonarcloud.io/static/cpp/build-wrapper-win-x86.zip
Some links covering how to run the build wrapper:
https://docs.sonarqube.org/latest/analysis/languages/cfamily/
https://blog.sonarsource.com/with-great-power-comes-great-configuration/

Related

Getting Qt Test output in GitHub actions

Currently the only thing I can see is the executable exit code, so I can see if any tests failed or not, but I don't get any other output.
Is there a way to show something similar to what you see in Qt Creator when running tests?
I am using CMake and the Qt Test framework.
You can use -junitxml option to output test results to xml file(s) and use one of actions to watch detailed reports:
action-junit-report
publish-unit-test-results
junit-report-action
test-reporter
report-junit-annotations-as-github-actions-annotations
I figured out a workaround. If you use the -o filename,format command line argument and output to a file, you can then use more filename to get the Test results.
GitHub actions uses Windows Server as the environment so that might be a reason for the weird behavior. My best guess is the Qt implementation works differently on Windows Server, because std::out works fine.

Tensorflow C++ API guide examples on Windows

I built tensorflow with VS2015 and I was able to run some examples,
as tf_tutorials_example_trainer and label_image.
Then I tried to run the samples here. I was able to compile and start the example.cc but when reaching the line
Scope root = Scope::NewRootScope();
I get this error:
Op type not registered 'NoOp' in binary running on DESKTOP-S5QHRCE.
Make sure the Op and Kernel are registered in the binary running in this process
What am I missing?
I found this.Thanks to Joe, who explains how to use the /WHOLEARCHIVE option to fix the issue.To avoid out of memory error during linking if using Optimize for debugging (/DEBUG) option, do msbuild /p:Configuration=Release youproject.vcxproj in a command prompt.

Jenkins Xcode-Plugin Can't Find SDK (Unit Testing)

I'm using the xcode-plugin on Jenkins to run my unit tests and generate a result output in my iOS application. Although my build completes normally, when it gets to the point of executing the test portion it fails with the following error:
Going to invoke xcodebuild:target: FunTests, sdk: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/, project: DEFAULT, configuration: Debug, clean: NO, archive:NO, symRoot: DEFAULT, configurationBuildDir: DEFAULT, codeSignIdentity: DEFAULT
[workspace] $ /usr/bin/xcodebuild -target FunTests -sdk /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/ -configuration Debug build
xcodebuild: error: SDK "/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/" cannot be located.
Build step 'Xcode' marked build as failure
Archiving artifacts
Finished: FAILURE
Here's a screen capture of my settings:
I've entered the correct path to the SDK, but no dice. I'm guessing this is something simple I've overlooked. Can anyone help, or even recommend an alternative way to accomplish this? I'm using Xcode 5, Jenkins v1.565, and xcode-plugin v1.4.2. Thanks in advance!
maybe the SDK name is wrong try xcodebuild -showsdks and use the name that is shown in there

Android Studio - Unable to create Test module

Just installed Android Studio to give it a try. I'm trying to create a test module for my application and, whatever the method I use, I always get the following error: "Error: No AndroidManifest.xml file found in the main project directory...".
Methods I use:
1) from Android Studio: New > Module > Test Module
2) from command line: android create test-project -m "main_path" -n "project_name" -p "test_path"
Any ideas on how to solve this?
Edit: As of 0.1.8 this is now supported in the IDE.
According to the documentation for the new build system a separate project is no longer needed, which implies that a separate module may not be either. That said, getting test working within the IDE is still problematic. I've posted an answer here that at least works for running tests from the command line.

xtk-deps.js file missing?

I am ref to https://github.com/xtk/X/wiki/X:DevelopersHeadsUp
I tried Running XTK during development.
I did the following steps
1) Fork XTK on Github to get the latest sources http://github.com/XTK/X
2) Clone it to your hard drive
But i couldn't find the xtk-deps.js file in the folder.
When i try
./build.py -d
Its complaining that "The command line is too long" and not generating xtk-deps.js file. Can some one help me where i went wrong ?
Yep, the error comes from the python script builds via a shell command line which is too long for the Windows prompt. The best is using Linux or Mac, or we can give you one and then you'll have to edit it manualy when you add/remove classes but it's not the easiest !