How to get CruiseControl.NET working with Mercurial: "Source control failure (GetModifications)" - mercurial

I'm trying to set up CruiseControl.NET 1.5.7256.1 for automatic builds. My project is stored in Mercurial, and I'm using the following ccnet.config:
<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
<project name="Slider" webURL="http://localhost/ccnet">
<triggers>
<intervalTrigger seconds="3600" />
</triggers>
<sourcecontrol type="hg" autoGetSource="true">
<executable>C:\Python26\Scripts\hg.bat</executable>
<repo>c:\repos\slider</repo>
<workingDirectory>c:\ccnet\slider</workingDirectory>
</sourcecontrol>
<tasks>
<msbuild>
<executable>C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe</executable>
<workingDirectory>c:\ccnet\slider</workingDirectory>
<projectFile>Slider.sln</projectFile>
<buildArgs>/noconsolelogger /p:Configuration=Debug /v:diag</buildArgs>
<targets>Slider</targets>
<timeout>900</timeout>
<logger>C:\Program Files (x86)\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll</logger>
</msbuild>
</tasks>
</project>
</cruisecontrol>
But when I force a build, I get this error:
[Slider:WARN] Source control failure (GetModifications): Source control operation failed: < was unexpected at this time.
. Process command: C:\Python26\Scripts\hg.bat log -r 0:123 --template <modification><node>{node|short}</node><author>{author|user}</author><date>{date|rfc822date}</date><desc>{desc|escape}</desc><rev>{rev}</rev><email>{author|email|obfuscate}</email><files>{files}</files></modification> --noninteractive
[Slider:INFO] Integration complete: Exception - 12/2/2010 1:19:08 PM
The error is presumably caused by the unquoted angle brackets in the --template parameter, but how can I make CC.NET put quotes around that parameter?
===============
Here's hg.bat:
#echo off
rem Windows Driver script for Mercurial
setlocal
set HG=%~f0
rem Use a full path to Python (relative to this script) as the standard Python
rem install does not put python.exe on the PATH...
rem %~dp0 is the directory of this script
%~dp0..\python "%~dp0hg" %*
endlocal

I'm successfully using CruiseControl.NET 1.5.7256.1 with Mercurial installed from this msi, using full path of hg.exe as the executable value.
In project\core\sourcecontrol\Mercurial\Mercurial.cs the template is used like this:
buffer.AddArgument("--template", HistoryTemplate)
and will be formatted for the command line like this:
string.Format("{0}{1}{2}", arg, separator, StringUtil.AutoDoubleQuoteString(value))
where the separator is " ", and AutoDoubleQuoteString will quote the template, so this can't be the cause of the error.
UPDATE 1
Actually, AutoDoubleQuoteString should quote the template, but in the current version doesn't do it. Also, even if the build succeeds when using hg.exe, running the actual command line in a command prompt returns the same error.
UPDATE 2
CruiseControl.NET 1.6.7981.1 was just released (see release notes), and since the template is now passed as a file, it works just fine (at least on my PC).

Related

TeamCity configuarion for nUnit run

I have an issue with setting up TeamCity for nUnit run and below lines are added for edit assembly files.
"%system.NUNIT_EXE%"
"%env.ROOT_FOLDER%\FunctionalTests\bin\Debug\Test.dll" /nologo
/framework=4.0.30319 /labels /xml=c:\simulator\TestBox.xml
/fixture:Instron.Tests.Test_FunctionalTests
I get the error message saying when I run TeamCity.
Failed to parse TeamCity implicit arguments. Illegal characters in
path.
System.ArgumentException: Illegal characters in path.
at System.IO.Path.CheckInvalidPathChars(String path)
at System.IO.Path.IsPathRooted(String path)
at JetBrains.TeamCity.Utils.FsScanner.RealFileSystem.IsPathAbsolute(String
path)
at
JetBrains.TeamCity.Utils.FsScanner.DirectoryScanner.ParsePattern(IFileSystem
fs,
Wildcard[] rootPrefix, Boolean caseSensitive, String pattern)
You can find the parameters in the project settings on the Administration page. Use the Add new parameter button to add the parameters for your build.
Check the official documentation to get more information.

dtexec error "The connection xxx is not found" with Project deployment model

When running DTEXEC I am getting "The connection xxxx is not found".
I beleieve this is because the connection managers are located at Project level and not within the package itself.
When running DTEXECUI - these connection managers are not displayed.
Is the only way to move them into the package - seems a bit weird as what is the point of allowing them a project level if you then have to move them to use them with DTEXEC.
Thanks
Here is the command line syntax you asked for:
C:\Users\Administrator>dtexec /FILE "\"F:\SSIS Projects\HESA\HESA\01 - Upload Metadata Files To Oracle.dtsx\"" /SET "\Package.Variables[User::varYear.Properties
[Value]";"1999" /CHECKPOINTING OFF /REPORTING EW /CONSOLELOG SMT
Your assumption that
the connection managers are located at Project level and not within the package itself
is exactly the problem. But there is a solution:
build the project to get a .ispac file
instead of invoking dtexec with /FILE you have to invoke it with /Project and /Package, like this:
/Project "path to you .ispac file, resulting from building the project"
/Package "Name of your package.dtsx"
Please, be aware that if you provide the whole path to your .dtsx package the execution will fail with very criptic SQLDUMPER error messages.

Error while building tk8.4.19-src

While building tk8.4.19-src by buildall.vc batch file for windows. It is showing following error:
rules.vc(449) : fatal error U1023: syntax error in expression
Stop.
I have no idea about solution. Please help.
Edit: buildall.vc file which is calling nmake
#echo off
:: This is an example batchfile for building everything. Please :: edit this (or make your own) for your needs and wants using :: the instructions for calling makefile.vc found in makefile.vc :: :: RCS: #(#) $Id: buildall.vc.bat,v 1.4 2002/11/04 07:49:43 davygrvy Exp $
echo Sit back and have a cup of coffee while this grinds through ;) echo You asked for *everything*, remember? echo.
title Building Tk, please wait...
if "%MSVCDir%" == "" call "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat" ::if "%MSVCDir%" == "" call "C:\Program Files (x86)\Microsoft Visual Studio
9.0\VC\bin\vcvars32.bat"
set INSTALLDIR =C:\Program Files\Tcl
:: Where is the Tcl source directory? set TCLDIR= "C:\Tcl\include\tcl8.5" ::set TCLDIR=..\..\tcl8.4 pause :: Build the normal stuff along with the help file. :: nmake -nologo -f makefile.vc release winhelp OPTS=none if errorlevel 1 goto error
:: Build the static core, dlls and shell. :: nmake -nologo -f makefile.vc release OPTS=static if errorlevel 1 goto error pause :: Build the special static libraries that use the dynamic runtime. :: nmake -nologo -f makefile.vc core OPTS=static,msvcrt if errorlevel 1 goto error
:: Build the core and shell for thread support. :: nmake -nologo -f makefile.vc release OPTS=threads if errorlevel 1 goto error
:: Build a static, thread support core library (no shell). :: nmake
-nologo -f makefile.vc core OPTS=static,threads if errorlevel 1 goto error
:: Build the special static libraries the use the dynamic runtime, :: but now with thread support. :: nmake -nologo -f makefile.vc core OPTS=static,msvcrt,threads if errorlevel 1 goto error
goto end
:error echo *** BOOM! ***
:end title Building Tk, please wait...DONE! echo DONE! pause
I am using The C++ compiler identification is MSVC 15.0.30729.1
C++ compiler using: Visual Studio 9 2008 Win32
I encountered the same problem while compiling tk 8.6.3
rules.vc(514) : fatal error U1023: syntax error in expression
which is the line
!if exist("$(_TCLDIR)\include\tcl.h")
I had set the TCLDIR macro using quotes around the path.
Removing the quotes made the problem go away for me.
If we look at line 449 of rules.vc in the Tcl 8.4.19 distribution, it looks unremarkable; there are many other lines before it that seem to me to be syntactically similar.
If we look at line 449 of rules.vc in the Tk 8.4.19 distribution, it also looks unremarkable to me; there's nothing there that screams out “I'm wrong” in a way that other preceding lines wouldn't also do.
If we look at the (mangled) code that you added, it's appears to be referring to Tcl 8.5, or maybe Tk 8.5. The equivalent lines for Tcl 8.5.14 and Tk 8.5.14 are also unremarkable. (These versions were selected because they were the current ones at the point where you did your question.) You're strongly recommended to not mix Tcl and Tk of different versions when building Tk (but Tk might load into Tcl of a later version after being built; this is more likely with Tk 8.5 and Tcl 8.6, where at least some effort into checking that this works occasionally).
In short, I can't figure out why it might be complaining about that line in particular.
To cap it all, you're the only person who appears to have this problem. There other people who do build with those files on Windows (and who are quick to complain when we make a real mistake in them) so we've got a fairly high level of confidence that it's not a problem in any version of rules.vc that you appear to have report. This means that whatever is going wrong, it's highly likely to be a problem caused by you doing something strange. Alas, there's too many strange things in this world, and the particular spoor of this one is unfamiliar to me.
Had the same problem.
Disappeared when I made sure that directories tcl8.6.9 and tk8.6.9 are at a position with NO BLANKS in path (NOT in C:\Program Files...) AND when setting environment vars TCLDIR, TCL_LIBRARY and TK_LIBRARY , also NO BLANKS contained AND NO " around paths (
set TCLDIR=C:\tcl8.6.9
REM Not!!! : set TCLDIR="C:\tcl8.6.9"
set TCL_LIBRARY=C:\tcl8.6.9\library
set TK_LIBRARY=C:\tk8.6.9\library
). Now compiling works.

