From 4b6b680b816586708353e898269a799660cd08a9 Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Wed, 2 Nov 2016 16:23:08 -0700 Subject: [PATCH 1/4] Fix typeforward resolutions --- src/fsharp/fsc.fs | 49 +++++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/src/fsharp/fsc.fs b/src/fsharp/fsc.fs index 98e30f15c34..a5b04e9e7bf 100644 --- a/src/fsharp/fsc.fs +++ b/src/fsharp/fsc.fs @@ -957,22 +957,30 @@ let createMscorlibExportList tcGlobals = CustomAttrs = mkILCustomAttrs List.empty }) |> Seq.toList -let createSystemNumericsExportList tcGlobals = - let sysAssemblyRef = tcGlobals.sysCcu.ILScopeRef.AssemblyRef - let systemNumericsAssemblyRef = - let refNumericsDllName = - if tcGlobals.usesMscorlib then "System.Numerics" - else "System.Runtime.Numerics" - ILAssemblyRef.Create(refNumericsDllName, sysAssemblyRef.Hash, sysAssemblyRef.PublicKey, sysAssemblyRef.Retargetable, sysAssemblyRef.Version, sysAssemblyRef.Locale) - typesForwardedToSystemNumerics |> - Seq.map (fun t -> - { ScopeRef = ILScopeRef.Assembly(systemNumericsAssemblyRef) - Name = t - IsForwarder = true - Access = ILTypeDefAccess.Public - Nested = mkILNestedExportedTypes List.empty - CustomAttrs = mkILCustomAttrs List.empty }) |> - Seq.toList +let createSystemNumericsExportList tcGlobals (tcImports:TcImports) = + let refNumericsDllName = + if tcGlobals.usesMscorlib then "System.Numerics" + else "System.Runtime.Numerics" + let numericsAssemblyRef = + match tcImports.GetImportedAssemblies() |> List.tryFind(fun a -> a.FSharpViewOfMetadata.AssemblyName = refNumericsDllName) with + | Some asm -> + match asm.ILScopeRef with + | ILScopeRef.Assembly aref -> Some aref + | _ -> None + | None -> None + match numericsAssemblyRef with + | Some aref -> + let systemNumericsAssemblyRef = ILAssemblyRef.Create(refNumericsDllName, aref.Hash, aref.PublicKey, aref.Retargetable, aref.Version, aref.Locale) + typesForwardedToSystemNumerics |> + Seq.map (fun t -> + { ScopeRef = ILScopeRef.Assembly(systemNumericsAssemblyRef) + Name = t + IsForwarder = true + Access = ILTypeDefAccess.Public + Nested = mkILNestedExportedTypes List.empty + CustomAttrs = mkILCustomAttrs List.empty }) |> + Seq.toList + | None -> [] module MainModuleBuilder = @@ -1009,7 +1017,7 @@ module MainModuleBuilder = let CreateMainModule - (tcConfig:TcConfig,tcGlobals, + (tcConfig:TcConfig,tcGlobals,tcImports:TcImports, pdbfile,assemblyName,outfile,topAttrs, (iattrs,intfDataResources),optDataResources, codegenResults,assemVerFromAttrib,metadataVersion,secDecls) = @@ -1033,7 +1041,7 @@ module MainModuleBuilder = let exportedTypesList = if (tcConfig.compilingFslib && tcConfig.compilingFslib40) then (List.append (createMscorlibExportList tcGlobals) - (if tcConfig.compilingFslibNoBigInt then [] else (createSystemNumericsExportList tcGlobals)) + (if tcConfig.compilingFslibNoBigInt then [] else (createSystemNumericsExportList tcGlobals tcImports)) ) else [] @@ -2012,7 +2020,7 @@ let main2(Args(tcConfig, tcImports, frameworkTcImports: TcImports, tcGlobals, er Args(tcConfig,tcImports,tcGlobals,errorLogger,generatedCcu,outfile,optimizedImpls,topAttrs,pdbfile,assemblyName, (sigDataAttributes, sigDataResources), optDataResources,assemVerFromAttrib,signingInfo,metadataVersion,exiter) let main2b(Args(tcConfig: TcConfig, tcImports, tcGlobals, errorLogger, generatedCcu: CcuThunk, outfile, optimizedImpls, topAttrs, pdbfile, assemblyName, idata, optDataResources, assemVerFromAttrib, signingInfo, metadataVersion, exiter: Exiter)) = - + // Compute a static linker. let ilGlobals = tcGlobals.ilg if tcConfig.standalone && generatedCcu.UsesFSharp20PlusQuotations then @@ -2035,8 +2043,7 @@ let main2b(Args(tcConfig: TcConfig, tcImports, tcGlobals, errorLogger, generated let permissionSets = ilxGenerator.CreatePermissionSets securityAttrs let secDecls = if securityAttrs.Length > 0 then mkILSecurityDecls permissionSets else emptyILSecurityDecls - - let ilxMainModule = MainModuleBuilder.CreateMainModule (tcConfig,tcGlobals,pdbfile,assemblyName,outfile,topAttrs,idata,optDataResources,codegenResults,assemVerFromAttrib,metadataVersion,secDecls) + let ilxMainModule = MainModuleBuilder.CreateMainModule (tcConfig,tcGlobals,tcImports,pdbfile,assemblyName,outfile,topAttrs,idata,optDataResources,codegenResults,assemVerFromAttrib,metadataVersion,secDecls) AbortOnError(errorLogger,tcConfig,exiter) From 38b4c93f6a8038461025f7a592a443603c93588e Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Wed, 2 Nov 2016 16:25:45 -0700 Subject: [PATCH 2/4] Update lkg --- build.cmd | 2 +- lkg/project.json | 2 +- .../FSharp.Core.Unittests.fsproj | 4 +++- .../4.0.0-rc3-24212-01/TupleSample.dll | Bin 0 -> 8192 bytes .../{ => 4.4.0-beta-24631-01}/TupleSample.dll | Bin .../FSharp.Core/SampleTuples/TupleSample.csproj | 2 +- 6 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 src/fsharp/FSharp.Core.Unittests/FSharp.Core/SampleTuples/4.0.0-rc3-24212-01/TupleSample.dll rename src/fsharp/FSharp.Core.Unittests/FSharp.Core/SampleTuples/{ => 4.4.0-beta-24631-01}/TupleSample.dll (100%) diff --git a/build.cmd b/build.cmd index 2de8d8e4fcf..ba25d18b578 100644 --- a/build.cmd +++ b/build.cmd @@ -479,7 +479,7 @@ rem Build Proto if '%BUILD_PROTO%' == '1' ( if '%BUILD_PROTO_WITH_CORECLR_LKG%' == '1' ( - pushd .\lkg & %_dotnetexe% restore --packages %~dp0\packages &popd + pushd .\lkg & %_dotnetexe% restore &popd @if ERRORLEVEL 1 echo Error: dotnet restore failed && goto :failure pushd .\lkg & %_dotnetexe% publish project.json -o %~dp0\Tools\lkg -r win7-x64 &popd diff --git a/lkg/project.json b/lkg/project.json index 1d33c32fd78..3a197eed86e 100644 --- a/lkg/project.json +++ b/lkg/project.json @@ -1,7 +1,7 @@ { "dependencies": { - "Microsoft.FSharp.Compiler.Host.netcore": "1.0.0-alpha-160807", + "Microsoft.FSharp.Compiler.Host.netcore": "1.0.0-alpha-161102", "Microsoft.NETCore.Runtime.CoreCLR": "1.0.2", "Microsoft.NETCore.DotNetHostPolicy": "1.0.1", "Microsoft.NETCore.DotNetHost": "1.0.1" diff --git a/src/fsharp/FSharp.Core.Unittests/FSharp.Core.Unittests.fsproj b/src/fsharp/FSharp.Core.Unittests/FSharp.Core.Unittests.fsproj index d372dbee050..c43ae80020c 100644 --- a/src/fsharp/FSharp.Core.Unittests/FSharp.Core.Unittests.fsproj +++ b/src/fsharp/FSharp.Core.Unittests/FSharp.Core.Unittests.fsproj @@ -61,7 +61,9 @@ FSharp.Core - ..\..\..\packages\System.ValueTuple.4.4.0-beta-24631-01\lib\netstandard1.0\System.ValueTuple.dll + FSharp.Core\SampleTuples\4.0.0-rc3-24212-01\System.ValueTuple.dll + FSharp.Core\SampleTuples\4.4.0-beta-24631-01\System.ValueTuple.dll + True True diff --git a/src/fsharp/FSharp.Core.Unittests/FSharp.Core/SampleTuples/4.0.0-rc3-24212-01/TupleSample.dll b/src/fsharp/FSharp.Core.Unittests/FSharp.Core/SampleTuples/4.0.0-rc3-24212-01/TupleSample.dll new file mode 100644 index 0000000000000000000000000000000000000000..f1afad418cceeccc994a20146239229c71fdf764 GIT binary patch literal 8192 zcmeHMU2Ggz6+Sb&UXR!II-9lAlDg?6ansgy7CYI*X?_|f-Xu765+}P!lXRPSf5z)+ zXLsG1SvSU22~-r+N~k~tLLfvV1k?{GML}(mkWhtCD-j7Hfk2`Hq&)CIRfL3)01>`> z?(BHhc9RxR;h}du-<+TCo_p@Ovv+34N6x-LAtDOnxN(E%Rh&f|VZ1q9ggbWE4`Ot+ z?b`ZRmGNuqv(u)d&)BuHov-M{e6?D0^@5?>^{Q@G_4KifUa6IgWM^lz&kH?qfM{F^ z(NKBq>BeZkqYZkyGDvhgED>q_-gcaI93wc0Rg5fM zn~wC7wqqBeac(0J#6;KP2(%GopR^6D2BOH7CUJ;Z>u?0x2+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VaPn5b>yY%Oj3>z8Iweb%oN^7L zip4Z-7N%--DLCc@>4DdN=Nlw}k}RWNvsl0~;>ljz+@B5mf&)tcj)MWu51=AHLX=wl>{Y})}Hvjkfv#E zdWiLes`bPVgkjOz^{{73gxY%IV=cm{b?Pm?H4%>X#E(SSu65~=fFse;-V;CGDqUJ! zZ*B4=A}u}fGm0kiO3Af&&Km;y@aI+xWr`qwvMnq z0VmhU_i6*w)#MH^u?S0Aa>+6U$W3E<-MYQ0$&z}NjgcbjByp8cIVbP5S{UTT*En|z zlUFleSR;&$x-Ck#3$tIlfVe?80tsVwOZC1b6fvhJjxcOmLh^DCL}ts5CA5Hl>B!Bl zo$uapSw4ZD!pC#>FX6z|tSR0*&~@U+V^&@Bu$`YdTB{zoP&9a3&raL5CmjVmJl3ME zR;Y8-$~(@uS+Mi=99}N9@Ll{ig;x6;xBmJ|y1r#_XgeOk6>1&AuX%ik9#N=2dGtVb zqGr3|#x~&X!h7(8f7<|V2vfKj?eWgTNGR6r-?`GJGh^lFj^akvEn?`6AbO@=a18OP zmIl3d)FRhjq?N||uJmn0Co<{G^`AU(Wq4}((50ToCU&jw?H5^(?#w-I%$ij@Uv+Ag z+^p%;^VXCzowsLlc&nT9#Df`ONsiWRBYCoFx-Pa>Cl|2h0Is&o&l#c4h2#3WFwA=_jd+jR%wcAOzPw3 z{4BhASRMHDyyNf{cs@4G5q3r7p#@@` zLJS+c#W@a95}d|CG=h~?xJr0}1GkEttUzX2s$+Cf$qZ*J - ..\..\..\..\..\packages\System.ValueTuple.4.4.0-beta-24631-01\lib\netstandard1.0\System.ValueTuple.dll + ..\..\..\..\..\packages\System.ValueTuple.4.0.0-rc3-24212-01\lib\netstandard1.1\System.ValueTuple.dll From d991bcee835cc5077ad5a5f9e5d1126c779160ad Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Wed, 2 Nov 2016 16:54:15 -0700 Subject: [PATCH 3/4] Name TupleSample correctly --- .../FSharp.Core.Unittests/FSharp.Core.Unittests.fsproj | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/fsharp/FSharp.Core.Unittests/FSharp.Core.Unittests.fsproj b/src/fsharp/FSharp.Core.Unittests/FSharp.Core.Unittests.fsproj index c43ae80020c..de7ec030e90 100644 --- a/src/fsharp/FSharp.Core.Unittests/FSharp.Core.Unittests.fsproj +++ b/src/fsharp/FSharp.Core.Unittests/FSharp.Core.Unittests.fsproj @@ -61,13 +61,14 @@ FSharp.Core - FSharp.Core\SampleTuples\4.0.0-rc3-24212-01\System.ValueTuple.dll - FSharp.Core\SampleTuples\4.4.0-beta-24631-01\System.ValueTuple.dll + packages\System.ValueTuple.4.0.0-rc3-24212-01\lib\netstandard1.1\System.ValueTuple.dll + packages\System.ValueTuple.4.4.0-beta-24631-01\lib\netstandard1.0\System.ValueTuple.dll True + FSharp.Core\SampleTuples\4.0.0-rc3-24212-01\TupleSample.dll + FSharp.Core\SampleTuples\4.4.0-beta-24631-01\TupleSample.dll True - ..\..\..\src\fsharp\FSharp.Core.Unittests\FSharp.Core\SampleTuples\TupleSample.dll From 5de8a74a195a497fc3c519a3547f92116c7f6130 Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Wed, 2 Nov 2016 17:13:34 -0700 Subject: [PATCH 4/4] Get paths to references right --- src/fsharp/FSharp.Core.Unittests/FSharp.Core.Unittests.fsproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fsharp/FSharp.Core.Unittests/FSharp.Core.Unittests.fsproj b/src/fsharp/FSharp.Core.Unittests/FSharp.Core.Unittests.fsproj index de7ec030e90..2bc2c853b1c 100644 --- a/src/fsharp/FSharp.Core.Unittests/FSharp.Core.Unittests.fsproj +++ b/src/fsharp/FSharp.Core.Unittests/FSharp.Core.Unittests.fsproj @@ -61,8 +61,8 @@ FSharp.Core - packages\System.ValueTuple.4.0.0-rc3-24212-01\lib\netstandard1.1\System.ValueTuple.dll - packages\System.ValueTuple.4.4.0-beta-24631-01\lib\netstandard1.0\System.ValueTuple.dll + ..\..\..\packages\System.ValueTuple.4.0.0-rc3-24212-01\lib\netstandard1.1\System.ValueTuple.dll + ..\..\..\packages\System.ValueTuple.4.4.0-beta-24631-01\lib\netstandard1.0\System.ValueTuple.dll True