-
-
Notifications
You must be signed in to change notification settings - Fork 265
Make multitarget possible #591
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
Conversation
aed57b6 to
4ca012e
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## restore-dotnetfx #591 +/- ##
====================================================
- Coverage 79.93% 79.72% -0.22%
====================================================
Files 120 121 +1
Lines 4017 4024 +7
Branches 872 873 +1
====================================================
- Hits 3211 3208 -3
- Misses 618 627 +9
- Partials 188 189 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@natemcmaster this PR now almost builds successfully. The only missing bit is that the strong naming does not properly work for .net framework - hence the tests fail. Since I have no knowledge on strong naming whatsoever, can you please help me fix this? |
|
@claude can you provide PR feedback? |
|
Claude encountered an error —— View job PR Review: Multi-targeting Support
|
natemcmaster
left a comment
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.
Thanks for taking time to put this together. Seeing all these little quirks coming back into the code reminds me of why I dropped .NET Framework in the first place. But, I'm still willing to move forward on this. We will need to get CI building and passing tests first.
One the potential issues I'm particularly keen to discuss is ongoing maintenance. I'm the only maintainer here, and I don't developer with windows anymore. If we could make compilation work for .NET Framework on all platforms, that would make it much easier to validate changes locally instead of needing to roundtrip through GitHub actions. I left a few comments on places in csproj that we can adjust to make that work.
As for the strong-naming piece...not sure. I don't know why that would have stopped working or how to fix it.
| if: ${{ github.event.inputs.release }} | ||
| needs: build | ||
| runs-on: ubuntu-latest | ||
| runs-on: windows-latest |
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.
I would generally prefer to keep linux runners. The windows agents are 5 to 10x slower (from my non-scientific testing). Is there any reason this needs to run on Windows?
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.
I was not aware of a way to make linux compile .net framework. That's the reason for the change. I may be wrong here though.
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.
This is how the project was compiling for .NET from Linux in the 4.x releases:
CommandLineUtils/Directory.Build.props
Lines 56 to 59 in 10d0155
| <ItemGroup> | |
| <!-- For x-plat development --> | |
| <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="All" /> | |
| </ItemGroup> |
src/Hosting.CommandLine/McMaster.Extensions.Hosting.CommandLine.csproj
Outdated
Show resolved
Hide resolved
src/Hosting.CommandLine/McMaster.Extensions.Hosting.CommandLine.csproj
Outdated
Show resolved
Hide resolved
src/CommandLineUtils/McMaster.Extensions.CommandLineUtils.csproj
Outdated
Show resolved
Hide resolved
|
Claude finished @natemcmaster's task in 2m 17s —— View job PR Review FeedbackThanks for working on multi-targeting support! I've reviewed the PR and compiled feedback based on the maintainer's comments and code analysis. Here's a comprehensive review: Critical Issues1. Strong Naming Issue (Blocking)The PR description and comments mention that strong naming doesn't work properly for .NET Framework, causing test failures. This needs to be resolved before the PR can be merged. The maintainer also noted they're unsure how to fix this - this is a critical blocker that needs investigation. 2. CI/Build Configuration Issues
Language Version Divergence (
3. Project Configuration ConcernsWindows-Only Compilation (
Wildcard Version (
Code Quality Issues4. Bare Catch Block (
|
Source generators run in the compiler/IDE process and should not be strong-named. This fixes the Windows .NET Framework 4.7.2 test failures where the generator DLL was being signed with the same key as the main library, causing strong name verification errors. Co-authored-by: sensslen <[email protected]>
…for .net framework
fix: disable strong naming for source generator assembly
use fixed versions of polysharp and remove langversion specification …
|
@natemcmaster I was able to figure out the strong naming issue. Basically Microsoft changed how strong named assemblies are loaded between .nset framework and .net core. Basically the source generator failed to load when it was strong named --> See https://learn.microsoft.com/en-us/dotnet/standard/library-guidance/strong-naming Or so I thought... :( |
…Framework build issues Co-authored-by: sensslen <[email protected]>
This reverts commit 090a300.
…work tests Co-authored-by: sensslen <[email protected]>
Turns out the issue was the code coverage collection which caused the assembly loading to break. I assume that thexy apply some magic trick (IL injection) to make this work. Disabling code coverage collection for windows does the trick. I'm sure this can be refined further. |
|
Thanks for the updates @sensslen! I'll get this merged and patched up to nuget soon. |
6bf07f5
into
natemcmaster:restore-dotnetfx
|
Thank you very much |

Add multi-targeting support