Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build generates multiple tlog folders #741

Closed
tersers opened this issue Jun 28, 2016 · 1 comment
Closed

Build generates multiple tlog folders #741

tersers opened this issue Jun 28, 2016 · 1 comment
Labels

Comments

@tersers
Copy link

tersers commented Jun 28, 2016

When building my project, I'm getting a warning from MSBuild saying:

MSB8028: The intermediate directory (<intermediate directory here>) contains files shared from another project (<project name here>)

What's interesting is the shared project name is the exact same as the project I'm currently building. Upon investigation into the folder it complains about, I noticed MSBuild is sometimes creating multiple tlog folders. Since the name of my project is long, the folder hierarchy looks something like this:

|-IntermediateDir
    |-MyProjectNameIsL.123454678.tlog
    |-MyProjectNameIsL.ABCDEFGH.tlog

Note that MyProjectNameIsL is not a typo, it is to exemplify the length of my project's name and why MSBuild appears to serialize it. For the purpose of this question the name of the project is MyProjectNameIsLong.

If I delete these folders, it works fine for the first build but reports a warning for the second. It appears that MSBuild forgets about the existence of the original tlog folder and just creates a new one. Why is this the case?

@rainersigwald
Copy link
Member

rainersigwald commented Jun 30, 2016

This message comes from the C++ targets. On my machine it's from c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets:

<!-- lastbuildstate is a unique file writen to by each build. Multiple of this file can mean that the IntDir is shared by more the one project. -->
<ItemGroup>
  <AllTlogLocation Include="$(IntDir)*.tlog\*.lastbuildstate" Exclude="$(LastBuildState)" Condition="'$(IntDirSharingDetected)' == ''"/>
</ItemGroup>

<PropertyGroup>
  <IntDirSharingDetected Condition="'@(AllTlogLocation)' != ''">true</IntDirSharingDetected>
  <IntDirSharingProjects Condition="'@(AllTlogLocation)' != ''">@(AllTlogLocation->'%(Filename).vcxproj', ', ')</IntDirSharingProjects>
</PropertyGroup>

<VCMessage Code="MSB8028" Type="Warning" Arguments="$(IntDirSharingProjects);$(IntDir)" Condition="'$(IgnoreWarnIntDirSharingDetected)' != 'true' and '$(IntDirSharingDetected)' == 'true'"/>

LastBuildState is written to TLogLocation, which is defined in C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.BuildSteps.Targets:

<!-- TLogLocation requires trailing slash. -->
<TLogLocation Condition="'$(TLogLocation)' == '' and '$(ProjectName)' != '' and '$(ProjectGuid)' != '' and '$(ProjectName.Length)' &gt; '16'">$(IntDir)$(ProjectName.Substring(0,8)).$(ProjectGuid.Substring(1,8)).tlog\</TLogLocation>
<TLogLocation Condition="'$(TLogLocation)' == ''">$(IntDir)$(ProjectName).tlog\</TLogLocation>

That explains the truncated names and the numbers. Do you perhaps have multiple projects with the same name prefix and different project GUIDs?

The C++ targets aren't open source and are supported by the C++ team, not the MSBuild team that works in this repo, so the best thing to do would be to use their support channels. But the IgnoreWarnIntDirSharingDetected property looks interesting . . .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants