-
Notifications
You must be signed in to change notification settings - Fork 5k
Convert sln to slnx #115818
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
Convert sln to slnx #115818
Conversation
@ViktorHofer, @edvilme converted with command: |
We are still missing slngen support for slnx to update all checked in solution files. |
Is there an ETA? There is no activity in months microsoft/slngen#644. |
We can do slngen -> sln -> slnx. That logic is in slngen.proj. |
slngen is broken on main. it needs an update to recognize net10. after updating to "version": "12.0.15", it produces diffs like: diff --git a/src/libraries/Microsoft.Bcl.AsyncInterfaces/Microsoft.Bcl.AsyncInterfaces.sln b/src/libraries/Microsoft.Bcl.AsyncInterfaces/Microsoft.Bcl.AsyncInterfaces.sln
index 580c63b466b..b185f83b4af 100644
--- a/src/libraries/Microsoft.Bcl.AsyncInterfaces/Microsoft.Bcl.AsyncInterfaces.sln
+++ b/src/libraries/Microsoft.Bcl.AsyncInterfaces/Microsoft.Bcl.AsyncInterfaces.sln
@@ -25,13 +25,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{85204CF5-0C8
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gen", "gen", "{D6A9108E-553B-445E-A037-FA4F3140A279}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gen", "tools\gen", "{F4939A3B-3316-4166-8AE6-34E1D0863CF5}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools\gen", "tools\gen", "{F4939A3B-3316-4166-8AE6-34E1D0863CF5}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "tools\src", "{1AC9674D-927D-49C4-BB42-6FF353C84275}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools\src", "tools\src", "{1AC9674D-927D-49C4-BB42-6FF353C84275}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "tools\ref", "{670FB605-56DB-45F0-9B48-F8A62AFE5BD9}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{8F627B90-170F-4BCE-A626-7688EC714FB4}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools\ref", "tools\ref", "{670FB605-56DB-45F0-9B48-F8A62AFE5BD9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -91,12 +89,9 @@ Global
{D0F1936C-CF7C-4448-9F90-B9DEABE89EBB} = {D6A9108E-553B-445E-A037-FA4F3140A279}
{59CE8DDB-AFFD-4C6F-B09F-94DE4DD0AAEA} = {F4939A3B-3316-4166-8AE6-34E1D0863CF5}
{0225750F-4DC0-4C71-9B33-314ACA0EF682} = {F4939A3B-3316-4166-8AE6-34E1D0863CF5}
- {F4939A3B-3316-4166-8AE6-34E1D0863CF5} = {8F627B90-170F-4BCE-A626-7688EC714FB4}
{272C69D8-6BED-4CE0-BD62-9F993989374E} = {1AC9674D-927D-49C4-BB42-6FF353C84275}
{FCA0C2EA-4A82-4B3F-A9B5-E0B5200866BF} = {1AC9674D-927D-49C4-BB42-6FF353C84275}
- {1AC9674D-927D-49C4-BB42-6FF353C84275} = {8F627B90-170F-4BCE-A626-7688EC714FB4}
{9957B23B-3C95-4200-A6D9-F05BAF6DC7A7} = {670FB605-56DB-45F0-9B48-F8A62AFE5BD9}
- {670FB605-56DB-45F0-9B48-F8A62AFE5BD9} = {8F627B90-170F-4BCE-A626-7688EC714FB4}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A835CEDB-E9E2-49EE-8499-BD7FDD984E53} which fails dotnet sln migrate:
the error is correct, new slngen has introduced this bug. |
Any idea which commit in slngen regressed this? |
@kasperk81 From fe4505215d43c0c13a43d3a7382a9ad88134dcb9 Mon Sep 17 00:00:00 2001
From: Viktor Hofer <viktor.hofer@microsoft.com>
Date: Thu, 22 May 2025 09:27:28 +0200
Subject: [PATCH] Add dotnet sln migrate command and update slngen
---
.config/dotnet-tools.json | 2 +-
src/libraries/slngen.proj | 12 ++++++++++--
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
index d5e70ab3de1..ac59f400004 100644
--- a/.config/dotnet-tools.json
+++ b/.config/dotnet-tools.json
@@ -21,7 +21,7 @@
]
},
"microsoft.visualstudio.slngen.tool": {
- "version": "11.1.0",
+ "version": "12.0.15",
"commands": [
"slngen"
]
diff --git a/src/libraries/slngen.proj b/src/libraries/slngen.proj
index 3118a1e1545..c06b8c0e403 100644
--- a/src/libraries/slngen.proj
+++ b/src/libraries/slngen.proj
@@ -8,7 +8,8 @@
<ItemGroup>
<!-- Unless a "/p:SolutionNameOverride" property is passed in, glob all solutions under src/libraries. -->
- <SolutionFile Include="$(MSBuildThisFileDirectory)$(SolutionNameOverride)\*.sln" />
+ <SolutionFile Include="$(MSBuildThisFileDirectory)$(SolutionNameOverride)\*.slnx"
+ Exclude="$(MSBuildThisFileDirectory)Fuzzing\*.slnx" />
</ItemGroup>
<Target Name="UpdateSolutionFile"
@@ -25,12 +26,19 @@
<!-- Delete temporary template file -->
<Delete Files="%(SolutionFile.ProjFilePath)" />
+
+ <!-- Invoke dotnet sln migrate as slngen doesn't support slnx yet. -->
+ <Exec Command=""$(RepoRoot)dotnet$(ScriptExt)" sln migrate "%(SolutionFile.SlnFilePath)"" />
+
+ <!-- Delete the intermediate sln file. -->
+ <Delete Files="%(SolutionFile.SlnFilePath)" />
</Target>
<Target Name="GetSolutionFiles">
<ItemGroup>
<!-- Add attributes that require a separate item mutation. -->
- <SolutionFile ProjFilePath="%(RelativeDir)%(Filename).proj" />
+ <SolutionFile ProjFilePath="%(RelativeDir)%(Filename).proj"
+ SlnFilePath="%(RelativeDir)%(Filename).sln" />
</ItemGroup>
</Target>
</Project>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kasperk81 thanks a lot for the hard work here. I think we can merge this as is and I will submit a follow-up PR with the slngen.proj changes.
thanks @ViktorHofer. i checked |
/ba-g failures are entirely unrelated as we don't build with slnxs. The other changes in this PR got successfully validated. |
@@ -361,7 +361,7 @@ private static string GenerateLocalRunHelperScript(IFuzzer fuzzer) | |||
private static void WorkaroundOneFuzzTaskNotAcceptingMultipleJobs(IFuzzer[] fuzzers) | |||
{ | |||
string yamlPath = Environment.CurrentDirectory; | |||
while (!File.Exists(Path.Combine(yamlPath, "DotnetFuzzing.sln"))) | |||
while (!File.Exists(Path.Combine(yamlPath, "DotnetFuzzing.slnx"))) | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misses sln in error message
fixes #93878