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.
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.
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.
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.
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.
How would the composite tests pass without this line?
There was a problem hiding this comment.
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.
AntonLapounov
left a comment
There was a problem hiding this comment.
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