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

FSharp.Compiler.Private only targets netstandard2.0 #7220

Closed
wants to merge 64 commits into from
Closed

FSharp.Compiler.Private only targets netstandard2.0 #7220

wants to merge 64 commits into from

Conversation

cartermp
Copy link
Contributor

I'm looking to give @brettfo a heart attack so that this can be done correctly.

@cartermp
Copy link
Contributor Author

FYI in running this locally it's basically just a pleasure to write code in the compiler codebase.

@cartermp
Copy link
Contributor Author

Update: got this working locally - build.cmd succeeds. Opens in VS and everything works.

Need to figure out why this is wonky in the linux/macOS/sourcebuild builds now.

Signing errors are unrelated.

@cartermp cartermp closed this Jul 23, 2019
@cartermp cartermp reopened this Jul 23, 2019
@cartermp cartermp changed the base branch from master to release/fsharp47 August 17, 2019 00:14
@cartermp cartermp changed the title [WIP] FSharp.Compiler.Private only targets netstandard2.0 FSharp.Compiler.Private only targets netstandard2.0 Aug 17, 2019
@cartermp
Copy link
Contributor Author

cartermp commented Aug 17, 2019

Built locally!

@cartermp cartermp changed the base branch from release/fsharp47 to release/dev16.3 August 20, 2019 23:59
@cartermp
Copy link
Contributor Author

Finally getting to obscure signing issues, so there's some serious progress here!

@cartermp
Copy link
Contributor Author

The following assemblies don't have a commit hash set

(all assemblies)

Hmmmmmmmmmmmmmmmmmmmmmmm but y tho

@cartermp
Copy link
Contributor Author

@brettfo Hooo boy.

fsc.exe build from release/dev16.3:

image

// Metadata version: v4.0.30319
.assembly extern mscorlib
{
  .publickeytoken = (B7 7A 5C 56 19 34 E0 89 )                         // .z\V.4..
  .ver 4:0:0:0
}
.assembly extern FSharp.Core
{
  .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )                         // .?_....:
  .ver 4:7:0:0
}
.assembly extern FSharp.Compiler.Private
{
  .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )                         // .?_....:
  .ver 10:6:0:0
}
.assembly fsc
{
  .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32,
                                                                                                      int32,
                                                                                                      int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) 
  .custom instance void [mscorlib]System.Runtime.Versioning.TargetFrameworkAttribute::.ctor(string) = ( 01 00 1C 2E 4E 45 54 46 72 61 6D 65 77 6F 72 6B   // ....NETFramework
                                                                                                        2C 56 65 72 73 69 6F 6E 3D 76 34 2E 37 2E 32 01   // ,Version=v4.7.2.
                                                                                                        00 54 0E 14 46 72 61 6D 65 77 6F 72 6B 44 69 73   // .T..FrameworkDis
                                                                                                        70 6C 61 79 4E 61 6D 65 14 2E 4E 45 54 20 46 72   // playName..NET Fr
                                                                                                        61 6D 65 77 6F 72 6B 20 34 2E 37 2E 32 )          // amework 4.7.2
  .custom instance void [mscorlib]System.Reflection.AssemblyCompanyAttribute::.ctor(string) = ( 01 00 15 4D 69 63 72 6F 73 6F 66 74 20 43 6F 72   // ...Microsoft Cor
                                                                                                70 6F 72 61 74 69 6F 6E 00 00 )                   // poration..
  .custom instance void [mscorlib]System.Reflection.AssemblyConfigurationAttribute::.ctor(string) = ( 01 00 05 44 65 62 75 67 00 00 )                   // ...Debug..
  .custom instance void [mscorlib]System.Reflection.AssemblyCopyrightAttribute::.ctor(string) = ( 01 00 2E C2 A9 20 4D 69 63 72 6F 73 6F 66 74 20   // ..... Microsoft 
                                                                                                  43 6F 72 70 6F 72 61 74 69 6F 6E 2E 20 41 6C 6C   // Corporation. All
                                                                                                  20 72 69 67 68 74 73 20 72 65 73 65 72 76 65 64   //  rights reserved
                                                                                                  2E 00 00 )                                        // ...
  .custom instance void [mscorlib]System.Reflection.AssemblyFileVersionAttribute::.ctor(string) = ( 01 00 0E 34 32 2E 34 32 2E 34 32 2E 34 32 34 32   // ...42.42.42.4242
                                                                                                    34 00 00 )                                        // 4..
  .custom instance void [mscorlib]System.Reflection.AssemblyInformationalVersionAttribute::.ctor(string) = ( 01 00 0A 31 30 2E 36 2E 30 2D 64 65 76 00 00 )    // ...10.6.0-dev..
  .custom instance void [mscorlib]System.Reflection.AssemblyProductAttribute::.ctor(string) = ( 01 00 03 66 73 63 00 00 )                         // ...fsc..
  .custom instance void [mscorlib]System.Reflection.AssemblyTitleAttribute::.ctor(string) = ( 01 00 03 66 73 63 00 00 )                         // ...fsc..
  .custom instance void [mscorlib]System.Reflection.AssemblyVersionAttribute::.ctor(string) = ( 01 00 08 31 30 2E 36 2E 30 2E 30 00 00 )          // ...10.6.0.0..
  .custom instance void [mscorlib]System.Resources.NeutralResourcesLanguageAttribute::.ctor(string) = ( 01 00 05 65 6E 2D 55 53 00 00 )                   // ...en-US..
  .custom instance void [mscorlib]System.Runtime.CompilerServices.DependencyAttribute::.ctor(string,
                                                                                             valuetype [mscorlib]System.Runtime.CompilerServices.LoadHint) = ( 01 00 17 46 53 68 61 72 70 2E 43 6F 6D 70 69 6C   // ...FSharp.Compil
                                                                                                                                                               65 72 2E 50 72 69 76 61 74 65 01 00 00 00 00 00 ) // er.Private......

  // --- The following custom attribute is added automatically, do not uncomment -------
  //  .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 03 01 00 00 00 00 ) 

  .publickey = (00 24 00 00 04 80 00 00 94 00 00 00 06 02 00 00   // .$..............
                00 24 00 00 52 53 41 31 00 04 00 00 01 00 01 00   // .$..RSA1........
                07 D1 FA 57 C4 AE D9 F0 A3 2E 84 AA 0F AE FD 0D   // ...W............
                E9 E8 FD 6A EC 8F 87 FB 03 76 6C 83 4C 99 92 1E   // ...j.....vl.L...
                B2 3B E7 9A D9 D5 DC C1 DD 9A D2 36 13 21 02 90   // .;.........6.!..
                0B 72 3C F9 80 95 7F C4 E1 77 10 8F C6 07 77 4F   // .r<......w....wO
                29 E8 32 0E 92 EA 05 EC E4 E8 21 C0 A5 EF E8 F1   // ).2.......!.....
                64 5C 4C 0C 93 C1 AB 99 28 5D 62 2C AA 65 2C 1D   // d\L.....(]b,.e,.
                FA D6 3D 74 5D 6F 2D E5 F1 7E 5E AF 0F C4 96 3D   // ..=t]o-..~^....=
                26 1C 8A 12 43 65 18 20 6D C0 93 34 4D 5A D2 93 ) // &...Ce. m..4MZ..
  .hash algorithm 0x00008004
  .ver 10:6:0:0
}
.mresource public FSharpSignatureData.fsc
{
  // Offset: 0x00000000 Length: 0x00000D3F
}
.mresource public FSharpOptimizationData.fsc
{
  // Offset: 0x00000D48 Length: 0x00000150
}
.module fsc.exe
// MVID: {C36048E2-0B6F-2887-9B43-B7E29C421892}
.imagebase 0x00400000
.file alignment 0x00000200
.stackreserve 0x00100000
.subsystem 0x0003       // WINDOWS_CUI
.corflags 0x0000000b    //  ILONLY 32BITREQUIRED
// Image base: 0x0C6B0000

fsc.exe built from this PR:

image

// Metadata version: v4.0.30319
.assembly extern mscorlib
{
  .publickeytoken = (B7 7A 5C 56 19 34 E0 89 )                         // .z\V.4..
  .ver 4:0:0:0
}
.assembly extern FSharp.Core
{
  .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )                         // .?_....:
  .ver 4:7:0:0
}
.assembly extern FSharp.Compiler.Private
{
  .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )                         // .?_....:
  .ver 10:6:0:0
}
.assembly fsc
{
  .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32,
                                                                                                      int32,
                                                                                                      int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) 
  .custom instance void [mscorlib]System.Runtime.Versioning.TargetFrameworkAttribute::.ctor(string) = ( 01 00 1C 2E 4E 45 54 46 72 61 6D 65 77 6F 72 6B   // ....NETFramework
                                                                                                        2C 56 65 72 73 69 6F 6E 3D 76 34 2E 37 2E 32 01   // ,Version=v4.7.2.
                                                                                                        00 54 0E 14 46 72 61 6D 65 77 6F 72 6B 44 69 73   // .T..FrameworkDis
                                                                                                        70 6C 61 79 4E 61 6D 65 14 2E 4E 45 54 20 46 72   // playName..NET Fr
                                                                                                        61 6D 65 77 6F 72 6B 20 34 2E 37 2E 32 )          // amework 4.7.2
  .custom instance void [mscorlib]System.Reflection.AssemblyCompanyAttribute::.ctor(string) = ( 01 00 15 4D 69 63 72 6F 73 6F 66 74 20 43 6F 72   // ...Microsoft Cor
                                                                                                70 6F 72 61 74 69 6F 6E 00 00 )                   // poration..
  .custom instance void [mscorlib]System.Reflection.AssemblyConfigurationAttribute::.ctor(string) = ( 01 00 05 44 65 62 75 67 00 00 )                   // ...Debug..
  .custom instance void [mscorlib]System.Reflection.AssemblyCopyrightAttribute::.ctor(string) = ( 01 00 2E C2 A9 20 4D 69 63 72 6F 73 6F 66 74 20   // ..... Microsoft 
                                                                                                  43 6F 72 70 6F 72 61 74 69 6F 6E 2E 20 41 6C 6C   // Corporation. All
                                                                                                  20 72 69 67 68 74 73 20 72 65 73 65 72 76 65 64   //  rights reserved
                                                                                                  2E 00 00 )                                        // ...
  .custom instance void [mscorlib]System.Reflection.AssemblyFileVersionAttribute::.ctor(string) = ( 01 00 0E 34 32 2E 34 32 2E 34 32 2E 34 32 34 32   // ...42.42.42.4242
                                                                                                    34 00 00 )                                        // 4..
  .custom instance void [mscorlib]System.Reflection.AssemblyInformationalVersionAttribute::.ctor(string) = ( 01 00 0A 31 30 2E 36 2E 30 2D 64 65 76 00 00 )    // ...10.6.0-dev..
  .custom instance void [mscorlib]System.Reflection.AssemblyProductAttribute::.ctor(string) = ( 01 00 03 66 73 63 00 00 )                         // ...fsc..
  .custom instance void [mscorlib]System.Reflection.AssemblyTitleAttribute::.ctor(string) = ( 01 00 03 66 73 63 00 00 )                         // ...fsc..
  .custom instance void [mscorlib]System.Reflection.AssemblyVersionAttribute::.ctor(string) = ( 01 00 08 31 30 2E 36 2E 30 2E 30 00 00 )          // ...10.6.0.0..
  .custom instance void [mscorlib]System.Resources.NeutralResourcesLanguageAttribute::.ctor(string) = ( 01 00 05 65 6E 2D 55 53 00 00 )                   // ...en-US..
  .custom instance void [mscorlib]System.Runtime.CompilerServices.DependencyAttribute::.ctor(string,
                                                                                             valuetype [mscorlib]System.Runtime.CompilerServices.LoadHint) = ( 01 00 17 46 53 68 61 72 70 2E 43 6F 6D 70 69 6C   // ...FSharp.Compil
                                                                                                                                                               65 72 2E 50 72 69 76 61 74 65 01 00 00 00 00 00 ) // er.Private......

  // --- The following custom attribute is added automatically, do not uncomment -------
  //  .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 03 01 00 00 00 00 ) 

  .publickey = (00 24 00 00 04 80 00 00 94 00 00 00 06 02 00 00   // .$..............
                00 24 00 00 52 53 41 31 00 04 00 00 01 00 01 00   // .$..RSA1........
                07 D1 FA 57 C4 AE D9 F0 A3 2E 84 AA 0F AE FD 0D   // ...W............
                E9 E8 FD 6A EC 8F 87 FB 03 76 6C 83 4C 99 92 1E   // ...j.....vl.L...
                B2 3B E7 9A D9 D5 DC C1 DD 9A D2 36 13 21 02 90   // .;.........6.!..
                0B 72 3C F9 80 95 7F C4 E1 77 10 8F C6 07 77 4F   // .r<......w....wO
                29 E8 32 0E 92 EA 05 EC E4 E8 21 C0 A5 EF E8 F1   // ).2.......!.....
                64 5C 4C 0C 93 C1 AB 99 28 5D 62 2C AA 65 2C 1D   // d\L.....(]b,.e,.
                FA D6 3D 74 5D 6F 2D E5 F1 7E 5E AF 0F C4 96 3D   // ..=t]o-..~^....=
                26 1C 8A 12 43 65 18 20 6D C0 93 34 4D 5A D2 93 ) // &...Ce. m..4MZ..
  .hash algorithm 0x00008004
  .ver 10:6:0:0
}
.mresource public FSharpSignatureData.fsc
{
  // Offset: 0x00000000 Length: 0x00000D3F
}
.mresource public FSharpOptimizationData.fsc
{
  // Offset: 0x00000D48 Length: 0x00000150
}
.module fsc.exe
// MVID: {C36048E2-0B6F-2887-9B43-B7E29C421892}
.imagebase 0x00400000
.file alignment 0x00000200
.stackreserve 0x00100000
.subsystem 0x0003       // WINDOWS_CUI
.corflags 0x0000000b    //  ILONLY 32BITREQUIRED
// Image base: 0x06A30000

Both have the file version in the manifest.

This was referenced Aug 21, 2019
@cartermp
Copy link
Contributor Author

So, two troubling things here:

  1. Definitely blocked by Generate F# assemblyinfo in new fsproj #3113 here, since the only difference I can find is that native win32 resources aren't being written. And since this will not be coming for free in the SDK, we need to change the compiler to actually do it.
  2. Changing from multi-TFM (with net472 listed first) seemed to cause the .NET SDK compiler to be used, not the desktop compiler. Otherwise, we'd have win32 native resources written (since the .NET SDK compiler cannot write them).

The second point is bizarre. Why would changing the TFM like this use a different compiler?

More and more reason to work towards removing our use of the desktop compiler entirely.

@KevinRansom KevinRansom closed this Sep 1, 2019
@KevinRansom KevinRansom reopened this Sep 1, 2019
@cartermp cartermp changed the base branch from release/dev16.3 to master September 30, 2019 23:45
@cartermp cartermp closed this Sep 30, 2019
@cartermp cartermp reopened this Sep 30, 2019
@cartermp
Copy link
Contributor Author

cartermp commented Oct 1, 2019

well shit
image

@cartermp cartermp closed this Oct 1, 2019
@cartermp cartermp reopened this Oct 1, 2019
@cartermp
Copy link
Contributor Author

cartermp commented Oct 1, 2019

I think something is wrong with CI; we don't have that many checks

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 this pull request may close these issues.

4 participants