Cmake linking to mysql & curl, LNK2019

Ok so I just started playing around with CMake. I'm trying to build a project which has dependencies on both MySQL and CURL. This is the directory structure:
./
./src
./cmake
CMakeLists.txt
It's really that simple, src only contains 9 Cpp files and a CMakeLists.txt.
When running CMake, everything works fine. I just get a bunch of linker errors due to MySQL and CURL not being effectively linked. What am I doing wrong ?
Root CMakeLists.txt:
PROJECT(IRCBot)
INCLUDE(CPack)
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/FindCURL.cmake)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
FIND_PACKAGE(CURL)
IF(CURL_FOUND)
MESSAGE(STATUS "Curl libraries found at: ${CURL_LIBRARIES}")
MESSAGE(STATUS "Curl includes found at: ${CURL_INCLUDE_DIRS}")
else()
MESSAGE(SEND_ERROR "Could not find cURL on your system")
ENDIF(CURL_FOUND)
FIND_PACKAGE(MySQL)
IF(MYSQL_FOUND)
MESSAGE(STATUS "MySQL found at: ${MYSQL_INCLUDE_DIR}, ${MYSQL_LIBRARIES}")
ELSE(MYSQL_FOUND)
MESSAGE(SEND_ERROR "Couldn't find MySQL include files and/or library")
ENDIF(MYSQL_FOUND)
ADD_SUBDIRECTORY(src)
And ./src/CMakeLists.txt
FILE(GLOB_RECURSE IRCBot_files *.cpp *.h)
SET(IRCBot_src
${IRCBot_files}
)
INCLUDE_DIRECTORIES(
${CURL_INCLUDE_DIRS}
${MYSQL_INCLUDE_DIR}
)
LINK_DIRECTORIES(
${MYSQL_LIBRARIES}
${CURL_LIBRARIES}
)
ADD_EXECUTABLE(IRCBot ${IRCBot_src})
INSTALL(TARGETS IRCBot DESTINATION ${INSTALL_DIR}/bin)
You don't need LINK_DIRECTORIES() call in this case, since it tells compiler where to find libs.
Instead, use
TARGET_LINK_LIBRARIES(IRCBot
${MYSQL_LIBRARIES}
${CURL_LIBRARIES})
because ${MYSQL_LIBRARIES} contains absolute paths.

