-
Notifications
You must be signed in to change notification settings - Fork 635
Open
Description
With LOG_BUILD_COMMANDLINES, I can see that sccache -- behind the scenes -- was evidently trying to execute something to the effect of testing that the compiler functions?!
CL -E C:\Users\OSCHNE~1\AppData\Local\Temp\sccacheLnjRtT\testfile.c
CL -nologo -showIncludes -c -Fonul -I. C:\Users\OSCHNE~1\AppData\Local\Temp\sccacheUtHbTK\test.c
In the build output I see:
1> [2023-07-12T10:20:36Z DEBUG sccache::commands] Server sent UnsupportedCompiler: "Failed to detect showIncludes prefix"
2> [2023-07-12T10:20:36Z DEBUG sccache::commands] Server sent UnsupportedCompiler: "Failed to detect showIncludes prefix"
2> sccache : error : failed to execute compile
What I am doing is to "inject" sccache as cl.exe in PATH via a Directory.Build.props:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" InitialTargets="LogBuild">
<PropertyGroup>
<ThisProjectBuildLogFileName Condition="'$(MSBuildProjectName)' == ''">$(MSBuildThisFileDirectory)BuildCommandLines.log</ThisProjectBuildLogFileName>
<ThisProjectBuildLogFileName Condition="'$(MSBuildProjectName)' != ''">$(MSBuildThisFileDirectory)BuildCommandLines-$(MSBuildProjectName).log</ThisProjectBuildLogFileName>
<PreferredToolArchitecture Condition="'$(PreferredToolArchitecture)' == '' and ('$(PROCESSOR_ARCHITECTURE)' == 'AMD64')">x64</PreferredToolArchitecture>
</PropertyGroup>
<Target Name="LogBuild" BeforeTargets="SetUserMacroEnvironmentVariables;SetBuildDefaultEnvironmentVariables">
<Message Text="Setting LOG_BUILD_COMMANDLINES='$(ThisProjectBuildLogFileName)'" />
<SetEnv Name="LOG_BUILD_COMMANDLINES" Value="$(ThisProjectBuildLogFileName)" Prefix="false" />
<SetEnv Name="PreferredToolArchitecture" Value="$(PreferredToolArchitecture)" Prefix="false" />
</Target>
<Target Name="FindSccacheExecutableInPath" BeforeTargets="SetModuleDependencies">
<PropertyGroup>
<ExecutableToFind>sccache.exe</ExecutableToFind>
</PropertyGroup>
<ItemGroup>
<ExecPaths Include="$([System.Environment]::GetEnvironmentVariable('PATH').Split(';'))" />
<FilteredExecPaths Include="@(ExecPaths)" Condition="exists('%(FullPath)\$(ExecutableToFind)')" />
<FilteredExecPaths Include="@(FilteredExecPaths->Reverse())" Condition="exists('%(FullPath)\$(ExecutableToFind)')" />
</ItemGroup>
<PropertyGroup>
<SccacheExecutableFullPath Condition="'%(FilteredExecPaths.Identity)' != ''">%(FilteredExecPaths.Identity)\$(ExecutableToFind)</SccacheExecutableFullPath>
<SccacheExecutableFullPath Condition="'%(FilteredExecPaths.Identity)' == ''"></SccacheExecutableFullPath>
</PropertyGroup>
<Message Importance="high" Text="sccache.exe = '$(SccacheExecutableFullPath)'" />
</Target>
<Target Name="DetectSccacheVersion" BeforeTargets="SetModuleDependencies" DependsOnTargets="FindSccacheExecutableInPath">
<Exec Command=""$(SccacheExecutableFullPath)" --version" EchoOff="true" ConsoleToMsBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="SccacheVersion" />
</Exec>
<Message Importance="high" Text="sccache version = '$(SccacheVersion)'" />
</Target>
<Target Name="EnableSccache" DependsOnTargets="DetectSccacheVersion" BeforeTargets="SetModuleDependencies">
<PropertyGroup>
<CompileCacheDir>$(MsbuildThisFileDirectory)sccache\</CompileCacheDir>
<CompileCacheActualCacheDir>$(CompileCacheDir)cache\</CompileCacheActualCacheDir>
<CompileCacheWrapperBinDir>$(CompileCacheDir)bin\</CompileCacheWrapperBinDir>
</PropertyGroup>
<SetEnv Name="SCCACHE_DETECTED" Value="$(SccacheExecutableFullPath)" Prefix="false" />
<SetEnv Name="SCCACHE_DIR" Value="$(CompileCacheActualCacheDir)" Prefix="false" />
<SetEnv Name="SCCACHE_ERROR_LOG" Value="$(CompileCacheDir)sccache.log" Prefix="false" />
<SetEnv Name="SCCACHE_LOG" Value="debug" Prefix="false" />
<!--SCCACHE_RECACHE=1 SCCACHE_START_SERVER=1 SCCACHE_NO_DAEMON=1-->
<ItemGroup>
<WrapperBinaries Include="$(CompileCacheWrapperBinDir)cl.exe" />
<WrapperBinaries Include="$(CompileCacheWrapperBinDir)clang-cl.exe" />
<SourceBinaries Include="$(SccacheExecutableFullPath)" />
<SourceBinaries Include="$(SccacheExecutableFullPath)" />
</ItemGroup>
<Copy SourceFiles="@(SourceBinaries)" DestinationFiles="@(WrapperBinaries)" UseHardlinksIfPossible="true" SkipUnchangedFiles="true" />
<MakeDir Directories="$(SCCACHE_DIR)" />
<SetEnv Name="PATH" Value="$(CompileCacheWrapperBinDir);@(ExecPaths)" Prefix="false" />
<Message Importance="high" Text="PATH = '$(PATH)'" />
</Target>
</Project>
But apparently it fails early on. Any hints how to debug and provide more a meaningful defect report? Going by the documentation this ought to work, no?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels