Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .nuget/NuGet.Config
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,12 @@
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
</configuration>
<packageSources>
<clear/>
<add key="myget.org dotnet-coreclr" value="https://www.myget.org/F/dotnet-coreclr/" />
<add key="myget.org dotnet-corefx" value="https://www.myget.org/F/dotnet-corefx/" />
<add key="myget.org dotnet-corefxtestdata" value="https://www.myget.org/F/dotnet-corefxtestdata/" />
<add key="myget.org dotnet-buildtools" value="https://www.myget.org/F/dotnet-buildtools/" />
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
</packageSources>
</configuration>
8 changes: 7 additions & 1 deletion appveyor-build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if not exist %_msbuildexe% echo Error: Could not find MSBuild.exe. && goto :eof
set _ngenexe="%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\ngen.exe"
if not exist %_ngenexe% echo Error: Could not find ngen.exe. && goto :failure

.\.nuget\NuGet.exe restore packages.config -PackagesDirectory packages
.\.nuget\NuGet.exe restore packages.config -PackagesDirectory packages -ConfigFile .\.nuget\NuGet.Config
@if ERRORLEVEL 1 echo Error: Nuget restore failed && goto :failure

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add CoreCLR build to AppVeyor

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

:: Build
Expand All @@ -36,6 +36,9 @@ if not exist %_ngenexe% echo Error: Could not find ngen.exe. && goto :failure
%_msbuildexe% src/fsharp-compiler-build.proj /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: compiler build failed && goto :failure

%_msbuildexe% src/fsharp-library-build.proj /p:TargetFramework=coreclr /p:Configuration=Release /p:RestorePackages=true
@if ERRORLEVEL 1 echo Error: library coreclr build failed && goto :failure

%_msbuildexe% src/fsharp-library-build.proj /p:TargetFramework=portable47 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library portable47 build failed && goto :failure

Expand Down Expand Up @@ -94,6 +97,9 @@ call RunTests.cmd release compilerunit
call RunTests.cmd release coreunit
@if ERRORLEVEL 1 echo Error: 'RunTests.cmd release coreunit' failed && goto :failure

call RunTests.cmd release fsharp coreclr
@if ERRORLEVEL 1 echo Error: 'RunTests.cmd release coreclr' failed && goto :failure

popd

goto :eof
Expand Down
4 changes: 4 additions & 0 deletions packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="dnx-coreclr-win-x86" version="1.0.0-beta6-12032" />
<package id="dnx-mono" version="1.0.0-beta5-12077" />
<package id="Microsoft.DotNet.BuildTools" version="1.0.25-prerelease-00053" />
<package id="NUnit" version="2.6.4" targetFramework="net40" />
<package id="NUnit.Runners" version="2.6.4" />
<package id="FSharp.Data" version="2.2.5" />
</packages>
89 changes: 81 additions & 8 deletions src/FSharpSource.targets
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<When Condition="'$(ProjectLanguage)' == 'FSharp'">
<Choose>
<When Condition="'$(AssemblyName)' == 'FSharp.Core'">
<PropertyGroup Condition="'$(TargetFramework)' == 'portable47' or '$(TargetFramework)' == 'portable7' or '$(TargetFramework)' == 'portable78' or '$(TargetFramework)' == 'portable259'">
<PropertyGroup Condition="'$(TargetFramework)' == 'portable47' or '$(TargetFramework)' == 'portable7' or '$(TargetFramework)' == 'portable78' or '$(TargetFramework)' == 'portable259' or '$(TargetFramework)' == 'coreclr'">
<IsPortableProfile>true</IsPortableProfile>
</PropertyGroup>
<PropertyGroup>
Expand All @@ -17,6 +17,9 @@
<OtherFlags Condition="'$(TargetFramework)' == 'portable47'">$(OtherFlags) --version:3.47.4.9055</OtherFlags>
<OtherFlags Condition="'$(TargetFramework)' == 'portable78'">$(OtherFlags) --version:3.78.4.9055</OtherFlags>
<OtherFlags Condition="'$(TargetFramework)' == 'portable259'">$(OtherFlags) --version:3.259.4.9055</OtherFlags>

