-
Notifications
You must be signed in to change notification settings - Fork 548
[dotnet] Fix loading oldest reference assemblies for library projects. Fixes #24043. #24181
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
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.
Pull Request Overview
This PR introduces a default Target Platform Version (TPV) for library projects across all Apple platforms (iOS, tvOS, macOS, MacCatalyst). When building a class library without an explicit TPV, the system now defaults to the lowest supported TPV for the current .NET version. This allows libraries to be built without specifying a TPV while maintaining compatibility.
Key changes:
- Modified build system to set default TPV for libraries via new Makefile variables
- Updated workload manifest generator to recognize lowest TPV per .NET version and conditionally import it for libraries
- Enhanced test infrastructure to validate the default TPV behavior
- Consolidated MyClassLibrary test projects to use shared source files
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/dotnet/UnitTests/ProjectTest.cs | Added assertions to verify default TPV is correctly applied to library builds |
| tests/Makefile | Added export of *_TARGET_PLATFORM_VERSION_LIBRARY variables to test configurations |
| scripts/generate-workloadmanifest-targets/generate-workloadmanifest-targets.cs | Added logic to compute lowest TPV per .NET version and conditionally import for libraries |
| tests/dotnet/MyClassLibrary/shared.csproj | New shared project file for consolidating common source files |
| tests/dotnet/MyClassLibrary/*/MyClassLibrary.csproj | Updated to import shared project instead of duplicating code |
| tests/dotnet/MyClassLibrary/*/MyClass.cs | Removed platform-specific duplicates |
| tests/dotnet/MyClassLibrary/MyClass.cs | Now inherits from NSObject to ensure platform-specific behavior |
scripts/generate-workloadmanifest-targets/generate-workloadmanifest-targets.cs
Outdated
Show resolved
Hide resolved
scripts/generate-workloadmanifest-targets/generate-workloadmanifest-targets.cs
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@rolfbjarne backport all the things! |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ [CI Build #502b6aa] Build passed (Build packages) ✅Pipeline on Agent |
✅ [PR Build #502b6aa] Build passed (Detect API changes) ✅Pipeline on Agent |
✅ [CI Build #502b6aa] Build passed (Build macOS tests) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
💻 [CI Build #502b6aa] Tests on macOS X64 - Mac Sonoma (14) passed 💻✅ All tests on macOS X64 - Mac Sonoma (14) passed. Pipeline on Agent |
💻 [CI Build #502b6aa] Tests on macOS M1 - Mac Monterey (12) passed 💻✅ All tests on macOS M1 - Mac Monterey (12) passed. Pipeline on Agent |
💻 [CI Build #502b6aa] Tests on macOS M1 - Mac Ventura (13) passed 💻✅ All tests on macOS M1 - Mac Ventura (13) passed. Pipeline on Agent |
💻 [CI Build #502b6aa] Tests on macOS arm64 - Mac Tahoe (26) passed 💻✅ All tests on macOS arm64 - Mac Tahoe (26) passed. Pipeline on Agent |
💻 [CI Build #502b6aa] Tests on macOS arm64 - Mac Sequoia (15) passed 💻✅ All tests on macOS arm64 - Mac Sequoia (15) passed. Pipeline on Agent |
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
🚀 [CI Build #502b6aa] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 117 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
…Fixes #24043. (#24181) Since this may result in unintuitive behavior (library projects are built differently than executable projects, so code that works in an executable project may not compile when moved to a library project), an escape hatch was implemented as well. One unintuitive behavior was when building an executable project with a library project from Windows: if the library project needs the remote connection, it would use a different workload, and different remote connection, than the executable project, which just wouldn't work. So we don't enable this new behavior when library projects need the remote connection (which is when bundle resources are precompiled for the library project; aka when `BundleOriginalResources=false` - note that it's enabled by default in .NET 10, so developers must opt in to run into this problem and thus not getting this new behavior). Fixes #24043. --------- Co-authored-by: GitHub Copilot <copilot@github.com> Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Since this may result in unintuitive behavior (library projects are built differently than executable projects, so code that works in an executable project may not compile when moved to a library project), an escape hatch was implemented as well.
One unintuitive behavior was when building an executable project with a library project from Windows: if the library project needs the remote connection, it would use a different workload, and different remote connection, than the executable project, which just wouldn't work. So we don't enable this new behavior when library projects need the remote connection (which is when bundle resources are precompiled for the library project; aka when
BundleOriginalResources=false- note that it's enabled by default in .NET 10, so developers must opt in to run into this problem and thus not getting this new behavior).Fixes #24043.