-
Notifications
You must be signed in to change notification settings - Fork 386
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
Make use of a specific iOS + MacCatalyst TFM #2243
base: main
Are you sure you want to change the base?
Conversation
Hey Shaun! Two quick thoughts:
(Also - If this is PR still a work-in-progress, could you flip it to be a Draft PR please? I get distracted by shiny new PRs and want to review them, but I wait when the PR is still in Draft.) |
This isn't aimed at fixing any NativeAOT or Trimming bugs but aimed at the I'll be happy to work on any possible testing options although I am not sure how we can right now. |
I am actually starting to wonder whether this might also fix other issues such as #1374 based on this documentation page https://learn.microsoft.com/en-us/dotnet/standard/frameworks#precedence I read it as apps could be built targeting |
@brminnick I'm not convinced we can create a unit test for this. I do wonder if we could add something to the pipeline to make sure that the packaged information meets what we expect. What do you think? |
Let's chat about it in tomorrow's standup! I'm fairly confident that as long as we set up our CI / CD pipeline correctly to match our targeted frameworks and run the Device Tests in RELEASE configuration with NativeAOT enabled, |
We can replicate the error in a CI pipelines but it’s not straightforward. The latest breakage required .NET 9 RC SDK installed side-by-side to trigger it. Alternatively you can deliberately install old (fixed) workload set instead of the latest one. The trouble with that is that you either need to use custom manifests or start with 8.0.4xx SDK which introduced the workload set support. |
I was thinking of just inspecting the nuget package generated and verifying it targets the expected TFMs for Apple platforms |
I guess a nice test would be to try consuming the nightly build and see if that still exhibits the issue. I've not be able to reproduce the issue @filipnavara is this something that you could easily test/verify? |
Nightly build of what? CommunityToolkit.Maui? If you have a link I can test the scenarios easily and report back. I assume I just need to use this feed:
...and then reference the build number from this PR, right? |
There might be a neater way but I have just knocked up a little console app that could be published as a dotnet tool to perform this verification. The code is: using System.IO.Compression;
using CommandLine;
namespace PackageVerifier;
class Program
{
static void Main(string[] args)
{
Parser.Default.ParseArguments<Options>(args)
.WithParsed<Options>(o =>
{
Console.WriteLine($"Verifying package '{o.PackagePath}'");
var extractDirectory = Path.Join(Environment.CurrentDirectory, "abc");
Console.WriteLine($@"Extracting package to directory '{extractDirectory}'");
ZipFile.ExtractToDirectory(o.PackagePath, extractDirectory);
Console.WriteLine($"Checking for TFMs: '{string.Join(',', o.TargetFrameworkMonikers)}'");
var libDirectory = Path.Join(extractDirectory, "lib");
var directories = new DirectoryInfo(libDirectory).GetDirectories().Select(x => x.Name).ToList();
foreach (var unexpectedDirectory in directories.Except(o.TargetFrameworkMonikers))
{
Console.WriteLine($"WARNING: TFM '{unexpectedDirectory}' was not expected");
}
foreach (var unexpectedDirectory in o.TargetFrameworkMonikers.Except(directories))
{
Console.WriteLine($"ERROR: TFM '{unexpectedDirectory}' is missing");
}
foreach (var unexpectedDirectory in o.TargetFrameworkMonikers.Intersect(directories))
{
Console.WriteLine($"SUCCESS: Expected TFM '{unexpectedDirectory}' exists");
}
});
}
} Usage is something like: dotnet packageverifier --tfms "net9.0-ios17.5" --package-path "/Users/shaunlawrence/Documents/work/projects/toolkits/mct/src/Maui/src/CommunityToolkit.Maui/bin/Release/CommunityToolkit.Maui.1.0.0-pre1.nupkg.zip" And the output currently looks something like:
With a bit more effort it could be modified to be more user friendly and allow it to cause a pipeline build to fail. What do you think? |
Yes that looks like it is the correct feed and approach for the build number as per here https://github.com/CommunityToolkit/Maui/wiki/Preview-Packages#pull-requests- Let me find the build number |
|
Yes, I can confirm that with .NET 9 RC 1 SDK I now get the correct iOS assets. With 9.1.0 on NuGet.org I get the generic |
That's fantastic news! Thank you so much for testing this and all of the input to get us to this stage! |
Thanks for addressing it so quickly. :-) Let me know if there's anything else you need to test. |
I have had some fun playing around with this so I have stuck it in a GitHub repo: https://github.com/bijington/package-verifier |
Description of Change
Linked Issues
PR Checklist
approved
(bug) orChampioned
(feature/proposal)main
at time of PRAdditional information