<!-- TBD: consider better version number than 3.999.4.40955 Ideally it should be 4.4.0.9055 and be the new f#.cor for both desktop and coreclr -->
<OtherFlags Condition="'$(TargetFramework)' == 'coreclr'">$(OtherFlags) --version:3.999.4.9055</OtherFlags>
<OtherFlags>$(OtherFlags) --delaysign+ --keyfile:"$(FSharpSourcesRoot)\fsharp\msft.pubkey"</OtherFlags>
<DefineConstants>STRONG_NAME_AND_DELAY_SIGN_FSHARP_COMPILER_WITH_MSFT_KEY;$(DefineConstants)</DefineConstants>
<StrongNames>true</StrongNames>
Expand Down Expand Up @@ -139,6 +142,35 @@
<!-- MSbuild works out the assembly references -->
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)'=='coreclr'">
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<DefineConstants>$(DefineConstants);FSHARP_CORE_4_5</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_BEGINEND_READWRITE</DefineConstants>
<DefineConstants Condition="'$(Configuration)'!='Proto'">$(DefineConstants);FX_ATLEAST_45</DefineConstants>
<DefineConstants>$(DefineConstants);FX_ATLEAST_40</DefineConstants>
<DefineConstants>$(DefineConstants);FX_ATLEAST_35</DefineConstants>
<DefineConstants>$(DefineConstants);FX_ATLEAST_PORTABLE</DefineConstants>
<DefineConstants>$(DefineConstants);QUERIES_IN_FSLIB</DefineConstants>
<DefineConstants>$(DefineConstants);PUT_TYPE_PROVIDERS_IN_FSCORE;</DefineConstants>
<DefineConstants>$(DefineConstants);FX_ATLEAST_LINQ</DefineConstants>
<DefineConstants>$(DefineConstants);FX_RESHAPED_REFLECTION</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_CONVERTER</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_ARRAY_LONG_LENGTH</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_EXIT</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_DEFAULT_DEPENDENCY_TYPE</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_BINARY_SERIALIZATION</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_CUSTOMATTRIBUTEDATA</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_REFLECTION_METADATA_TOKENS</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_WEB_CLIENT</DefineConstants>
<DefineConstants>$(DefineConstants);FX_EVENTWAITHANDLE_NO_IDISPOSABLE</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_EXIT_CONTEXT_FLAGS</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_WAITONE_MILLISECONDS</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_PARAMETERIZED_THREAD_START</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_THREAD</DefineConstants>
<TargetFrameworkProfile>profile7</TargetFrameworkProfile> <!-- We are currently directly referencing corefx assemblies, so profile7 is not really true -->
<ImplicitlyExpandTargetFramework>false</ImplicitlyExpandTargetFramework> <!-- To stop msbuild being helpfull and referencing the dlls for the profile -->
</PropertyGroup>

<!-- Target Portable Profile 47 -->
<PropertyGroup Condition="'$(TargetFramework)'=='portable47'">

Expand Down Expand Up @@ -185,7 +217,6 @@
<DefineConstants>$(DefineConstants);FX_NO_EXCEPTIONDISPATCHINFO</DefineConstants>
<DefineConstants>$(DefineConstants);FX_ATLEAST_LINQ</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_THREAD</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_THREADPOOL</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_WAITONE_MILLISECONDS</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_TPL_PARALLEL</DefineConstants>
<DefineConstants>$(DefineConstants);PUT_TYPE_PROVIDERS_IN_FSCORE</DefineConstants>
Expand All @@ -203,6 +234,7 @@
<DefineConstants>$(DefineConstants);QUERIES_IN_FSLIB</DefineConstants>
<DefineConstants>$(DefineConstants);FX_ATLEAST_35</DefineConstants>
<DefineConstants>$(DefineConstants);FX_ATLEAST_PORTABLE</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_BEGINEND_READWRITE</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_ARRAY_LONG_LENGTH</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_EXIT</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_CHAR_PARSE</DefineConstants>
Expand All @@ -221,7 +253,6 @@
<DefineConstants>$(DefineConstants);FX_NO_REGISTERED_WAIT_HANDLES</DefineConstants>
<DefineConstants>$(DefineConstants);FX_ATLEAST_LINQ</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_THREAD</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_THREADPOOL</DefineConstants>
<DefineConstants>$(DefineConstants);PUT_TYPE_PROVIDERS_IN_FSCORE</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_CUSTOMATTRIBUTEDATA</DefineConstants>
<DefineConstants>$(DefineConstants);FX_RESHAPED_REFLECTION</DefineConstants>
Expand All @@ -237,6 +268,7 @@
<DefineConstants>$(DefineConstants);FSHARP_CORE_NETCORE_PORTABLE</DefineConstants>
<DefineConstants>$(DefineConstants);FSHARP_CORE_NETCORE_PORTABLE78</DefineConstants>
<DefineConstants>$(DefineConstants);QUERIES_IN_FSLIB</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_BEGINEND_READWRITE</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_CONVERTER</DefineConstants>
<DefineConstants>$(DefineConstants);FX_RESHAPED_REFLECTION</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_ARRAY_LONG_LENGTH</DefineConstants>
Expand All @@ -259,7 +291,6 @@
<DefineConstants>$(DefineConstants);FX_EVENTWAITHANDLE_NO_IDISPOSABLE</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_EXIT_CONTEXT_FLAGS</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_REGISTERED_WAIT_HANDLES</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_THREADPOOL</DefineConstants>
<DefineConstants>$(DefineConstants);PUT_TYPE_PROVIDERS_IN_FSCORE</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_CUSTOMATTRIBUTEDATA</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_CONCURRENT_DICTIONARY</DefineConstants>
Expand All @@ -272,6 +303,7 @@
<PropertyGroup Condition="'$(TargetFramework)'=='portable259'">
<DefineConstants>$(DefineConstants);FSHARP_CORE_NETCORE_PORTABLE</DefineConstants>
<DefineConstants>$(DefineConstants);FSHARP_CORE_NETCORE_PORTABLE259</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_BEGINEND_READWRITE</DefineConstants>
<DefineConstants>$(DefineConstants);QUERIES_IN_FSLIB</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_CONVERTER</DefineConstants>
<DefineConstants>$(DefineConstants);FX_RESHAPED_REFLECTION</DefineConstants>
Expand All @@ -295,7 +327,6 @@
<DefineConstants>$(DefineConstants);FX_EVENTWAITHANDLE_NO_IDISPOSABLE</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_EXIT_CONTEXT_FLAGS</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_REGISTERED_WAIT_HANDLES</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_THREADPOOL</DefineConstants>
<DefineConstants>$(DefineConstants);PUT_TYPE_PROVIDERS_IN_FSCORE</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_CUSTOMATTRIBUTEDATA</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_CONCURRENT_DICTIONARY</DefineConstants>
Expand Down Expand Up @@ -640,7 +671,7 @@
</PropertyGroup>

<Choose>
<When Condition="'$(TargetFramework)'=='portable47' OR '$(TargetFramework)'=='portable7' OR '$(TargetFramework)'=='portable78' OR '$(TargetFramework)'=='portable259'">
<When Condition="'$(TargetFramework)'=='portable47' OR '$(TargetFramework)'=='portable7' OR '$(TargetFramework)'=='portable78' OR '$(TargetFramework)'=='portable259' OR '$(TargetFramework)'=='coreclr'">
<PropertyGroup>
<FSharpTargetsPath>..\Proto\$(protoCLIDir)\bin\Microsoft.Portable.FSharp-proto.Targets</FSharpTargetsPath>
</PropertyGroup>
Expand Down Expand Up @@ -683,6 +714,47 @@
</Choose>
<Import Condition="'$(ProjectLanguage)' == 'FSharp'" Project="$(FSharpTargetsPath)"/>

<!-- Hook up DNX to enable solution refresh of packages -->
<PropertyGroup Condition="'$(TargetFramework)'=='coreclr'">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where are all of these properties used?


<NuGetPackagesPath Condition="'$(NuGetPackagesPath)' == ''">$(FSharpSourcesRoot)\..\packages</NuGetPackagesPath>

<!-- fix this to be not so unfortunate looking -->
<BuildToolsDir>$(MSBuildThisFileDirectory)..\packages\Microsoft.DotNet.BuildTools.1.0.25-prerelease-00053\lib\</BuildToolsDir>

<!-- Implicitly needed by packageresolve.targets. Should file a bug for a better error message here -->
<PackagesDir>$(NuGetPackagesPath)\</PackagesDir>

<DnxVersion Condition="'$(OsEnvironment)'!='Unix'">1.0.0-beta6-12032</DnxVersion>
<DnxVersion Condition="'$(OsEnvironment)'=='Unix'">1.0.0-beta5-12077</DnxVersion>
<DnxPackageName Condition="'$(DnxPackageName)' == '' and '$(OsEnvironment)'!='Unix'">dnx-coreclr-win-x86.$(DnxVersion)</DnxPackageName>
<DnxPackageName Condition="'$(DnxPackageName)' == '' and '$(OsEnvironment)'=='Unix'">dnx-mono.$(DnxVersion)</DnxPackageName>

<NuGetToolPath Condition="'$(NuGetToolPath)' == ''">$(FSharpSourcesRoot)\..\.nuget\</NuGetToolPath>
<NuGetConfigCommandLine>-ConfigFile "$(NuGetConfigFile)"</NuGetConfigCommandLine>

<NugetRestoreCommand>"$(NuGetToolPath)NuGet.exe"</NugetRestoreCommand>
<NugetRestoreCommand>$(NugetRestoreCommand) install</NugetRestoreCommand>
<NugetRestoreCommand>$(NugetRestoreCommand) -OutputDirectory "$(NuGetPackagesPath)"</NugetRestoreCommand>
<NugetRestoreCommand>$(NugetRestoreCommand) -Config "$(NuGetToolPath)NuGet.Config"</NugetRestoreCommand>

<DnxPackageDir Condition="'$(DnxPackageDir)'==''">$(NuGetPackagesPath)\$(DnxPackageName)/</DnxPackageDir>
<DnuToolPath Condition="'$(DnuToolPath)'=='' and '$(OS)' == 'Windows_NT'">$(DnxPackageDir)\bin\dnu.cmd</DnuToolPath>
<DnuToolPath Condition="'$(DnuToolPath)'=='' and '$(OS)' != 'Windows_NT'">$(DnxPackageDir)/bin/dnu</DnuToolPath>

<DnuRestoreCommand>"$(DnuToolPath)"</DnuRestoreCommand>
<DnuRestoreCommand>$(DnuRestoreCommand) restore</DnuRestoreCommand>
<DnuRestoreCommand>$(DnuRestoreCommand) --packages "$(PackagesDir.TrimEnd('/').TrimEnd('\\'))"</DnuRestoreCommand>
<DnuRestoreCommand>$(DnuRestoreCommand) -s:"https://www.myget.org/F/dotnet-core/"</DnuRestoreCommand>
<DnuRestoreCommand>$(DnuRestoreCommand) -s:"https://www.myget.org/F/dotnet-corefx/"</DnuRestoreCommand>
<DnuRestoreCommand>$(DnuRestoreCommand) -s:"https://www.myget.org/F/dotnet-buildtools"</DnuRestoreCommand>

<!-- Current version of DNX does not support all semantics used in our packages,
so we ignore the pre-calculation in the lock file and calculate asset applicability in the build task -->
<NuGetIngoreLockFile>true</NuGetIngoreLockFile>
</PropertyGroup>
<Import Condition="'$(TargetFramework)'=='coreclr'" Project="$(BuildToolsDir)Build.Common.Targets" />

<!-- Reference an existing FSI.EXE for use from within MSBuild -->
<PropertyGroup>
<FsSrGenToolPath>$(FSharpSourcesRoot)\..\lkg\FSharp-$(LkgVersion)\bin</FsSrGenToolPath>
Expand All @@ -706,9 +778,10 @@
Text="Configuration '$(Configuration)' is not one of the supported configurations: Debug, Release, Proto"
Condition="'$(Configuration)'!='Release' and '$(Configuration)'!='Debug' and '$(Configuration)'!='VSRelease' and '$(Configuration)'!='VSDebug' and '$(Configuration)'!='Proto'"/>
<Error
Text="TargetFramework '$(TargetFramework)' is not one of the supported configurations: 'empty', net20, net40, sl3-wp, sl5, sl5-compiler, portable47, portable7, portable78, portable259"
Text="TargetFramework '$(TargetFramework)' is not one of the supported configurations: 'empty', net20, net40, coreclr, sl3-wp, sl5, sl5-compiler, portable47, portable7, portable78, portable259"
Condition="! ('$(TargetFramework)' == 'net40' or
'$(TargetFramework)' == 'net20' or
'$(TargetFramework)' == 'coreclr' or
'$(TargetFramework)' == 'sl5' or
'$(TargetFramework)' == 'sl3-wp' or
'$(TargetFramework)' == 'portable47' or
Expand Down Expand Up @@ -748,6 +821,6 @@
</ItemGroup>
</Target>
<Target Name="BeforeBuild" BeforeTargets="Build">
<Exec Command=".\.nuget\NuGet.exe restore packages.config -PackagesDirectory packages" WorkingDirectory="$(FSharpSourcesRoot)\.."/>
<Exec Command=".\.nuget\NuGet.exe restore packages.config -PackagesDirectory packages -ConfigFile .\.nuget\NuGet.Config" WorkingDirectory="$(FSharpSourcesRoot)\.."/>
</Target>
</Project>
30 changes: 29 additions & 1 deletion src/absil/il.fs
Original file line number Diff line number Diff line change
Expand Up @@ -441,14 +441,42 @@ type AssemblyRefData =
/// Global state: table of all assembly references keyed by AssemblyRefData
let AssemblyRefUniqueStampGenerator = new UniqueStampGenerator<AssemblyRefData>()

let compareVersions x y =
match x,y with
| None, None -> 0
| Some _, None -> 1
| None, Some _ -> -1
| Some(x1,x2,x3,x4), Some(y1,y2,y3,y4) ->
if y1>x1 then 1
elif y1<x1 then -1
elif y2>x2 then 1
elif y2<x1 then -1
elif y3>x3 then 1
elif y3<x1 then -1
elif y4>x4 then 1
elif y4<x1 then -1
else 0

let isMscorlib data =
if System.String.Compare(data.assemRefName, "mscorlib") = 0 then true
else false

let GetReferenceUnifiedVersion data =
let mutable highest = data.assemRefVersion
if not (isMscorlib data) then
for ref in AssemblyRefUniqueStampGenerator.Table do
if System.String.Compare(ref.assemRefName, data.assemRefName) = 0 && highest < ref.assemRefVersion then
highest <- ref.assemRefVersion
highest

[<Sealed>]
type ILAssemblyRef(data) =
let uniqueStamp = AssemblyRefUniqueStampGenerator.Encode(data)
member x.Name=data.assemRefName
member x.Hash=data.assemRefHash
member x.PublicKey=data.assemRefPublicKeyInfo
member x.Retargetable=data.assemRefRetargetable
member x.Version=data.assemRefVersion
member x.Version=GetReferenceUnifiedVersion data
member x.Locale=data.assemRefLocale
member x.UniqueStamp=uniqueStamp
override x.GetHashCode() = uniqueStamp
Expand Down
1 change: 1 addition & 0 deletions src/absil/illib.fs
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@ type UniqueStampGenerator<'T when 'T : equality>() =
nItems <- nItems + 1
idx
member this.Encode(str) = encode str
member this.Table = encodeTab.Keys

//---------------------------------------------------------------------------
// memoize tables (all entries cached, never collected)
Expand Down
Loading