Skip to content
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

ARM/ARM64 not supported as values to --platform flag #437

Closed
michael-hawker opened this issue Jan 17, 2023 · 2 comments · Fixed by #446
Closed

ARM/ARM64 not supported as values to --platform flag #437

michael-hawker opened this issue Jan 17, 2023 · 2 comments · Fixed by #446

Comments

@michael-hawker
Copy link
Contributor

We need to build for ARM/ARM64 as platforms (as well as potentially other platforms names for different Android, iOS, etc... project types).

However, it appears that the list of values passed into the --platforms argument of the slngen tool is first scrubbed, and anything beyond x86, x64, any cpu is effectively scrubbed:

private IEnumerable<string> GetValidSolutionPlatforms(IEnumerable<string> platforms)
{
List<string> values = platforms
.Select(i => i.ToSolutionPlatform())
.Select(platform =>
{
return platform.ToLowerInvariant() switch
{
"any cpu" => platform,
"x64" => platform,
"x86" => platform,
"amd64" => "x64",
"win32" => "x86",
_ => null
};
})
.Where(i => i != null)
.OrderBy(i => i)
.ToList();
return values.Any() ? values : new List<string> { "Any CPU" };
}


I assume this function is used by the slngen tool in addition to the msbuild target mode, as that's the behavior I'm seeing on the command line:

dotnet slngen --platform "ARM64"

image


This is a blocking issue for us adopting this tool in our workflow, everything else currently appears to be working fine.

The simplest solution would allow custom values by not making everything falling out of the switch statement go to null but instead pass through the original platform value.

@michael-hawker
Copy link
Contributor Author

Here is a UWP project with a solution file showing ARM/ARM64 usage:

SettingsTest.zip

Here's an Uno project which shows other platform/configuration values:

UnoTestWASMAssemblyMetadata.zip

Don't think these are supposed to be a set list (if so that's not documented anywhere I think). They're almost like magic strings for some platforms it seems.

In either case, I think the default if a value isn't mapped it should just passthru as what was typed.

@michael-hawker
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant