Custon build script in Python utilzing blockOpened and blockClosed not reporting output correctly in TeamCity for Windows Builds

I tried to do the worse and put as much information in the title as possible: I have written a custom build script in python to manage execution of our cross-platform builds and I am utilizing "##teamcity[blockOpened]" and "##teamcity[blockClosed]" to wrap my code in order to have nice readable output within teamcity for every step of the build.

For Linux and MacOSX agents executing the build script and viewing the build log correctly has each block and the subsequent command outputs enclosed in the block - great! this is works and this is what I was exepcting

On Windows however, I have all output from the script on top and then each block is on the bottom. If i execute the command from cmd, the output respectvie to each block, just in teamcity build log it doesn't:

Example TeamCity build output on windows:

[18:34:13]Step 1/1: Command Line (14s)
[18:34:13][Step 1/1] Starting: C:\Windows\system32\cmd.exe /c python CI/build.py
[18:34:13][Step 1/1] in directory: C:\BuildAgent\work\f86ed3e06921f904
[18:34:14][Step 1/1] -- The C compiler identification is MSVC 18.0.31101.0
[18:34:14][Step 1/1] -- The CXX compiler identification is MSVC 18.0.31101.0
[18:34:14][Step 1/1] -- Check for working C compiler using: Visual Studio 12 2013
[18:34:14][Step 1/1] -- Check for working C compiler using: Visual Studio 12 2013 -- works
[18:34:14][Step 1/1] -- Detecting C compiler ABI info
[18:34:15][Step 1/1] -- Detecting C compiler ABI info - done
[18:34:15][Step 1/1] -- Check for working CXX compiler using: Visual Studio 12 2013
[18:34:15][Step 1/1] -- Check for working CXX compiler using: Visual Studio 12 2013 -- works
[18:34:15][Step 1/1] -- Detecting CXX compiler ABI info
[18:34:15][Step 1/1] -- Detecting CXX compiler ABI info - done
....
[18:34:28][Step 1/1] Build succeeded.
[18:34:28][Step 1/1] 0 Warning(s)
[18:34:28][Step 1/1] 0 Error(s)
[18:34:28][Step 1/1]
[18:34:28][Step 1/1] Time Elapsed 00:00:03.87
[18:34:28][Step 1/1] CMake <--- One Block
[18:34:28][Step 1/1] Build Unity <--- Second Block

I would expect the CMake output to be in the CMake block, and not above it.

This is how it looks on Linux and MacOSX:

[17:39:52]Step 1/1: Command Line (34s)
[17:39:52][Step 1/1] Starting: python CI/build.py
[17:39:52][Step 1/1] in directory: /home/svccontent/BuildAgent/work/f86ed3e06921f904
[17:39:52][Step 1/1] CMake (2s) <--- First Block, can be expanded to view CMake output
[17:39:55][Step 1/1] Compile (29s) <---- Second block containig compile outut
[17:40:24][Step 1/1] Tests (1s)
[17:40:26][Step 1/1] Importing data from 'build/test_output' (4 KB) with 'gtest' processor
[17:40:26][Step 1/1] Google Test report watcher
[17:40:26][Step 1/1] Process exited with code 0
[17:40:26][Step 1/1] Waiting for 1 service processes to complete
[17:40:26][Step 1/1] Google Test report watcher
[17:40:26]Publishing internal artifacts




Any assistance would be greatly appreciated... Liek I said when I run the command manually in cmd, i see the Block line open, then the subsequent output.

Thank you in advance,

Darren
1 comment
Comment actions Permalink

Hi Darren,

We have the related bug https://youtrack.jetbrains.com/issue/TW-14648, please watch and vote for it.
There is another issue and some suggested workaround in comments, please try them, probably they can help.

0

Please sign in to leave a comment.