Integrating Hudson with UCM Clearcase on windows machine

I've installed Hudson on my windows machine and trying to integrate it with UCM Clearcase (the repository we are using).
There are no help docs available on Hudson wiki to explain how to do that.
I select New Job --> Project Name
I give as Test --> select Build a free style software project --> click Ok
--> This leads me to Configure Project screen
--> Under Source Code management I select UCM Clearcase
--> I give a dynamic view name I've already created and the name of the integration stream (in stream selector)
--> Under Advanced options I select "Use UCM dynamic view" and give view root as M:\ and in "Windows dynamic view storage directory" I give \\Hostname\CC_Views\MyTestView.vws.
Now I run the project to check if the fetch in working properly or not and I get this error:
[advcm3_LAC_FN38_Test] $ cleartool pwv -root M:\advcm3_LAC_FN38_Test
[workspace] $ cleartool startview advcm3_LAC_FN38_Test
[advcm3_LAC_FN38_Test] $ cleartool setcs -tag advcm3_LAC_FN38_Test -stream
cleartool: Warning: Config spec OK, but unable to tell view server to load.
cleartool: Warning: View server should be restarted.
cleartool: Error: Unable to change configuration specification: Permission denied.
FATAL: UCM ClearCase failed. exit code=1
java.io.IOException: cleartool did not return the expected exit code. Command line="setcs -tag advcm3_LAC_FN38_Test -stream", actual exit code=1
at hudson.plugins.clearcase.HudsonClearToolLauncher.run(HudsonClearToolLauncher.java:107)
at hudson.plugins.clearcase.HudsonClearToolLauncher.run(HudsonClearToolLauncher.java:70)
at hudson.plugins.clearcase.ClearToolDynamicUCM.setcs(ClearToolDynamicUCM.java:81)
at hudson.plugins.clearcase.ClearToolDynamicUCM.syncronizeViewWithStream(ClearToolDynamicUCM.java:66)
at hudson.plugins.clearcase.action.UcmDynamicCheckoutAction.checkout(UcmDynamicCheckoutAction.java:99)
at hudson.plugins.clearcase.AbstractClearCaseScm.checkout(AbstractClearCaseScm.java:398)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1038)
at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:479)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:411)
at hudson.model.Run.run(Run.java:1257)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:129)
Nothing has been fetched into C:\Hudson\jobs\Test\workspace.
Can someone please guide me in this?
Thanks,
Umang
This is usually symptomatic of an ACL issue.
You need to:
make sure what user are actually running the Hudson Jobs (and with what CLEARCASE_PRIMARY_GROUP environment value)
check the view protection
cd m:\advcm3_LAC_FN38_Test
cleartool lsview -l -full -pro -cview
If the user differ, you need to reprotect the view
fix_prot -force -r -chown rightUser -chgrp rightGroup -chmod 775 \\Hostname\CC_Views\MyTestView.vws.
fix_prot -force -root -chown rightUser -chgrp rightGroup \\Hostname\CC_Views\MyTestView.vws.
fix_prot is in c:/Program Files/rational/clearcase/etc/utils for CC7.0 or less, or c:/Program Files/IBM/RationalSDLC/clearcase/etc/utils for CC7.1 or more.
Note: it is strange that a view called advcm3_LAC_FN38_Test has an associated view storage called MyTestView.vws.
I would have rather expected a \\Hostname\CC_Views\advcm3_LAC_FN38_Test.vws.