I have built a Visual Studio solution, containing 92 projects.
While building them, I get the following line for every one of them:
10>------ Rebuild All started: Project: HostLinkSw, Configuration: Release Win32 ------
(In other words, a line containing "Rebuild All started")
I have found a way to filter out the ones which are not successful, filtering out the errors and the fatals, as follows:
egrep ": fatal |: error " build_output.txt | sort | awk -F ">" '{print $1">"}' | sort -n | uniq
The result of that commandline command is the following:
7>
15>
16>
...
You can guess what I'm looking for: a filter of that second command on the first command result.
I already tried the following but I failed:
grep "Rebuild All started" build_output.txt | egrep $(egrep ": fatal |: error " build_output.txt | sort | awk -F ">" '{print $1">"}' | sort -n | uniq)
I know it should be extremely simple, but I don't see it.
Can anybody help me out?
Edit: Some clarification:
The egrep (or grep -E) yields a multiline result, containing "7>", "15>", "16>", while the "Rebuild" command yields the list of all projects being built.
I would like to filter the list of all project being built based on the erroneous project numbers, something like:
grep 'Rebuild All started' build_output.txt | grep -E "^7>|^15>|^16>"
You might see following difficulties:
- How do I turn the
egrep ": fatal |..."result into a single line? - How do I add
^signs at the beginning of each of the mentioned results (in order to tell the othergrepthat the lines must start with that number)?
Edit2: some more clarification and a partial solution
I have solved my issue in the following way, but we all agree this is extremely ugly:
grep 'Rebuild All started' build_output.txt | grep -E "^7>|^15>|^16>|^39>|^45>|^46>|^47>|^48>|^49>|^51>|^52>|^54>|^55>|^56>|^57>|^58>|^59>|^60>|^61>|^62>|^63>|^64>|^65>|^66>|^67>|^68>|^69>|^71>|^72>|^73>|^74>|^75>|^76>|^77>|^78>|^79>|^80>|^81>|^83>|^84>|^85>|^86>|^87>|^88>|^89>|^90>|^91>"
The list of numbers is obtained by the egrep ": fatal| ..." | awk -F ..., which has been copied into Notepad++, the ^ characters have been added at the beginning and the line endings have been removed.
I have even made two lists: grep -E gives me the list of failing builds, while grep -E -v gives me the list of succeeding builds.
This reduces the urgency of my question, but it should clearly show what I'm looking for.
Edit3: Excerpt of the "build_output.txt" file:
Rebuild started at 11:35...
1>------ Rebuild All started: Project: Ethernet, Configuration: Debug Win32 ------
2>------ Rebuild All started: Project: DTU, Configuration: Debug Win32 ------
3>------ Rebuild All started: Project: Ethernet2, Configuration: Debug Win32 ------
4>------ Rebuild All started: Project: Ethernet3, Configuration: Debug Win32 ------
5>------ Rebuild All started: Project: Ethernet4, Configuration: Debug Win32 ------
6>------ Rebuild All started: Project: HostLink, Configuration: Release Win32 ------
7>------ Rebuild All started: Project: SecurityHelper, Configuration: Debug Any CPU ------
...
7>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(6041,5): error MSB3073: ...
...
15>------ Rebuild All started: Project: TicketPrinting, Configuration: Debug Any CPU ------
...
15>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(6041,5): error MSB3073: ...
...
16>------ Rebuild All started: Project: SecurityProxy, Configuration: Debug Win32 ------
...
16> C:\...\source.cpp(11,1): error C1083: Cannot open type library file: 'securityhelper.tlb': No such file or directory
...
=> Result of "Rebuild" filter: all lines, containing "Rebuild All started", containing the name of the corresponding project
=> Result of the ": error " filter with the awk script: list of project numbers with ">" tag behind, of all failing projects
Question: how to have all "Rebuild" lines (containing the project name) of the (un)successful builds?
Thanks in advance
Dominique
build_output.txtor did you add them to "help"? if the latter, then the help is the opposite of helpful - if the output is munged, that invalidates its usefulness as an example.