While trying to run sonar-runner on a 32 bit C++/MFC solution I got the error:
Sonar Runner : Unable to extract version of Microsoft Compiler
Here is the output:
11:56:44.856 INFO - 18645 files indexed
11:57:02.381 INFO - Quality profile for c: Sonar way
11:57:02.381 INFO - Quality profile for cpp: Sonar way
11:57:02.540 INFO - cpp EVALUATION [Expiration: 2015-10-13, Server: *]
11:57:02.540 INFO - Sensor Lines Sensor
11:57:02.747 INFO - Sensor Lines Sensor (done) | time=207ms
11:57:02.747 INFO - Sensor QProfileSensor
11:57:02.749 INFO - Sensor QProfileSensor (done) | time=2ms
11:57:02.750 INFO - Sensor InitialOpenIssuesSensor
11:57:02.754 INFO - Sensor InitialOpenIssuesSensor (done) | time=4ms
11:57:02.755 INFO - Sensor ProjectLinksSensor
11:57:02.759 INFO - Sensor ProjectLinksSensor (done) | time=4ms
11:57:02.759 INFO - Sensor VersionEventsSensor
11:57:02.764 INFO - Sensor VersionEventsSensor (done) | time=5ms
11:57:02.764 INFO - Sensor SquidSensorC
11:57:02.766 INFO - C/C++ Preprocessor in silent mode. Relaunch the analysis wi
th "sonar.verbose=true" to see issues encountered by the preprocessor.
11:57:03.214 INFO - Using build-wrapper output: E:\dev\ProjectDir\build
-wrapper-out\build-wrapper-dump.json
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 28.126s
Final Memory: 17M/200M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Unable to extract version of Microsoft Compiler
Environment:
Windows 7 64 bit
sonarqube-5.1.2
sonar-runner-dist-2.4
build-wrapper-3.6
sonar-cpp-plugin-3.6
Java 1.8 32 bit
Any ideas what might cause this issue?
The build-wrapper produces a file with the name 'build-wrapper-dump.json'. If you open this file you'll see that at the top there is a section called 'captures'. It looks probably like this:
"captures":[
{
"compiler":"msvc-cl",
"executable":"C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\bin\\x86_amd64\\CL.exe",
"stdout":"",
"stderr":""
}
While it should look like this:
"captures":[
{
"compiler":"msvc-cl",
"executable":"C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\bin\\x86_amd64\\CL.exe",
"stdout":"usage: cl [ option... ] filename... [ \/link linkoption... ]\r\n",
"stderr":"Microsoft (R) C\/C++ Optimizing Compiler Version 18.00.40629 for x64\r\nCopyright (C) Microsoft Corporation. All rights reserved.\r\n\r\n"
}
To get the missing values you need to execute the build-wrapper from the Visual Studio Command prompt. This command prompt sets some extra environment variables. Hope this helps.
Related
I have a nucleo-144 board with stm32f746zg MCU. I'm trying to program the board with openocd, using gnu make and the makefile generated from stm32cubemx. I've added following line to my makefile to automate the flashing process:
flash: all
openocd -f interface/stlink.cfg -f target/stm32f7x.cfg -c "program $(BUILD_DIR)/$(TARGET).elf verify reset exit"
The code compiles without any problem and when I type make flash in the terminal the result is:
❯ make flash
openocd -f interface/stlink.cfg -f target/stm32f7x.cfg -c "program build/my-board.elf verify reset exit"
Open On-Chip Debugger 0.11.0 (2021-11-18) [https://github.com/sysprogs/openocd]
Licensed under GNU GPL v2
libusb1 09e75e98b4d9ea7909e8837b7a3f00dda4589dc3
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : DEPRECATED target event trace-config; use TPIU events {pre,post}-{enable,disable}
Info : clock speed 2000 kHz
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
Info : STLINK V2J33M25 (API v2) VID:PID 0483:374B
Info : Target voltage: 3.236769
Info : stm32f7x.cpu: Cortex-M7 r0p1 processor detected
Warn : Silicon bug: single stepping may enter pending exception handler!
Info : stm32f7x.cpu: target has 8 breakpoints, 4 watchpoints
Info : starting gdb server for stm32f7x.cpu on 3333
Error: couldn't bind gdb to socket on port 3333: No error
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08002a18 msp: 0x20050000
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
** Programming Started **
Info : device id = 0x10016449
Info : flash size = 1024 kbytes
** Programming Finished **
** Verify Started **
** Verified OK **
** Resetting Target **
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
shutdown command invoked
But the program doesn't run on the board and there's no blinking. I tried this in windows and wsl ubuntu. In both cases the results are the same. Also tried loading the binary file instead of .elf but again no luck.
Can somebody tell me what am I doing wrong here?
Ok. I'm not sure if I should post this as an answer, but the problem wasn't either openocd or the broken hardware.
When I started the project in cubemx, I initialized the default nucleo-f746zg peripherals and for some reason (probably one of the peripherals need higher clock frequency to work properly) in clock configuration the default clock source is selected as HSE and this option cannot be changed. On the other hand the nucleo board doesn't come with an external oscillator and it should be soldered by the user. So after generating the code and flashing it to the board it causes an error and the program doesn't run. Although, I think there was a block of code in clock configuration of HAL libraries that would "try" to use HSE and PLL as clock source and in case of not responding or any problem in settings, the HSI would be used as default source.
Anyway when I start the project from MCU selector in cubemx and don't use nucleo initializations, I can set the clock to HSI and everything works fine.
I have a SSIS project that back in December start failing validation on an expression to create DT_DBTIMESTAMP. This expression hasn't changed since 2018 that I can tell, the SQL server was upgraded not sure if the timing correlates or not. The error is "The expression for variable "EndDate" failed evaluation. There was an error in the expression"
#[$Project::UseOverrideDate]? (DT_DBTIMESTAMP)((DT_WSTR, 4)#[$Project::Year] + "-" + (DT_WSTR, 2)(#[$Project::Month] + 1) + "-" + "01") : DATEADD( "dd", -(DATEPART( "dd",GETDATE() ) -1), (DT_DBDATE) GETDATE())
The UseOverrideDate is a bool so we can manually set a month and year in parameters (Month, Year)
The package is developed in VS2012 and evaluates out successful in the dev studio and under the debugger; do any of you see anything that might cause the error. The SSIS package completes its task with the expected results so I am wondering what the error is being thrown for.
Thanks in advance for any insight you may provide.
After more rooting around abit more with no success I deleted the package out of the SSISDB and re-deployed it back in by way of the command line; the problem went away. Not sure what the deployment process wasn't doing but this 2.5 day excercise of chasing down something that works elsewere is over, Thank you for everyones time.
It works for me so I think we're missing some pieces here
I defined the following project parameters
and created a package variable with the above expression
If I flip the project parameter to True, I see the EndDate change to 4/1/2021
The comment indicates that the problem only surfaces when executed outside of Visual Studio. The results here are the same as I experience when I deploy to the SSISDB but are easier for me to show without screenshots.
I added a trivial script task to echo my variables to the output window. I built the ispac and then ran it two times to catch both cases.
Execute the project and package setting my UseOverrideDate to False
C:\Users\bfellows\source\repos\SO_Trash\SO_Trash\bin\Development>dtexec /proj SO_Trash.ispac /pack SO_66772141.dtsx /set \Package.Variables[$Project::UseOverrideDate];False /rep V
Microsoft (R) SQL Server Execute Package Utility
Version 14.0.3370.1 for 32-bit
Copyright (C) 2017 Microsoft. All rights reserved.
Started: 12:17:49 PM
Info: 2021-03-24 12:17:49.97
Code: 0x00000000
Source: SCR Echo Back SCR Echo Back
Description: User::EndDate : 3/1/2021 12:00:00 AM
End Info
DTExec: The package execution returned DTSER_SUCCESS (0).
Started: 12:17:49 PM
Finished: 12:17:49 PM
Elapsed: 0.266 seconds
Flip the UseOverride To True
C:\Users\bfellows\source\repos\SO_Trash\SO_Trash\bin\Development>dtexec /proj SO_Trash.ispac /pack SO_66772141.dtsx /set \Package.Variables[$Project::UseOverrideDate];True /rep V
Microsoft (R) SQL Server Execute Package Utility
Version 14.0.3370.1 for 32-bit
Copyright (C) 2017 Microsoft. All rights reserved.
Started: 12:17:56 PM
Info: 2021-03-24 12:17:56.93
Code: 0x00000000
Source: SCR Echo Back SCR Echo Back
Description: User::EndDate : 4/1/2021 12:00:00 AM
End Info
DTExec: The package execution returned DTSER_SUCCESS (0).
Started: 12:17:56 PM
Finished: 12:17:56 PM
Elapsed: 0.25 seconds
I ran dtexec with a /REP /v to turn on verbose logging. As you can see, my variable value changes as expected and no error is generated.
Given that you've resolved the issue by deleting and recreating from scratch, it would seem that something in the deployment/"the SQL server was upgraded" was in play here but not enough data to diagnose root cause.
I am trying to follow these instructions for my system and am as far as step 8 (unit tests & coverage).
When I execute this command on the server it works succesfully:
"C:\Program Files (x86)\OpenCover\OpenCover.Console.exe" -register:user -target:"C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe" -targetargs:"C:\workspace\Extensions\Extensions\ExtensionTests\bin\Debug\ExtensionsTests.dll -result=TestResult.xml;format=nunit2" -filter:+
If I add it as a Jenkins Batch command step I get:
"C:\Program Files (x86)\OpenCover\OpenCover.Console.exe" -register:user -target:"C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe" -targetargs:"C:\workspace\Extensions\Extensions\ExtensionTests\bin\Debug\ExtensionsTests.dll -result=TestResult.xml;format=nunit2" -filter:+
Executing: C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe
NUnit Console Runner 3.8.0
Copyright (c) 2018 Charlie Poole, Rob Prouse
Runtime Environment
OS Version: Microsoft Windows NT 6.3.9600.0
CLR Version: 4.0.30319.42000
Test Files
C:\workspace\Extensions\Extensions\ExtensionTests\bin\Debug\ExtensionsTests.dll
Run Settings
DisposeRunners: True
WorkDirectory: c:\workspace\Extensions
ImageRuntimeVersion: 4.0.30319
ImageTargetFrameworkName: .NETFramework,Version=v4.6.1
ImageRequiresX86: False
ImageRequiresDefaultAppDomainAssemblyResolver: False
NumberOfTestWorkers: 2
Test Run Summary
Overall result: Passed
Test Count: 37, Passed: 37, Failed: 0, Warnings: 0, Inconclusive: 0, Skipped: 0
Start time: 2018-02-23 10:40:58Z
End time: 2018-02-23 10:40:59Z
Duration: 1.106 seconds
Results (nunit2) saved as TestResult.xml
Committing...
No results, this could be for a number of reasons. The most common reasons are:
1) missing PDBs for the assemblies that match the filter please review the
output file and refer to the Usage guide (Usage.rtf) about filters.
2) the profiler may not be registered correctly, please refer to the Usage
guide and the -register switch.
I have tried setting the Jenkins to run under my ID and allowed it to interact with the desktop.
Can someone point me in the right direction to get it running please?
Ahh so I found the answer from this question, I just needed to move a quote to give:
"C:\Program Files (x86)\OpenCover\OpenCover.Console.exe" -register:user -target:"C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe" -"targetargs:C:\workspace\Extensions\Extensions\ExtensionTests\bin\Debug\ExtensionsTests.dll -result=TestResult.xml;format=nunit2" -filter:+
Which works!
I am writing a function that i want to include in a user-defined package (MYPACKAGE). The function is a follows:
readSchedule <- function(FILE){
WB = loadWorkbook(FILE)
WS= readWorksheet(WB, sheet = 'Sheet1',header = TRUE)
return(WS)
}
where FILE is the name of the Excel file i want to read. When writing this function, I want it to import XLConnect, since that is the package it uses. I placed header code defining the function:
#param FILE Excel file
#return Excel data
#export
#import XLConnect
I have also added import(XLConnect) to the NAMESPACE and the DESCRIPTION file of MYPACKAGE. The package builds fine (or at least at first cut it appears to build OK) but when i run "Check Package" it fails and gives me the following error:
* installing *source* package 'MYPACKAGE' ...
** R
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: No CurrentVersion entry in Software/JavaSoft registry! Try re-installing Java and make sure R and Java have matching architectures.
Error: loading failed
Execution halted
*** arch - x64
ERROR: loading failed for 'i386'
I have the correct version of Java and can load rJava just fine. i've tried importing rJava (similar to XLConnect) but i get the same error. Below is my sessionInfo:
R version 3.1.2 (2014-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] MYPACKAGE
loaded via a namespace (and not attached):
[1] chron_2.3-45 data.table_1.9.4 digest_0.6.8 lubridate_1.3.3 memoise_0.2.1 plyr_1.8.1
[7] Rcpp_0.11.1 reshape2_1.4 rJava_0.9-6 stringr_0.6.2 tools_3.1.2 XLConnect_0.2-7
It looks like you are building your package on a Windows 64-bit machine with a 64-bit version of Java installed. When checking your package using R CMD check, R by default also attempts to check your package on other sub-architectures (i386, 32-bit) which in your case would in addition require a 32-bit installation of Java.
If you want to check your package also for i386 you may just additionally install Java 32-bit. The other option is to pass the option --no-multiarch to your R CMD check call, e.g. R CMD check --no-multiarch MYPACKAGE.
I am working under Eclipse with gcc for bare metal ARM. The version control is SVN and the make system is make.
The project is quite large, and it would be beneficial to extract some areas into external libraries. The libraries are to be compiled, collected within an .a file, and the main project will statically link against them.
I managed to do this. The library has it's own makefile, which the project makefile calls. The linking is ok. However, I have trouble when trying to setup debugging! A "Hard fault" occurs within the CPU, and the debugger reports:
Open On-Chip Debugger 0.7.0 (2013-05-05-10:44)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
WARNING!
This file was not tested with real interface, but is assumed to work as this
interface uses the same layout as configs that were verified. Please report your
experience with this file to openocd-devel mailing list, so it could be marked
as working or fixed.
Info : only one transport option; autoselect 'jtag'
adapter speed: 500 kHz
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
cortex_m3 reset_config sysresetreq
adapter speed: 3000 kHz
Info : clock speed 3000 kHz
Info : JTAG tap: sam4.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
Info : sam4.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : JTAG tap: sam4.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x004000d0 msp: 0x2001fffc
force hard breakpoints
Info : accepting 'gdb' connection from 3333
Warn : acknowledgment received, but no packet pending
Error: JTAG-DP STICKY ERROR
Error: MEM_AP_CSW 0x23000052, MEM_AP_TAR 0xfffffffc
Error: JTAG-DP STICKY ERROR
Error: MEM_AP_CSW 0x23000052, MEM_AP_TAR 0xfffffffc
Warn : Block read error address 0xfffffff8
Error: JTAG-DP STICKY ERROR
Error: MEM_AP_CSW 0x23000052, MEM_AP_TAR 0xfffffffc
Error: JTAG-DP STICKY ERROR
Error: MEM_AP_CSW 0x23000052, MEM_AP_TAR 0xfffffffc
Warn : Block read error address 0xfffffff8