-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix cross-os symbol generation #20481
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
Fix cross-os symbol generation #20481
Conversation
davidwrighton
commented
Sep 1, 2021
- Use the target os to determine the symbol type, not the sdk os
- Add tests for cross os/cross arch crossgen compilation
- Use the target os to determine the symbol type, not the sdk os - Add tests for cross os/cross arch crossgen compilation
…ternal, as the new test logic demands correctness
[InlineData("net6.0", "win-x86", "windows", "X86,X64,Arm64,Arm", "nonComposite", "nonselfcontained")] | ||
public void It_supports_crossos_arch_compilation(string targetFramework, string runtimeIdentifier, string sdkSupportedOs, string sdkSupportedArch, string composite, string selfcontained) | ||
{ | ||
var projectName = $"FrameworkDependentUsingCrossArchTest";// {targetFramework}{runtimeIdentifier.Replace("-",".")}{composite}{selfcontained}"; |
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.
Do we need to fix this line?
[InlineData("net6.0", "linux-x64", "windows,linux,osx", "X64,Arm64", "composite", "selfcontained")] // Composite in .NET 6.0 is only supported for self-contained builds | ||
[InlineData("net6.0", "win-x64", "windows", "X64,Arm64", "composite", "selfcontained")] // Composite in .NET 6.0 is only supported for self-contained builds | ||
[InlineData("net6.0", "osx-arm64", "windows,linux,osx", "X64,Arm64", "nonComposite", "nonselfcontained")] | ||
// In .NET 6.0 building targetting Windows doesn't support emitting native symbols. |
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 comment should be applied to win-x64
as well, correct?
[InlineData("net6.0", "osx-arm64", "windows,linux,osx", "X64,Arm64", "nonComposite", "nonselfcontained")] | ||
// In .NET 6.0 building targetting Windows doesn't support emitting native symbols. | ||
[InlineData("net6.0", "win-x86", "windows", "X86,X64,Arm64,Arm", "nonComposite", "nonselfcontained")] | ||
public void It_supports_crossos_arch_compilation(string targetFramework, string runtimeIdentifier, string sdkSupportedOs, string sdkSupportedArch, string composite, string selfcontained) |
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 use either just It_supports_cross_compilation
or It_supports_cross_os_and_arch_compilation
.
|
||
private static bool IsTargetOsOsX(string runtimeIdentifier) | ||
{ | ||
if (runtimeIdentifier.Contains("osx") || runtimeIdentifier.Contains("macOs")) |
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 think macOs
cannot be a part of a valid runtime identifier.
}); | ||
if (composite) | ||
{ | ||
pdbFiles = new[] { GetPDBFileName(Path.ChangeExtension(mainProjectDll, "r2r.dll"), framework, testProject.RuntimeIdentifier) }; |
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.
How would the composite tests pass without this line?
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.
The tests which set composite used to not set selfcontained. This resulted in the compiler not actually producing a composite build, so the test continued to pass. The tests have been adjusted to explicitly pass composite false now.
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.
Looks good in general. Thank you!
/backport to release/6.0.1xx |
* Fix cross-os symbol generation - Use the target os to determine the symbol type, not the sdk os - Add tests for cross os/cross arch crossgen compilation * Fix tests to specify composite accurately to TestProjectPublishing_Internal, as the new test logic demands correctness
* Fix cross-os symbol generation - Use the target os to determine the symbol type, not the sdk os - Add tests for cross os/cross arch crossgen compilation * Fix tests to specify composite accurately to TestProjectPublishing_Internal, as the new test logic demands correctness