Open vikukush opened 1 year ago
Workaround I'm using to put the output one folder deeper preventing symlink from being deleted.
<Target Name="PatchOutputPath" AfterTargets="AssignTargetPaths">
<!-- wix.exe will delete its own output folder if it's a symlink, this fails only in CloudBuild https://github.com/wixtoolset/issues/issues/7688
Patch output path to be one folder deeper than $(IntermediateOutputPath) -->
<ItemGroup>
<CultureGroup Remove="@(CultureGroup)" />
<CultureGroup Include="en-US" >
<OutputSuffix>en-US</OutputSuffix>
<OutputFolder>en-US\</OutputFolder>
</CultureGroup>
</ItemGroup>
<PropertyGroup>
<IntermediateOutputPath>$(IntermediateOutputPath)en-US\</IntermediateOutputPath>
</PropertyGroup>
</Target>
If this issue is a bug:
I am hitting a problem with wix.exe method of cleanup of temporary files. What I see in Procmon is that wix.exe cleans up temporary files and then tries to recursively delete all non-empty folders. Wix.exe relies on OS to return 145 "Not empty" error code to know when to stop trying to delete. The problem happens when you output to a symlink folder. If you try to delete symlinked folder, it won't return "not empty" error code and will instead successfully remove the symlink, leaving all files intact in symlink's source folder. On the image above, obj\release is an output folder.
Repro steps:
mklink /D E:\FinOps\pl3\Source\Setup\MSIWix\TraceParser\obj\release E:\FinOps\pl3\Source\Setup\MSIWix\TraceParser\a
Actual:
D:\blah\wixtoolset.sdk\4.0.1\tools\wix.targets(928,5): error MSB3030: Could not copy the file "obj\Release\TraceParser.wixpdb" because it was not found.
Expected: