提交 dfc3f9eb 编写于 作者: D Don Syme 提交者: Kevin Ransom (msft)

reverse integrate some changes from fsharp\fsharp (#2818)

* reverse integrate some changes from fsharp\fsharp

* reverse integrate some changes from fsharp\fsharp
上级 ff6aec7a
......@@ -58,7 +58,7 @@ fi)
fi)
#TODO: work out how to avoid the need for this
chmod u+x packages/FSharp.Compiler.Tools.4.0.1.21/tools/fsi.exe
chmod u+x packages/FSharp.Compiler.Tools.4.1.4/tools/fsi.exe
chmod u+x packages/FsLexYacc.7.0.4/build/fslex.exe
chmod u+x packages/FsLexYacc.7.0.4/build/fsyacc.exe
......
......@@ -518,7 +518,7 @@ if "%BUILD_PROTO_WITH_CORECLR_LKG%" == "1" (
set _dotnetexe=%~dp0Tools\dotnetcli\dotnet.exe
set NUGET_PACKAGES=%~dp0Packages
set _fsiexe="packages\FSharp.Compiler.Tools.4.0.1.21\tools\fsi.exe"
set _fsiexe="packages\FSharp.Compiler.Tools.4.1.4\tools\fsi.exe"
if not exist %_fsiexe% echo Error: Could not find %_fsiexe% && goto :failure
%_ngenexe% install %_fsiexe% /nologo
......@@ -558,8 +558,8 @@ if "%BUILD_PROTO%" == "1" (
if "%BUILD_PROTO_WITH_CORECLR_LKG%" == "0" (
echo %_ngenexe% install packages\FSharp.Compiler.Tools.4.0.1.21\tools\fsc.exe /nologo
%_ngenexe% install packages\FSharp.Compiler.Tools.4.0.1.21\tools\fsc.exe /nologo
echo %_ngenexe% install packages\FSharp.Compiler.Tools.4.1.4\tools\fsc.exe /nologo
%_ngenexe% install packages\FSharp.Compiler.Tools.4.1.4\tools\fsc.exe /nologo
echo %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj
%_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj
......
......@@ -40,7 +40,7 @@
<!-- FSharp.Compiler.Tools is only used to get a working FSI.EXE to execute some scripts during the build -->
<!-- The LKG FSI.EXE requires MSBuild 15 to be installed, which is painful -->
<package id="FSharp.Compiler.Tools" version="4.0.1.21"/>
<package id="FSharp.Compiler.Tools" version="4.1.4"/>
<!-- FSharp.Data is used in some of the scripts ued for the coreclr build -->
<package id="FSharp.Data" version="2.2.5" />
......
......@@ -138,7 +138,7 @@
<!-- FSharp.Compiler.Tools is currently only used to get a working FSI.EXE to execute some scripts during the build -->
<!-- The LKG FSI.EXE requires MSBuild 15 to be installed, which is painful -->
<FsiToolPath>$(FSharpSourcesRoot)\..\packages\FSharp.Compiler.Tools.4.0.1.21\tools</FsiToolPath>
<FsiToolPath>$(FSharpSourcesRoot)\..\packages\FSharp.Compiler.Tools.4.1.4\tools</FsiToolPath>
</PropertyGroup>
<Import Project="../Tools/Build.Common.props" Condition="'$(TargetFramework)'=='coreclr'"/>
......
......@@ -376,9 +376,9 @@
<PropertyGroup >
<OutputPath>$(FSharpSourcesRoot)\..\$(Configuration)\$(ProtoFlavour)\bin</OutputPath>
<!-- When using coreclr to bootstrap to proto. We acquire the FSharp.Core LKG, targets LKG, the FSharp.Build LKG from the .NET Framework compiler tools LKG package. -->
<FSharpCoreLkgPath>$(FSharpSourcesRoot)\..\packages\FSharp.Compiler.Tools.4.0.1.21\tools</FSharpCoreLkgPath>
<FSharpCoreLkgPath>$(FSharpSourcesRoot)\..\packages\FSharp.Compiler.Tools.4.1.4\tools</FSharpCoreLkgPath>
<FSharpNetCoreLkgPath>$(FSharpSourcesRoot)\..\Tools\lkg</FSharpNetCoreLkgPath>
<FSharpTargetsPath>..\packages\FSharp.Compiler.Tools.4.0.1.21\tools\Microsoft.FSharp.Targets</FSharpTargetsPath>
<FSharpTargetsPath>..\packages\FSharp.Compiler.Tools.4.1.4\tools\Microsoft.FSharp.Targets</FSharpTargetsPath>
<!-- When using coreclr to bootstrap, the compiler binary comes from the coreclr LKG, invoked using corehost.exe -->
<FscToolPath>$(FSharpSourcesRoot)\..\Tools\dotnetcli</FscToolPath>
<FscToolExe Condition="'$(OS)' != 'Unix'">dotnet.exe</FscToolExe>
......@@ -390,8 +390,8 @@
<!-- Use .NET Framework to bootstrap to proto -->
<PropertyGroup >
<OutputPath>$(FSharpSourcesRoot)\..\$(Configuration)\$(ProtoFlavour)\bin</OutputPath>
<FSharpCoreLkgPath>$(FSharpSourcesRoot)\..\packages\FSharp.Compiler.Tools.4.0.1.21\tools</FSharpCoreLkgPath>
<FSharpTargetsPath>..\packages\FSharp.Compiler.Tools.4.0.1.21\tools\Microsoft.FSharp.Targets</FSharpTargetsPath>
<FSharpCoreLkgPath>$(FSharpSourcesRoot)\..\packages\FSharp.Compiler.Tools.4.1.4\tools</FSharpCoreLkgPath>
<FSharpTargetsPath>..\packages\FSharp.Compiler.Tools.4.1.4\tools\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</When>
<When Condition="'$(BuildWith)' == '' AND ('$(TargetFramework)'=='portable47' OR '$(TargetFramework)'=='portable7' OR '$(TargetFramework)'=='portable78' OR '$(TargetFramework)'=='portable259' OR '$(TargetFramework)'=='coreclr')">
......@@ -488,40 +488,30 @@
<Import Project="scripts\fssrgen.targets" />
<Import Project="Microbuild.Settings.targets" Condition="'$(UseMicroBuild)' == 'true'"/>
<Target Name="ReorderCompileItems"
BeforeTargets="CoreCompile"
Condition="'$(GenerateTargetFrameworkAttribute)' == 'true' AND '$(AssemblyName)' == 'FSharp.Core'">
<ItemGroup>
<!-- Infrastructure puts AssemblyAttributes.fs at the beginning of the list and this will result and error when compiling FSharp.Core because all primitive types are not defined yet - fixup is required-->
<CompileAfter Include="@(CompileBefore)"/>
<CompileBefore Remove="@(CompileBefore)"/>
</ItemGroup>
</Target>
<Target Name="dotnetrestore" BeforeTargets="Build" Condition=" '$(TargetFramework)' == 'coreclr' ">
<Exec Command="$(MSBuildThisFileDirectory)..\.nuget\nuget.exe restore -PackagesDirectory $(PackagesDir) -Config $(MSBuildThisFileDirectory)..\.nuget\NuGet.Config project.json" />
</Target>
<Target Name="dotnetrestore" BeforeTargets="Build" Condition=" '$(DOTNET_PUBLISH)' == 'true' ">
<SetEnvVar Name="NUGET_PACKAGES" Value="$(NUGET_PACKAGES)" />
<Exec Command="$(MSBuildThisFileDirectory)..\Tools\dotnetcli\dotnet.exe restore --configfile $(MSBuildThisFileDirectory)..\.nuget\NuGet.Config project.json"/>
<Exec Command="$(MSBuildThisFileDirectory)..\Tools\dotnetcli\dotnet.exe restore &#45;&#45;configfile $(MSBuildThisFileDirectory)..\.nuget\NuGet.Config project.json"/>
</Target>
<Target Name="dotnetpublish" AfterTargets="Build" Condition=" '$(DOTNET_PUBLISH)' == 'true' ">
<SetEnvVar Name="NUGET_PACKAGES" Value="$(NUGET_PACKAGES)" />
<Exec Command="$(MSBuildThisFileDirectory)..\Tools\dotnetcli\dotnet.exe --verbose publish --no-build project.json -r $(DOTNET_PUBLISH_PLATFORM) -c $(Configuration) -o $(DOTNET_PUBLISH_PATH)"/>
<Exec Command="$(MSBuildThisFileDirectory)..\Tools\dotnetcli\dotnet.exe &#45;&#45;verbose publish &#45;&#45;no-build project.json -r $(DOTNET_PUBLISH_PLATFORM) -c $(Configuration) -o $(DOTNET_PUBLISH_PATH)"/>
</Target>
<Target Name="dotnetpublishfsccompiler" AfterTargets="CopyFilesToOutputDirectory" Condition=" '$(DOTNET_PUBLISH_FSC)' == 'true' ">
<SetEnvVar Name="NUGET_PACKAGES" Value="$(NUGET_PACKAGES)" />
<Exec Command="$(MSBuildThisFileDirectory)..\Tools\dotnetcli\dotnet.exe restore DeployCompiler\fsc\project.json"/>
<Exec Command="$(MSBuildThisFileDirectory)..\Tools\dotnetcli\dotnet.exe --verbose publish --no-build DeployCompiler\fsc\project.json -r $(DOTNET_PUBLISH_PLATFORM) -c $(Configuration) -o $(DOTNET_PUBLISH_FSC_PATH)"/>
<Exec Command="$(MSBuildThisFileDirectory)..\Tools\dotnetcli\dotnet.exe &#45;&#45;verbose publish &#45;&#45;no-build DeployCompiler\fsc\project.json -r $(DOTNET_PUBLISH_PLATFORM) -c $(Configuration) -o $(DOTNET_PUBLISH_FSC_PATH)"/>
</Target>
<Target Name="dotnetpublishfsicompiler" AfterTargets="CopyFilesToOutputDirectory" Condition=" '$(DOTNET_PUBLISH_FSI)' == 'true' ">
<SetEnvVar Name="NUGET_PACKAGES" Value="$(NUGET_PACKAGES)" />
<Exec Command="$(MSBuildThisFileDirectory)..\Tools\dotnetcli\dotnet.exe restore DeployCompiler\fsi\project.json"/>
<Exec Command="$(MSBuildThisFileDirectory)..\Tools\dotnetcli\dotnet.exe --verbose publish --no-build DeployCompiler\fsi\project.json -r $(DOTNET_PUBLISH_PLATFORM) -c $(Configuration) -o $(DOTNET_PUBLISH_FSI_PATH)"/>
<Exec Command="$(MSBuildThisFileDirectory)..\Tools\dotnetcli\dotnet.exe &#45;&#45;verbose publish &#45;&#45;no-build DeployCompiler\fsi\project.json -r $(DOTNET_PUBLISH_PLATFORM) -c $(Configuration) -o $(DOTNET_PUBLISH_FSI_PATH)"/>
</Target>
<Target Name="GenerateSourceLink" BeforeTargets="CoreCompile" Condition="'$(UseSourceLink)' == 'true'">
......
......@@ -616,14 +616,16 @@ let convFieldInit x =
// it isn't we resort to this technique...
let TypeBuilderInstantiationT =
let ty =
Type.GetType("System.Reflection.Emit.TypeBuilderInstantiation")
#if ENABLE_MONO_SUPPORT
let ty =
if runningOnMono && (isNull ty) then
Type.GetType("System.Reflection.MonoGenericClass")
if runningOnMono then
let ty = Type.GetType("System.Reflection.MonoGenericClass")
match ty with
| null -> Type.GetType("System.Reflection.Emit.TypeBuilderInstantiation")
| _ -> ty
else
ty
#endif
Type.GetType("System.Reflection.Emit.TypeBuilderInstantiation")
assert (not (isNull ty))
ty
......
......@@ -211,7 +211,7 @@ this file.
<ActualEmbeddedResources
Condition=" '$(UsingXBuild)' == true"
Include="@(_CoreCompileResourceInputs);@(ManifestResourceWithNoCulture);@(ManifestNonResxWithNoCultureOnDisk);@(CompiledLicenseFile);@(AdditionalEmbeddedResource)" />
<ActualEmbeddedResources
<ActualEmbeddedResources
Condition=" '$(UsingXBuild)' != true"
Include="@(_CoreCompileResourceInputs);@(CompiledLicenseFile);@(AdditionalEmbeddedResource)" />
</ItemGroup>
......@@ -305,7 +305,8 @@ this file.
Overwrite="true"/>
<ItemGroup>
<CompileBefore Include="$(TargetFrameworkMonikerAssemblyAttributesPath)" Condition="'$(AdditionalSourcesText)' != ''"/>
<CompileBefore Include="$(TargetFrameworkMonikerAssemblyAttributesPath)" Condition="'$(AdditionalSourcesText)' != '' AND ('$(OutputType)' == 'Exe' OR '$(OutputType)' == 'WinExe')"/>
<CompileAfter Include="$(TargetFrameworkMonikerAssemblyAttributesPath)" Condition="'$(AdditionalSourcesText)' != '' AND '$(OutputType)' != 'Exe' AND '$(OutputType)' != 'WinExe'"/>
</ItemGroup>
</Target>
......
......@@ -850,7 +850,10 @@ module LeafExpressionConverter =
// provides no other way to evaluate the expression.
//
// REVIEW: It is possible it is just better to interpret the expression in many common cases, e.g. property-gets, values etc.
let EvaluateQuotation (e: Microsoft.FSharp.Quotations.Expr) =
let EvaluateQuotation (e: Microsoft.FSharp.Quotations.Expr) : obj =
#if FX_NO_QUOTATIONS_COMPILE
raise (new NotSupportedException())
#else
match e with
| Value (obj,_) -> obj
| _ ->
......@@ -862,6 +865,6 @@ module LeafExpressionConverter =
d.DynamicInvoke [| box () |]
with :? System.Reflection.TargetInvocationException as exn ->
raise exn.InnerException
#endif
......@@ -266,10 +266,13 @@ module internal FSharpEnvironment =
| _ -> regkey.GetValue("Release", 0) :?> int |> (fun s -> s >= 0x50000)) // 0x50000 implies 4.5.0
with _ -> false
let runningOnMono = (Type.GetType("Mono.Runtime") <> null)
// Check if the framework version 4.5 or above is installed
let IsNetFx45OrAboveInstalled =
IsNetFx45OrAboveInstalledAt @"SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client" ||
IsNetFx45OrAboveInstalledAt @"SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full"
IsNetFx45OrAboveInstalledAt @"SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" ||
runningOnMono
// Check if the running framework version is 4.5 or above.
// Use the presence of v4.5.x in the registry to distinguish between 4.0 and 4.5
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册