From 4684c2257144eebd5c029bf34a80a8080d04450c Mon Sep 17 00:00:00 2001 From: Dylan Perks Date: Mon, 1 Jan 2024 16:33:53 +0000 Subject: [PATCH] That's relativity folks --- sources/SilkTouch/Clang/ResponseFile.cs | 7 +++++-- sources/SilkTouch/SilkTouchGenerator.cs | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sources/SilkTouch/Clang/ResponseFile.cs b/sources/SilkTouch/Clang/ResponseFile.cs index 739d1ca7ae..60060595ba 100644 --- a/sources/SilkTouch/Clang/ResponseFile.cs +++ b/sources/SilkTouch/Clang/ResponseFile.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using ClangSharp; using ClangSharp.Interop; @@ -27,7 +28,7 @@ CXTranslationUnit_Flags TranslationFlags ) { internal string FlatString => - $"{GeneratorConfiguration.OutputLocation}:{GeneratorConfiguration.TestOutputLocation}:" + $"{R(GeneratorConfiguration.OutputLocation)}:{R(GeneratorConfiguration.TestOutputLocation)}:" + $"{GeneratorConfiguration.GenerateLatestCode}:{GeneratorConfiguration.GeneratePreviewCode}:" + $"{GeneratorConfiguration.GenerateCompatibleCode}:{GeneratorConfiguration.Language}:" + $"{GeneratorConfiguration.DefaultClass}:{GeneratorConfiguration.DefaultNamespace}:" @@ -35,7 +36,7 @@ CXTranslationUnit_Flags TranslationFlags + $"{string.Join(',', GeneratorConfiguration.IncludedNames)}:{GeneratorConfiguration.LanguageStandard}:" + $"{GeneratorConfiguration.LibraryPath}:{GeneratorConfiguration.LogExclusions}:" + $"{GeneratorConfiguration.OutputMode}:{string.Join(',', GeneratorConfiguration.RemappedNames)}:" - + $"{string.Join(',', GeneratorConfiguration.TraversalNames)}:" + + $"{string.Join(',', GeneratorConfiguration.TraversalNames.Select(R))}:" + $"{string.Join(',', GeneratorConfiguration.WithAttributes)}:" + $"{string.Join(',', GeneratorConfiguration.WithClasses)}:{string.Join(',', GeneratorConfiguration.WithGuids)}:" + $"{string.Join(',', GeneratorConfiguration.WithNamespaces)}:" @@ -68,4 +69,6 @@ CXTranslationUnit_Flags TranslationFlags + $"{string.Join(',', GeneratorConfiguration.WithSuppressGCTransitions)}:" + $"{GeneratorConfiguration.DontUseUsingStaticsForEnums}:" + $"{GeneratorConfiguration.GenerateSetsLastSystemErrorAttribute}"; + + private static string R(string p) => Path.GetRelativePath(Environment.CurrentDirectory, p); } diff --git a/sources/SilkTouch/SilkTouchGenerator.cs b/sources/SilkTouch/SilkTouchGenerator.cs index 8a73f22fc6..58f1d04b8d 100644 --- a/sources/SilkTouch/SilkTouchGenerator.cs +++ b/sources/SilkTouch/SilkTouchGenerator.cs @@ -129,7 +129,6 @@ public async Task GenerateSyntaxAsync( .Where(x => x.Key.StartsWith($"Jobs:{key}", StringComparison.OrdinalIgnoreCase)) ) + string.Join(',', rsps.Select(x => x.FlatString)) ) - .Replace(Environment.CurrentDirectory, "...", StringComparison.OrdinalIgnoreCase) .Replace('\\', '/') .ToLower(); logger.LogTrace("Cache key for job (before hashing): {}", cacheKey);