According to the FAKE documentation you can list all existing targets in your build file by executing FAKE with the argument --listTargets (or alternatively -lt):
> ./build.sh --listTargets
build.sh is a wrapper script from ProjectScaffold.
https://fsharp.github.io/FAKE/specifictargets.html
My version of FAKE is:
> ./build.sh --version
FakePath: ...
FAKE - F# Make "4.16.1"
When I run the listTarget command I get a strange output:
Error parsing command line arguments. You have a mistake in your args, or are using the pre-2.1.8 argument style:
Exception Message:unrecognized argument: '--listTargets'.
At the end of the error message I get the information I wanted:
Attempting to run with pre-version 2.18 argument style, for backwards compat.
Available targets:
- Clean
Depends on: []
- Build
Depends on: ["Clean"]
- CopyBinaries
Depends on: ["Build"]
- RunTests
Depends on: ["CopyBinaries"]
- Default
Depends on: ["RunTests"]
From the error message I get the impression that something changed in version 2.1.8 according to the argument style.
My question: What is the correct way to list all existing targets with FAKE?
Here is the complete output:
> ./build.sh --listTargets
No version specified. Downloading latest stable.
Paket.exe 2.47.1.0 is up to date.
Paket version 2.47.1.0
0 seconds - ready.
Error parsing command line arguments. You have a mistake in your args, or are using the pre-2.1.8 argument style:
Exception Message:unrecognized argument: '--listTargets'.
--envvar [-ev] <string> <string>: Set environment variable <name> <value>. Supports multiple.
--envflag [-ef] <string>: Set environment variable flag <name> 'true'. Supports multiple.
--logfile [-lf] <string>: Build output log file path.
--printdetails [-pd]: Print details of FAKE's activity.
--version [-v]: Print FAKE version information.
--fsiargs [-fa] <string> ...: Pass args after this switch to FSI when running the build script.
--boot [-b] <string> ...: Boostrapp your FAKE script.
--break [-br]: Pauses FAKE with a Debugger.Break() near the start
--single-target [-st]: Runs only the specified target and not the dependencies.
--nocache [-nc]: Disables caching of compiled script
--help [-h|/h|/help|/?]: display this list of options.
**************************************************
Type: System.ArgumentException
HResult: -2147024809
Source: Argu
TargetSite: Nessos.Argu.ParseResults`1[Cli+FakeArg] Nessos-Argu-IExiter-Exit[ParseResults`1](System.String, Microsoft.FSharp.Core.FSharpOption`1[System.Int32])
StackTrace
**************************************************
at Nessos.Argu.ExceptionExiter.Nessos-Argu-IExiter-Exit[b] (System.String msg, Microsoft.FSharp.Core.FSharpOption`1 _arg1) <0x30ab2b8 + 0x00027> in <filename unknown>:0
at Nessos.Argu.ArgumentParser`1[Template].Parse (Microsoft.FSharp.Core.FSharpOption`1 inputs, Microsoft.FSharp.Core.FSharpOption`1 xmlConfigurationFile, Microsoft.FSharp.Core.FSharpOption`1 errorHandler, Microsoft.FSharp.Core.FSharpOption`1 ignoreMissing, Microsoft.FSharp.Core.FSharpOption`1 ignoreUnrecognized, Microsoft.FSharp.Core.FSharpOption`1 raiseOnUsage) <0x2d47288 + 0x00332> in <filename unknown>:0
at Cli.parsedArgsOrEx (IEnumerable`1 args) <0x70a390 + 0x000cb> in <filename unknown>:0
Attempting to run with pre-version 2.18 argument style, for backwards compat.
Available targets:
- Clean
Depends on: []
- Build
Depends on: ["Clean"]
- CopyBinaries
Depends on: ["Build"]
- RunTests
Depends on: ["CopyBinaries"]
- Default
Depends on: ["RunTests"]
Update
I've just found a GitHub issue which reference my problem some how but I can make no sense of it:
https://github.com/fsharp/FAKE/issues/1082
Related
I've prepared docker image that demonstrate the problem:
https://drive.google.com/uc?id=1i04_dVL0Rp5rxXCMuHaS4LYREkZjAAW1&export=download
This image is basically alpine:3.11 + apk add openjdk8 maven + my maven project containing sample minimal java class that shows problem
Which you can try with following commands:
# docker load -i bugexample.img
# docker run -w /root/bug-example --name bugtest bugexample /bin/ash build-until-sha-different.sh
If you are lucky enough (sometimes require several attempts) you will get following output:
Found! Sha1 of two subsequent otherwise identical builds are different!
--- 1.sha1
+++ 2.sha1
## -1,3 +1,3 ##
d8d46555c93da579adefc629f1764965a5493edb com/SimpleBug$1.class
75007242aab1e1877d24124d432cb246a79476a8 com/SimpleBug$SimpleBugBuilder.class
-23e8d0ea909b95a7955e0ec0adb4d12ae2193dd1 com/SimpleBug.class
+6a303d69d3f382b23ca04caee4102ee1cd7151e3 com/SimpleBug.class
The core issue with this build is that it produce different bytecode almost each time it get build even though nothing else (neither environment, nor code itself) had changed.
When I do compare these different class files I see that they differ in one single byte:
# cmp -lb 1_SimpleBug.class 2_SimpleBug.class
4053 66 6 65 5
Digging deeper into class file structure I've found that this difference come from stackmapframe constant pool pointers (StackMapTable attribute -> stack_map_frame entry with tag Object_variable_info -> cpool_index)
1_SimpleBug.class
#35 = Utf8 supSetStringParameter10
#36 = Utf8 Lcom/google/common/base/Supplier;
2_SimpleBug.class
#35 = Utf8 supSetStringParameter10
#36 = Utf8 Lcom/google/common/base/Supplier;
So one file points to #35 and another to #36. I don't think this is correct behavior.
I would like to sumbit this to a proper issue tracker but I don't know how to do that since all related JDK trackers are for devs only.
# java -version
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (IcedTea 3.15.0) (Alpine 8.242.08-r0)
OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode)
# mvn -version
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /usr/share/java/maven-3
Java version: 1.8.0_242, vendor: IcedTea, runtime: /usr/lib/jvm/java-1.8-openjdk/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.15.0-1050-kvm", arch: "amd64", family: "unix"
And here is archive with java project:
https://drive.google.com/uc?id=1ZBdRzUk00QtpkGGnKAzipMjMtcnkKGN4&export=download
Well... The Mountain in Labour...
All of this was for nothing. Maven was main culprit. First time I ran my build it downloads lots of stuff that maven require (apart from my project dependencies) and then start compilation in same jvm. Second time build runs there is no need to download so compilation starts immediately. I don't know exactly why but first invocation of compiler is somehow affected by state of the jvm and this cause it to produce slightly different bytecode.
Solution was to add <fork>true<fork> to my pom.xml file and build now is totally reproducible... though takes ~2x more time :)
I still believe that this should not happen even if initial compilation happened inside maven jvm, and it may still be topic for improvement in javac but this "workaround" is acceptable.
I am trying to use bazel as build system.
My project looks like this:
a static library which contains a bunch of classes and functions
a dynamic library (so/dll) using the same code as the static library (need to have it because of windows, cc_library rule does not automatically build a dll on windows)
a cc_test rule which build an executable. it contains unit tests based on google test framework
It works when running on Windows and Linux.
The test rule fails when trying to build Android like this
bazel build //unit:unit --crosstool_top=#androidndk//:default_crosstool --cpu=armeabi-v7a
INFO: Invocation ID: b7c88128-3448-4eb7-bf25-ce8269895956 ERROR: ../yg32wcuz/external/androidndk/BUILD.bazel:39:1: in cc_toolchain_suite rule #androidndk//:toolchain-gnu-libstdcpp: cc_toolchain_suite '#androidndk//:toolchain-gnu-libstdcpp' does not contain a toolchain for cpu 'x64_windows'
ERROR: Analysis of target '//unit:unit' failed; build aborted: Analysis of target '#androidndk//:toolchain-gnu-libstdcpp' failed; build aborted
It looks like that bazel seems to have problem with cc_test and android toolchain
Is there any way to build and run an executable for android using bazel? Maybe I missed some command line arguments
Edit:
tried the solution below and added a sh_test rule but it fails again
using #androidsdk//:adb and leads to the following error
ERROR: missing input file '#androidsdk//:platform-tools/adb'
ERROR: unit/BUILD:61:1: //unit:unit_android: missing input file '#androidsdk//:platform-tools/adb' Target //unit:unit_android failed to build
ERROR: unit/BUILD:61:1 1 input file(s) do not exist
I also need to use $ANDROID_HOME/platform-tools/adb to get the adb binary. external/androidsdk/platform-tools/adb does not work. my BUILD file is in a sub folder of the workspace, maybe this is the issue.
removing #androidsdk//:adb fixes this error. there are some adjustments needed in sh_test rule like:
sh_test(
name = "unit_android",
srcs = ["unit_android.sh"],
data = [
":unit",
#"#androidsdk//:adb",
],
deps = [
"#bazel_tools//tools/bash/runfiles", # to access the manifest
],
)
using runfiles dependency allows me to access the binary via $(rlocation ..) in shell script. but now there seems to be another issue:
when using 'bazel run':
It looks like that bazel is trying to upload the file to msys shell (i am using windows) and not to the device:
adb: error: failed to copy '.../_bazel_exb_a/yg32wcuz/execroot/test/bazel-out/armeabi-v7a-fastbuild/bin/unit/unit' to 'C:/Development/msys2/data/local/tmp/unit'
when using 'bazel test':
it just states an error and the content of test log is
unknown parameter - /users
Edit 2:
WORKSPACE file about android sdk/ndk
android_ndk_repository(
name = "androidndk", # Required. Name *must* be "androidndk".
api_level = 26
)
android_sdk_repository(
name = "androidsdk", # Required. Name *must* be "androidsdk".
api_level = 26
)
In both case I assume env var ANDROID_NDK_HOME (points to ndk), ANDROID_SDK_HOME (points to sdk) and ANDROID_HOME (points to sdk) are set. I also checked the external dir, sdk is in there. Removing "#androidsdk//:adb" seem to work but the bazel shell environment now tries to add a prefix before "/data/local/tmp" and tries to upload to a non existing folder.
forget about the issue with "/users" (windows path issue ...)
--crosstool_top by itself sets both the target and host crosstool, so you may just need to set --host_crosstool_top back to the default: --host_crosstool_top=#bazel_tools//tools/cpp:toolchain
Edit:
Running the test on a device is unfortunately not supported out of the box by bazel test. There needs to be some test runner that knows how to put the test on the device, run it, and collect the results. A very simple version of that might look like:
test.cc:
int main(int argc, char** argv) {
// Test always passes.
// Return non-zero for test failure.
return 0;
}
example_android_cc_test.sh:
adb=external/androidsdk/platform-tools/adb
# The test requires a running emulator or connected device.
# The name of the cc_test binary can be passed in using the
# args attribute of sh_test to make this script generic.
$adb push example_test /data/local/tmp
# adb shell returns the exit code of the command
# that was executed, and the exit code of the
# test shell script determines if the sh_test target
# passes or fails.
$adb shell "/data/local/tmp/example_test"
BUILD:
cc_test(
name = "example_test",
srcs = ["test.cc"],
linkopts = ["-pie"],
linkstatic = 1,
)
sh_test(
name = "example_android_cc_test",
srcs = ["example_android_cc_test.sh"],
data = [
":example_test",
"#androidsdk//:adb",
],
)
Note that this approach is not hermetic because it relies on an emulator to already be running, or a device to be already connected. It's possible to start an emulator as part of the test, but that's more involved.
When I run TFS 2013 with sonar I get the following error: No ProjectInfo.xml files were found. Check that the analysis targets are referenced by the MSBuild projects being built.
Message: TF270015: 'SonarQube.MSBuild.Runner.exe' returned an unexpected exit code. Expected '0'; actual '1'.
I use :
sonarqube-5.1.zip
sonar-csharp-plugin-4.0.jar
SonarQube.MSBuild.Runner-0.9.zip
sonar-runner-dist-2.4.zip
I've followed instructions found in "SonarQube Installation Guide for Existing TFS Environment.pdf".
Any help ?
Thank you.
Log :
SonarQube Analysis Summary
Analysis failed for SonarQube project "WpfApplication2", version 1.0
Product projects: 0, test projects: 0
Invalid projects: 0, skipped projects: 0, excluded projects: 0
Résumé
Debug | x86
0 erreur(s), 1 avertissement(s)
$/Essai2/WpfApplication2/WpfApplication2.sln - 0 erreur(s), 1 avertissement(s),
Afficher le fichier journal
C:\Builds\1\Essai2\WpfApplication2\src\documents\visual studio 2013\Projects\WpfApplication2\WpfApplication2.sln.metaproj : The specified solution configuration "Debug|x86" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration.
$/Essai2/WpfApplication2/WpfApplication2.sln compilé
Aucun résultat des tests
Aucun résultat de couverture du code
Autres erreurs et avertissements
2 erreur(s), 0 avertissement(s)
01:45:52: No ProjectInfo.xml files were found. Check that the analysis targets are referenced by the MSBuild projects being built.
Exception Message: TF270015: 'SonarQube.MSBuild.Runner.exe' returned an unexpected exit code. Expected '0'; actual '1'. See the build logs for more details. (type UnexpectedExitCodeException)
Exception Stack Trace: at System.Activities.Statements.Throw.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
Here is the Diagnostic (I truncated the source check out part) :
Compile, Test and Publish00:00:46
Run optional script before MSBuild00:00:08
InputsEnvironmentVariables:
Enabled: True
Arguments: /key:WpfApplication2 /name:WpfApplication2 /version:1.0
FilePath: C:\sonarqube\bin\SonarQube.MSBuild.Runner.exe
OutputsResult: 0
C:\sonarqube\bin\SonarQube.MSBuild.Runner.exe /key:WpfApplication2 /name:WpfApplication2 /version:1.0
Pre-processing (3 arguments passed)
Using environment variables to determine the download directory...
Using environment variable 'TF_BUILD_BUILDDIRECTORY', value 'C:\Builds\1\Essai2\WpfApplication2'
Creating the analysis bin directory: C:\Builds\1\Essai2\WpfApplication2\sqtemp\bin
SonarQube server url: http://localhost:9000
Downloading SonarQube.MSBuild.Runner.Implementation.zip from http://localhost:9000/static/csharp/SonarQube.MSBuild.Runner.Implementation.zip to C:\Builds\1\Essai2\WpfApplication2\sqtemp\bin\SonarQube.MSBuild.Runner.Implementation.zip
Executing file C:\Builds\1\Essai2\WpfApplication2\sqtemp\bin\SonarQube.MSBuild.PreProcessor.exe
Args: "/key:WpfApplication2" "/name:WpfApplication2" "/version:1.0"
Working directory: C:\Builds\1\Essai2\WpfApplication2\sqtemp\bin
Timeout (ms):300000
Process id: 4168
01:45:11: The path to the sonar-runner.properties file was not supplied on the command line. Attempting to locate the file...
01:45:11: Located the runner properties file: C:\sonar-runner-2.4\conf\sonar-runner.properties
01:45:11: Legacy TeamBuild environment detected
01:45:11: Creating config and output folders...
01:45:11: Removing the existing directory: C:\Builds\1\Essai2\WpfApplication2\sqtemp\conf
01:45:11: Creating directory: C:\Builds\1\Essai2\WpfApplication2\sqtemp\conf
01:45:11: Removing the existing directory: C:\Builds\1\Essai2\WpfApplication2\sqtemp\out
01:45:11: Creating directory: C:\Builds\1\Essai2\WpfApplication2\sqtemp\out
Generating the FxCop ruleset...
01:45:14: Saving the config file to C:\Builds\1\Essai2\WpfApplication2\sqtemp\conf\SonarQubeAnalysisConfig.xml
Process returned exit code 0
Run MSBuild00:00:12
InputsProjectsToBuild: String[] Array
MSBuildMultiProc: True
Verbosity: Normal
ToolPlatform: Auto
Targets:
RunCodeAnalysis: AsConfigured
CommandLineArguments: /p:SkipInvalidConfigurations=true /p:Configuration=Debug /p:Platform="Any CPU"
ConfigurationsToBuild: String[] Array
OutputLocation: SingleFolder
Enabled: True
ToolVersion:
CleanBuild: True
OutDir:
RestoreNuGetPackages: True
C:\Program Files\Microsoft Team Foundation Server 12.0\Tools\nuget.exe restore "C:\Builds\1\Essai2\WpfApplication2\src\documents\visual studio 2013\Projects\WpfApplication2\WpfApplication2.sln" -NonInteractive
C:\Program Files (x86)\MSBuild\12.0\bin\amd64\MSBuild.exe /nologo /noconsolelogger "C:\Builds\1\Essai2\WpfApplication2\src\documents\visual studio 2013\Projects\WpfApplication2\WpfApplication2.sln" /nr:False /fl /flp:"logfile=C:\Builds\1\Essai2\WpfApplication2\src\documents\visual studio 2013\Projects\WpfApplication2\WpfApplication2.log;encoding=Unicode;verbosity=normal" /p:SkipInvalidConfigurations=true /p:Configuration=Debug /p:Platform="Any CPU" /m /p:OutDir="C:\Builds\1\Essai2\WpfApplication2\bin\\" /p:Configuration="Debug" /p:Platform="x86" /p:VCBuildOverride="C:\Builds\1\Essai2\WpfApplication2\src\documents\visual studio 2013\Projects\WpfApplication2\WpfApplication2.sln.x86.Debug.vsprops" /dl:WorkflowCentralLogger,"C:\Program Files\Microsoft Team Foundation Server 12.0\Tools\Microsoft.TeamFoundation.Build.Server.Logger.dll";"Verbosity=Normal;BuildUri=vstfs:///Build/Build/52;IgnoreDuplicateProjects=False;InformationNodeId=12;TargetsNotLogged=GetNativeManifest,GetCopyToOutputDirectoryItems,GetTargetPath;LogProjectNodes=True;LogWarnings=True;TFSUrl=http://localhost:8080/tfs/DefaultCollection;"*WorkflowForwardingLogger,"C:\Program Files\Microsoft Team Foundation Server 12.0\Tools\Microsoft.TeamFoundation.Build.Server.Logger.dll";"Verbosity=Normal;" /p:BuildId="dbda6e4d-d5bc-4eed-8b3e-6cc79e3721cc,vstfs:///Build/Build/52" /p:BuildLabel="WpfApplication2_20150615.3" /p:BuildTimestamp="Mon, 15 Jun 2015 11:44:59 GMT" /p:BuildSourceVersion="LWpfApplication2_20150615.3#$/Essai2" /p:BuildDefinition="WpfApplication2"
Run optional script after MSBuild00:00:00
InputsEnvironmentVariables:
Enabled: True
Arguments:
FilePath:
OutputsResult: 0
Run optional script before Test Runner00:00:00
InputsEnvironmentVariables:
Enabled: True
Arguments:
FilePath:
OutputsResult: 0
Run VS Test Runner00:00:00
InputsTestSpecs: BuildParameter[] Array
Enabled: False
ConfigurationsToTest: String[] Array
OutDir:
This activity was not run since its Enabled property was set to False.
Run optional script after Test Runner00:00:25
InputsEnvironmentVariables:
Enabled: True
Arguments:
FilePath: C:\sonarqube\bin\SonarQube.MSBuild.Runner.exe
OutputsResult: 0
C:\sonarqube\bin\SonarQube.MSBuild.Runner.exe
Post-processing (no arguments passed)
Using environment variables to determine the download directory...
Using environment variable 'TF_BUILD_BUILDDIRECTORY', value 'C:\Builds\1\Essai2\WpfApplication2'
Executing file C:\Builds\1\Essai2\WpfApplication2\sqtemp\bin\SonarQube.MSBuild.PostProcessor.exe
Args:
Working directory: C:\Builds\1\Essai2\WpfApplication2\sqtemp\bin
Timeout (ms):3600000
Process id: 6548
01:45:28: Legacy TeamBuild environment detected
01:45:28: Loading the SonarQube analysis config from C:\Builds\1\Essai2\WpfApplication2\sqtemp\conf\SonarQubeAnalysisConfig.xml
01:45:28: Legacy TeamBuild environment detected
01:45:28: Attempting to locate the CodeCoverage.exe tool...
01:45:28: Code coverage command line tool: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Team Tools\Dynamic Code Coverage Tools\CodeCoverage.exe
01:45:28: Fetching code coverage report information from TFS...
01:45:28: Connecting to TFS...
01:45:29: Fetching build information...
01:45:30: Fetch code coverage report info...
01:45:52: Operation timed out, Elapsed time (ms): 20358
01:45:52: ...done.
01:45:52: No code coverage reports were found for the current build.
01:45:52: Generating SonarQube project properties file to C:\Builds\1\Essai2\WpfApplication2\sqtemp\out\sonar-project.properties
01:45:52: No ProjectInfo.xml files were found. Check that the analysis targets are referenced by the MSBuild projects being built.
01:45:52: Writing processing summary to C:\Builds\1\Essai2\WpfApplication2\sqtemp\out\ProjectInfo.log
01:45:52: Generation of the sonar-properties file failed. Unable to complete SonarQube analysis.
01:45:52: Updating the TeamBuild summary...
Process returned exit code 1
Exception Message: TF270015: 'SonarQube.MSBuild.Runner.exe' returned an unexpected exit code. Expected '0'; actual '1'. See the build logs for more details. (type UnexpectedExitCodeException) Exception Stack Trace: at System.Activities.Statements.Throw.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
Handle Exception
Troubleshooting issues with the MSBuild.Runner v0.9
The following information is provided to help troubleshooting issues with version 0.9 of the MSBuild.Runner. The behaviour may change in later versions.
Most serious configuration issues will result in warnings or errors that will appear on the Build Summary page. In cases in which there are no errors or warnings reported, check the TFS TeamBuild diagnostic output (click on "Diagnostics" link at the top of the build summary report in Visual Studio). Both the pre- and post-processor steps log quite a lot of information to help diagnose issues.
1. Check the SonarQube Analysis Summary section appears in the Build Summary Report
The section should look like this:
SonarQube Analysis Summary
Analysis failed for SonarQube project "Simple console app", version 1.0
Product projects: 4, test projects: 2
Invalid projects: 0, skipped projects: 0, excluded projects: 0
If the section does not appear on the build summary page then there are configuration issues with the build agent, build definition, or both. Read the steps below to diagnose these further.
1.1 Check the number of projects that are reported in the summary
If no projects were found then it suggests that the integration targets are not being imported and used during the build.
If all of the projects are marked as invalid, it is likely that you are building more than one configuration e.g. [release or debug] | [x86 or x64]. You should also get an error saying no ProjectInfo.xml files could be found.
You can only analyse one configuration at a time. If you want to analyze both release and debug builds, then you will need to create a separate build definition for each, using different SonarQube project ids.
The diagnostic log will contain more infomation about why a project was invalid, which is normally because the project doesn't have a guid, or the guid is not unique. The normal reason for a non-unique guid is that you are building multiple configurations e.g. release and debug.
2. Check that the pre-build step is being executed
The diagnostic output should contain output similar to the following:
Run optional script before MSBuild
C:\SonarQube\bin\SonarQube.MSBuild.Runner.exe /key:MyProject /name:"My Project" /version:1.0
Pre-processing (3 arguments passed)
If it doesn't, check that the you are correctly calling SonarQube.MSBuild.Runner.exe in the "Pre-build script" step in the build definition. An easy mistake is to put the script parameters in the wrong box by setting the "Post-build" properties instead (unhelpfully, the Post-build fields in the UI appear before the Pre-build fields).
2. Check that the post-build step is being executed
The diagnostic output should contain output similar to the following:
Run optional script after Test Runner
C:\SonarQube\bin\SonarQube.MSBuild.Runner.exe
Post-processing (no arguments passed)
If it doesn't, check that the you are correctly calling SonarQube.MSBuild.Runner.exe in the "Post-test script" step in the build definition.
3. Check the rest of the diagnostic log
If the pre- and post- build steps are being executed correctly, check the rest of the diagnostic output for any clues as to what isn't working. Pay particular attention to messages from the pre- and post-processor about the directories and files they are writing to.
4. Check the files that have been created on the build agent
The analysis process creates temporary files under the build directory under a folder called SQTemp in v0.9.
Examining the contents of the folders can help determine the stage at which the analysis is failing.
The expected folders are as follows:
bin: this folder contains the analysis targets and binaries. It is created by the SonarQube.MSBuild.Runner.exe which downloads the files from the SonarQube server. If this folder does not exist or is empty then the analysis failed at a very early stage and there should warnings or errors. Check that the C# plugin v4 is installed correctly on the SonarQube server, and that the SonarQube has been restarted since the plugin was installed.
conf: this folder is created during pre-processing and contains the settings downloaded from the SonarQube server. If there are any FxCop rules active in the SonarQube the folder should contain an FxCop ruleset.
out: this folder is populated during the MSBuild phase. It should contain one folder per project being built. It will also contain the generated sonar-project.properties file that is passed to the sonar-runner. If the folder is empty then it is possible the SonarQube.Integration.targets are not being imported correctly.
The error message "No ProjectInfo.xml files were found" will normally appear in this case. The ProjectInfo.xml files are generated by the target "WriteSonarQubeData" in the SonarQube.Integration.targets, so the next thing to check is that SonarQube.Integration.targets are being imported correctly and the expected targets are being executed.
5. Checking the SonarQube.Integration.targets are imported and called
Firstly, double-check the installation of the SonarQube.Integration.ImportBefore.targets file:
check it is in the correct folder for the version of MSBuild you are using i.e. %ProgramFiles(x86)%\MSBuild\[12.0 or 14.0]\Microsoft.Common.Targets\ImportBefore
check for typos in the folder name "ImportBefore" (should be singular, not plural)
(Thanks to Richard from BlackMarble for this tip).
If the targets are installed correctly then you will need to increase the verbosity of the MSBuild logging to diagnostic and build again so you can check the detailed MSBuild output. Unfortunately, there doesn't seem to be a simple way to increase the verbosity of the MSBuild logs when running under TeamBuild 2013. You can produce an additional log file with more detail, but you will need access to the build agent machine to pick up the log file.
To create an MSBuild log with more detailed info:
select "Queue New Build" from the BUILD menu in Visual Studio
click on the "Parameters" tab.
Expand the "2. Build" section and the "5. Advanced" sections
Set the "MSBuild arguments" property to the following:
/m:1 /fl2 /flp2:"verbosity=diagnostic"
The "/m:1" tells MSBuild not to build in parallel which can make the log easier to read. The other two parameters tell MSBuild to log to a file. See the MSBuild command line help for more info.
Click "Queue" and wait for the build to finish.
Find and open the log on the build agent. It should be called msbuild2.log and be under the source directory for your build definition.
If the SonarQube.Intergration.ImportBefore.targets are being executed, there will be a log entry saying the "SonarQubeImportBeforeInfo" target was executed. There should be some output message saying whether the file "SonarQube.Integration.targets" was located or not.
The ProjectInfo.xml files are written by the target "WriteSonarQubeProjectData". The log should show that this target has been executed, and the "WriteProjectInfoFile" task has executed. If not, the log should give an idea of why the targets were skipped.
I am using Dart Editor|
Dart Editor version 1.10.0.dev_01_01 (DEV)
Dart SDK version 1.10.0-dev.1.1
I open polymer_snippet and run the app and it executes as expected.
I attempted to run epimss_app but it does not run and displays the following errors to Tools Ouput (console)
--- 1:20:06 PM Starting pub serve : polymer_snippet ---
Loading source assets...
The null object does not have a getter 'pubspec'.
NoSuchMethodError: method not found: 'pubspec'
Receiver: null
Arguments: []
dart:core Object.noSuchMethod
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib\_internal\pub\lib\src\barback\dependency_computer.dart 48 DependencyComputer.DependencyComputer.<fn>
dart:collection SetMixin.every
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib\_internal\pub\lib\src\barback\dependency_computer.dart 47 DependencyComputer.DependencyComputer
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib\_internal\pub\lib\src\barback\load_all_transformers.dart 33 loadAllTransformers.<async>
dart:isolate _RawReceivePortImpl._handleMessage
This is an unexpected error. Please run
pub --trace 'serve' 'web' '--port' '8080' '--admin-port' '49923' '--hostname' 'localhost'
and include the results in a bug report on http://dartbug.com/new.
I tried to run polymer-snippet again with the same result. I closed Dart Editor did a pub cache repair and attempted running either application again with the same result.
The GUI (if dart-eclipse-editor is used) says Error Launching application - Could not start pub serve or connect to pub.
Why is this happening? I would expect to be able to change from one dart app to another and run either without any issues.
Thanks
I am developing an iOS application using Xamarin.iOS and Visual Studio.
When I debug on the iPhone Simulator, it works great. But if I try to build the app with iPhone configuration, it doesn't work.
When I build the app, the debug output display this :
(_BuildNativeApplication cible) ->
C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.MonoTouch.Common.targets(148,3): error : Remote build step failed. [C:...csproj]
C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.MonoTouch.Common.targets(148,3): error : [C:...csproj]
C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.MonoTouch.Common.targets(148,3): error : Remote build step failed. [C:....csproj]
0 Warning(s)
2 Error(s)
Temps ‚coul‚ 00:01:56.41
However, the Mac Server Log output indicates that the build is not stopped. But it shows this error for all my views:
[2013-07-10 18:32:58.2] Warning: Fail moving file /Users/me/Library/Caches/Xamarin/mtbs/builds/myProj/7855596c-fbd7-487f-a36f-3b8d9c6493c0/output/Release/iPhone/myProj.app/View.nib to bundle dir: /Users/me/Library/Caches/Xamarin/mtbs/builds/myProj/7855596c-fbd7-487f-a36f-3b8d9c6493c0/bundle/myProj.app/View.nib
[2013-07-10 18:32:58.2] Warning: Exception type: System.IO.FileNotFoundException
[2013-07-10 18:32:58.2] /Users/me/Library/Caches/Xamarin/mtbs/builds/myProj/7855596c-fbd7-487f-a36f-3b8d9c6493c0/output/Release/iPhone/myProj.app/View.nib does not exist
[2013-07-10 18:32:58.2] at System.IO.File.Move (System.String sourceFileName, System.String destFileName) [0x00000] in <filename unknown>:0
[2013-07-10 18:32:58.2] at MonoTouch.Tools.Tools.IBTool.MoveIBFileToBundleDirectory (System.String path) [0x00000] in <filename unknown>:0
and it ends with
[2013-07-10 18:33:14.8] Command [Build: CommmandUrl=Build] finished (110)
So my idea was to take the created app file (from [2013-07-10 18:33:14.8] Command [Build: CommmandUrl=Build] finished (110) ) and add it manually on the device (with iTunes).
The install works but when I launch the app, I just can see the UI elements I created in the C# code, all the elements created in the .xib are unreachable and invisible.
After that, I tried to follow this guide for ad-hoc deployment : http://docs.xamarin.com/guides/ios/deployment,_testing,_and_metrics/app_distribution_overview/ipa_support_for_ad_hoc_and_enterprise_deployment but the install never starts using iTunes.
Does someone have a solution to deploy a Xamarin.iOS app from Visual Studio? (I clarify I have 8 xib files in my project and all of theme are defined as InterfaceDefinition (for the generation)).
I had this problem too after making updates.
The solution was to change the two systems for the stable version.
It was in alpha.
Do not forget to close and reopen VS. In my case did update the sdk.