visual-studio-2010msbuildincremental-build

File Tracker Log file format


In Visual Studio 2010 incremental builds are done using the File Tracker (Microsoft.Build.Utilities.FileTracker). It seems that it is responsible to the creation of these *.1.tlog files on the intermediate directory.

I couldn't find any reference to the syntax of these .tlog files.
They contain a list of paths to files that are read/written while the tracker tracks the execution of some tool, in order to check which files should be compiled in an incremental build. However, these files also contain some special characters such as "^" and "|".
Another thing I noticed was that these files are sometimes edited from Visual Studio targets files. For example, in Microsoft.CppCommon.targets on CustomBuildStep target I found the following line:

 <!-- Appended tlog to track custom build events -->
    <WriteLinesToFile File="$(IntDir)$(ProjectName).write.1.tlog" Lines="@(CustomBuildStep->'^%(Identity)');@(CustomBuildStep->MetaData('Outputs')->FullPath()->Distinct())"/>

So this probably means that the project file is dependent on the custom build step outputs.

My questions are:

Thanks


EDIT

Another hint:

CanonicalTrackedInputFiles Class is document as "the filetracking log interpreter for .read. tracking logs in canonical form or those that have been rooted (^) to make them canonical"
When I have time I'll dig into it a bit more. Perhaps this class and others under Microsoft.Build.Utilities could be used to help us work with tlog files instead of working with the raw text tlog files directly.

See also: CanonicalTrackedOutputFiles Class, FlatTrackingData Class and of course FileTracker Class.


Solution

  • The tlog file format is now documented here: https://learn.microsoft.com/en-us/visualstudio/extensibility/visual-cpp-project-extensibility?view=vs-2017#tlog-files

    Read .tlog format

    Read .tlog files (.read..tlog) contain information about source files and their dependencies.

    A caret (^) at the beginning of a line indicates one or more sources. Sources that share the same dependencies are separated by a vertical bar (|).

    Dependency files are listed after the sources, each on its own line. All file names are full paths.