From 242a5225f12b206800e663d412e24e4093a72ca4 Mon Sep 17 00:00:00 2001 From: Chris Rummel Date: Wed, 8 Jan 2020 12:28:20 -0600 Subject: [PATCH 1/6] Add *.cache to excluded files when copying ref packages. --- .../CopyReferenceOnlyPackages.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat/CopyReferenceOnlyPackages.cs b/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat/CopyReferenceOnlyPackages.cs index 415b613db0..54f355f68f 100644 --- a/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat/CopyReferenceOnlyPackages.cs +++ b/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat/CopyReferenceOnlyPackages.cs @@ -20,7 +20,7 @@ namespace Microsoft.DotNet.SourceBuild.Tasks /// public class CopyReferenceOnlyPackages : Task { - private static readonly string[] extensionsToExclude = { ".exe", ".dylib", ".so", ".profdata", ".pgd", ".a" }; + private static readonly string[] extensionsToExclude = { ".exe", ".dylib", ".so", ".profdata", ".pgd", ".a", ".cache" }; private static readonly string[] pathsToExclude = { "testdata" }; private static readonly string refPath = string.Concat(Path.DirectorySeparatorChar, "ref", Path.DirectorySeparatorChar); From 6625697e0c874b981e775200654ed808ffa94937 Mon Sep 17 00:00:00 2001 From: Chris Rummel Date: Wed, 8 Jan 2020 14:33:26 -0600 Subject: [PATCH 2/6] Think this might be the better approach. --- .../CopyReferenceOnlyPackages.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat/CopyReferenceOnlyPackages.cs b/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat/CopyReferenceOnlyPackages.cs index 54f355f68f..4377f4e62f 100644 --- a/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat/CopyReferenceOnlyPackages.cs +++ b/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat/CopyReferenceOnlyPackages.cs @@ -20,8 +20,8 @@ namespace Microsoft.DotNet.SourceBuild.Tasks /// public class CopyReferenceOnlyPackages : Task { - private static readonly string[] extensionsToExclude = { ".exe", ".dylib", ".so", ".profdata", ".pgd", ".a", ".cache" }; - private static readonly string[] pathsToExclude = { "testdata" }; + private static readonly string[] extensionsToExclude = { ".exe", ".dylib", ".so", ".profdata", ".pgd", ".a" }; + private static readonly string[] pathsToExclude = { "testdata", "obj", "bin", "Debug", "Release" }; private static readonly string refPath = string.Concat(Path.DirectorySeparatorChar, "ref", Path.DirectorySeparatorChar); /// From 543748802dd3176ec8283c1b6b3521eb1602c7e1 Mon Sep 17 00:00:00 2001 From: Chris Rummel Date: Wed, 8 Jan 2020 16:19:45 -0600 Subject: [PATCH 3/6] See if we can do without this package. This additionally reverts commit 6625697e0c874b981e775200654ed808ffa94937. --- support/additional-prebuilts-to-delete.txt | 3 +++ .../CopyReferenceOnlyPackages.cs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/support/additional-prebuilts-to-delete.txt b/support/additional-prebuilts-to-delete.txt index 6ca76213d8..0b325aeadd 100644 --- a/support/additional-prebuilts-to-delete.txt +++ b/support/additional-prebuilts-to-delete.txt @@ -22,6 +22,9 @@ microsoft.sourcelink.common.1.0.0-beta2-18618-05.nupkg microsoft.sourcelink.github.1.0.0-beta2-18618-05.nupkg microsoft.sourcelink.vsts.git.1.0.0-beta2-18618-05.nupkg microsoft.visualstudio.setup.configuration.interop.1.16.30.nupkg +# this should just be some text templates, but 1.5.3 appears to mistakely contain +# actual binary files which causes our ref-only package detection to fail. +nunit3.dotnetnew.template.1.5.3.nupkg runtime.*.runtime.native.system.security.cryptography.apple.*.nupkg runtime.*.runtime.native.system.security.cryptography.openssl.*.nupkg runtime.linux-x64.microsoft.netcore.dotnetapphost.*.nupkg diff --git a/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat/CopyReferenceOnlyPackages.cs b/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat/CopyReferenceOnlyPackages.cs index 4377f4e62f..54f355f68f 100644 --- a/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat/CopyReferenceOnlyPackages.cs +++ b/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat/CopyReferenceOnlyPackages.cs @@ -20,8 +20,8 @@ namespace Microsoft.DotNet.SourceBuild.Tasks /// public class CopyReferenceOnlyPackages : Task { - private static readonly string[] extensionsToExclude = { ".exe", ".dylib", ".so", ".profdata", ".pgd", ".a" }; - private static readonly string[] pathsToExclude = { "testdata", "obj", "bin", "Debug", "Release" }; + private static readonly string[] extensionsToExclude = { ".exe", ".dylib", ".so", ".profdata", ".pgd", ".a", ".cache" }; + private static readonly string[] pathsToExclude = { "testdata" }; private static readonly string refPath = string.Concat(Path.DirectorySeparatorChar, "ref", Path.DirectorySeparatorChar); /// From 75026cdffe3ed8c5c05713ef49c993c6b1e338fa Mon Sep 17 00:00:00 2001 From: Chris Rummel Date: Thu, 9 Jan 2020 15:40:06 -0600 Subject: [PATCH 4/6] Another attempt. --- support/additional-prebuilts-to-delete.txt | 3 --- .../CopyReferenceOnlyPackages.cs | 7 ++++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/support/additional-prebuilts-to-delete.txt b/support/additional-prebuilts-to-delete.txt index 0b325aeadd..6ca76213d8 100644 --- a/support/additional-prebuilts-to-delete.txt +++ b/support/additional-prebuilts-to-delete.txt @@ -22,9 +22,6 @@ microsoft.sourcelink.common.1.0.0-beta2-18618-05.nupkg microsoft.sourcelink.github.1.0.0-beta2-18618-05.nupkg microsoft.sourcelink.vsts.git.1.0.0-beta2-18618-05.nupkg microsoft.visualstudio.setup.configuration.interop.1.16.30.nupkg -# this should just be some text templates, but 1.5.3 appears to mistakely contain -# actual binary files which causes our ref-only package detection to fail. -nunit3.dotnetnew.template.1.5.3.nupkg runtime.*.runtime.native.system.security.cryptography.apple.*.nupkg runtime.*.runtime.native.system.security.cryptography.openssl.*.nupkg runtime.linux-x64.microsoft.netcore.dotnetapphost.*.nupkg diff --git a/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat/CopyReferenceOnlyPackages.cs b/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat/CopyReferenceOnlyPackages.cs index 54f355f68f..9f8fdd6daf 100644 --- a/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat/CopyReferenceOnlyPackages.cs +++ b/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat/CopyReferenceOnlyPackages.cs @@ -20,7 +20,8 @@ namespace Microsoft.DotNet.SourceBuild.Tasks /// public class CopyReferenceOnlyPackages : Task { - private static readonly string[] extensionsToExclude = { ".exe", ".dylib", ".so", ".profdata", ".pgd", ".a", ".cache" }; + private static readonly string[] extensionsToExclude = { ".exe", ".dylib", ".so", ".profdata", ".pgd", ".a" }; + private static readonly string[] extensionsToRemove = { ".cache" }; private static readonly string[] pathsToExclude = { "testdata" }; private static readonly string refPath = string.Concat(Path.DirectorySeparatorChar, "ref", Path.DirectorySeparatorChar); @@ -91,6 +92,10 @@ public override bool Execute() { foreach (var file in EnumerateAllFiles(dir, "*")) { + if (extensionsToRemove.Contains(Path.GetExtension(file)) + { + // skip these files + } if (file.EndsWith(".nupkg")) { File.Copy(file, Path.Combine(IdentifiedPackagesDir, Path.GetFileName(file)), true); From 053c9b9e8fb9f7a4e13c05ab6f3ebe30b915e1bd Mon Sep 17 00:00:00 2001 From: Chris Rummel Date: Mon, 13 Jan 2020 14:41:42 -0600 Subject: [PATCH 5/6] Fix parenthesis --- .../CopyReferenceOnlyPackages.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat/CopyReferenceOnlyPackages.cs b/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat/CopyReferenceOnlyPackages.cs index 9f8fdd6daf..8c589bb1c0 100644 --- a/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat/CopyReferenceOnlyPackages.cs +++ b/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat/CopyReferenceOnlyPackages.cs @@ -92,7 +92,7 @@ public override bool Execute() { foreach (var file in EnumerateAllFiles(dir, "*")) { - if (extensionsToRemove.Contains(Path.GetExtension(file)) + if (extensionsToRemove.Contains(Path.GetExtension(file))) { // skip these files } From 921f7f2618145537fde0618e076bd5d6ae1e5d62 Mon Sep 17 00:00:00 2001 From: Chris Rummel Date: Thu, 16 Jan 2020 09:18:31 -0600 Subject: [PATCH 6/6] Short-circuit checks for excluded files. --- .../CopyReferenceOnlyPackages.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat/CopyReferenceOnlyPackages.cs b/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat/CopyReferenceOnlyPackages.cs index 8c589bb1c0..e173145c11 100644 --- a/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat/CopyReferenceOnlyPackages.cs +++ b/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat/CopyReferenceOnlyPackages.cs @@ -96,7 +96,7 @@ public override bool Execute() { // skip these files } - if (file.EndsWith(".nupkg")) + else if (file.EndsWith(".nupkg")) { File.Copy(file, Path.Combine(IdentifiedPackagesDir, Path.GetFileName(file)), true); }