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

Merge master to dev16.1 #6252

Merged
merged 7 commits into from
Feb 19, 2019
Merged
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
26 changes: 24 additions & 2 deletions .vsts-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ jobs:
vmImage: ubuntu-16.04
timeoutInMinutes: 90
strategy:
maxParallel: 2
maxParallel: 3
matrix:
dotnet_sdk:
_command: make
_args: Configuration=release
# disabled until it can be properly fixed
release_fcs:
_command: ./fcs/build.sh
_args: Build
Expand All @@ -23,6 +22,29 @@ jobs:
continueOnError: true
condition: failed()

- job: MacOS
pool:
vmImage: macOS-10.13
timeoutInMinutes: 90
strategy:
maxParallel: 3
matrix:
dotnet_sdk:
_command: make
_args: Configuration=release
release_fcs:
_command: ./fcs/build.sh
_args: Build
steps:
- script: $(_command) $(_args)
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/TestResults'
ArtifactName: 'MacOS $(_command) $(_args)'
publishLocation: Container
continueOnError: true
condition: failed()

- job: Windows
pool:
vmImage: vs2017-win2016
Expand Down
14 changes: 12 additions & 2 deletions FSharpBuild.Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,19 @@

<!-- mono -->
<PropertyGroup Condition="'$(OS)' == 'Unix'">
<MonoRoot Condition="'$(MonoRoot)' == '' and $([MSBuild]::IsOsPlatform('Linux'))">/usr</MonoRoot>
<MonoRoot Condition="'$(MonoRoot)' == '' and $([MSBuild]::IsOsPlatform('OSX'))">/Library/Frameworks/Mono.framework/Versions/Current</MonoRoot>
<MonoLibFolder>$(MonoRoot)/lib/mono</MonoLibFolder>
<MonoPackaging Condition="$(TargetFramework.StartsWith('net4'))">true</MonoPackaging>
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net45'">/usr/lib/mono/4.5-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net46'">/usr/lib/mono/4.6-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net45'">$(MonoLibFolder)/4.5-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net451'">$(MonoLibFolder)/4.5.1-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net452'">$(MonoLibFolder)/4.5.2-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net46'">$(MonoLibFolder)/4.6-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net461'">$(MonoLibFolder)/4.6.1-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net462'">$(MonoLibFolder)/4.6.2-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net47'">$(MonoLibFolder)/4.7-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net471'">$(MonoLibFolder)/4.7.1-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net472'">$(MonoLibFolder)/4.7.2-api</FrameworkPathOverride>
</PropertyGroup>

<!-- signing -->
Expand Down
5 changes: 2 additions & 3 deletions build/config/AssemblySignToolData.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"certificate": "VsixSHA2",
"strongName": null,
"values": [
"bin\\VisualFSharpFull\\*\\*VisualFSharpFull.vsix",
"bin\\VisualFSharpFull\\*\\*\\VisualFSharpFull.vsix",
"bin\\VisualFSharpTemplates\\*\\*\\VisualFSharpTemplate.vsix",
"VSSetup\\*\\Insertion\\Microsoft.FSharp.Dependencies.vsix",
"VSSetup\\*\\Insertion\\Microsoft.FSharp.VSIX.Full.Resources.*.vsix"
Expand All @@ -49,8 +49,7 @@
"certificate": "NuGet",
"strongName": null,
"values": [
"artifacts\\*.nupkg",
"artifacts\\*\\*.nupkg"
"packages\\*\\*.nupkg"
]
}
],
Expand Down
22 changes: 13 additions & 9 deletions fsharp.proj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
<BuildFCS Condition="'$(BUILD_FCS)' == '1'">true</BuildFCS>
<BuildNuget Condition="'$(BUILD_NUGET)' == '1' or '$(BUILD_SETUP)' == '1'">true</BuildNuget>
<BuildSetup Condition="'$(BUILD_SETUP)' == '1'">true</BuildSetup>
<BuildNuget Condition="'$(BUILD_NUGET)' == '1'">true</BuildNuget>

<TestCompiler Condition="'$(TEST_NET40_COMPILERUNIT_SUITE)' == '1'">true</TestCompiler>
<TestCompiler Condition="'$(TEST_CORECLR_COREUNIT_SUITE)' == '1'">true</TestCompiler>
Expand Down Expand Up @@ -91,10 +90,11 @@
<Projects Include="$(MSBuildThisFileDirectory)vsintegration\Utils\LanguageServiceProfiling\LanguageServiceProfiling.fsproj" />
<Projects Include="$(MSBuildThisFileDirectory)vsintegration\fsharp-vsintegration-item-templates-build.proj" />
<Projects Include="$(MSBuildThisFileDirectory)vsintegration\fsharp-vsintegration-project-templates-build.proj" />
<Projects Include="$(MSBuildThisFileDirectory)vsintegration\fsharp-vsintegration-vsix-build.proj" />
<VsixProjects Include="$(MSBuildThisFileDirectory)\vsintegration\Vsix\VisualFSharpFull\VisualFSharpFull.csproj" />
<VsixProjects Include="$(MSBuildThisFileDirectory)\vsintegration\Vsix\VisualFSharpTemplates\VisualFSharpTemplates.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(BuildCompiler)' == 'true' OR '$(BuildNuget)' == 'true' OR '$(BuildVS)' == 'true' OR'$(_RunningRestore)' == 'true'">
<ItemGroup Condition="'$(BuildCompiler)' == 'true' OR '$(BuildNuget)' == 'true' OR '$(BuildVS)' == 'true' OR '$(_RunningRestore)' == 'true'">
<NugetProjects Include="src\fsharp\FSharp.Core\FSharp.Core.fsproj" />
</ItemGroup>

Expand All @@ -111,7 +111,7 @@
</ItemGroup>

<ItemGroup Condition="'$(BuildSetup)' == 'true' OR '$(_RunningRestore)' == 'true'">
<Projects Include="$(MSBuildThisFileDirectory)setup\fsharp-setup-build.csproj" />
<SetupProjects Include="$(MSBuildThisFileDirectory)setup\fsharp-setup-build.csproj" />
</ItemGroup>

<!-- test binaries -->
Expand Down Expand Up @@ -155,21 +155,25 @@
</Target>

<Target Name="Build" DependsOnTargets="CollectProjects">
<!-- Nuget projects need to be built before the vsix stuff, so that the vsix build -->
<MSBuild Projects="@(NugetProjects);@(Projects)" Targets="Build" Properties="Configuration=$(Configuration);BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN);$(CustomProps)" />
<MSBuild Projects="@(NugetProjects)" Targets="Pack" Properties="Configuration=$(Configuration);BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN);$(CustomProps)" />
<MSBuild Projects="@(Projects);@(NugetProjects)" Targets="Build" Properties="Configuration=$(Configuration);BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN);$(CustomProps)" />
<MSBuild Projects="@(VsixProjects)" Targets="Build" Properties="Configuration=$(Configuration);BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN);$(CustomProps)" />
<MSBuild Projects="@(SetupProjects)" Targets="Build" Properties="Configuration=$(Configuration);BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN);$(CustomProps)" />
</Target>

<Target Name="Rebuild" DependsOnTargets="CollectProjects">
<MSBuild Projects="@(Projects);@(NugetProjects)" Targets="Rebuild" Properties="Configuration=$(Configuration);BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN);$(CustomProps)" />
<MSBuild Projects="@(NugetProjects);@(Projects)" Targets="Rebuild" Properties="Configuration=$(Configuration);BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN);$(CustomProps)" />
<MSBuild Projects="@(NugetProjects)" Targets="Pack" Properties="Configuration=$(Configuration);BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN);$(CustomProps)" />
<MSBuild Projects="@(VsixProjects)" Targets="Rebuild" Properties="Configuration=$(Configuration);BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN);$(CustomProps)" />
<MSBuild Projects="@(SetupProjects)" Targets="Rebuild" Properties="Configuration=$(Configuration);BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN);$(CustomProps)" />
</Target>

<Target Name="Clean" DependsOnTargets="CollectProjects">
<MSBuild Projects="@(Projects);@(NugetProjects)" Targets="Clean" Properties="Configuration=$(Configuration);BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN);$(CustomProps)" />
<MSBuild Projects="@(Projects);@(NugetProjects);@(VsixProjects);@(SetupProjects)" Targets="Clean" Properties="Configuration=$(Configuration);BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN);$(CustomProps)" />
</Target>

<Target Name="Restore" DependsOnTargets="_BeforeRestore;CollectProjects">
<MSBuild Projects="@(Projects);@(NugetProjects)" Targets="Restore" Properties="Configuration=$(Configuration);BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN);$(CustomProps)" />
<MSBuild Projects="@(Projects);@(NugetProjects);@(VsixProjects);@(SetupProjects)" Targets="Restore" Properties="Configuration=$(Configuration);BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN);$(CustomProps)" />
</Target>

</Project>
8 changes: 4 additions & 4 deletions setup/Swix/Microsoft.FSharp.vsmanproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
</PropertyGroup>

<ItemGroup>
<InsertionItems Include="$(VsixBuildLocation)\VisualFSharpFull.vsix" />
<InsertionItems Include="$(VsixBuildLocation)\VisualFSharpTemplate.vsix" />
<InsertionItems Include="$(VsixBuildLocation)\Microsoft.FSharp.VSIX.Full.Core.json" />
<InsertionItems Include="$(VsixBuildLocation)\Microsoft.FSharp.VSIX.Templates.json" />
<InsertionItems Include="$(ArtifactsDir)\bin\VisualFSharpFull\$(Configuration)\net472\VisualFSharpFull.vsix" />
<InsertionItems Include="$(ArtifactsDir)\bin\VisualFSharpFull\$(Configuration)\net472\Microsoft.FSharp.VSIX.Full.Core.json" />
<InsertionItems Include="$(ArtifactsDir)\bin\VisualFSharpTemplates\$(Configuration)\net472\VisualFSharpTemplate.vsix" />
<InsertionItems Include="$(ArtifactsDir)\bin\VisualFSharpTemplates\$(Configuration)\net472\Microsoft.FSharp.VSIX.Templates.json" />
</ItemGroup>

<Target Name="CopyInsertionItems">
Expand Down
12 changes: 0 additions & 12 deletions setup/fsharp-setup-build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,6 @@
</ItemGroup>

<Target Name="CollectSetupProjects">
<ItemGroup>
<VsixProjects Include="VisualFSharpFull.csproj">
<ProjectPath>..\vsintegration\Vsix\VisualFSharpFull\VisualFSharpFull.csproj</ProjectPath>
</VsixProjects>
<VsixProjects Include="VisualFSharpTemplates.csproj">
<ProjectPath>..\vsintegration\Vsix\VisualFSharpTemplates\VisualFSharpTemplates.csproj</ProjectPath>
</VsixProjects>
</ItemGroup>

<CreateItem Include="@(SetupLanguages)"
AdditionalMetadata="ProjectPath=Swix\Microsoft.FSharp.Vsix.Resources\Microsoft.FSharp.Vsix.Resources.swixproj">
<Output ItemName="SwixSetupProjects" TaskParameter="Include" />
Expand Down Expand Up @@ -59,9 +50,6 @@
<PropertyGroup>
<CustomProps>AssemblySearchPaths={HintPathFromItem};{TargetFrameworkDirectory};{RawFileName}</CustomProps>
</PropertyGroup>
<MSBuild Projects="%(VsixProjects.ProjectPath)"
Targets="Build"
Properties="Configuration=$(Configuration);IsLangPack=%(VsixProjects.IsLangPack);FSharpPackageVersion=$(FSharpPackageVersion);OutputPath=$(VsixBuildLocation);DisableOutputPathCopying=true;$(CustomProps)" />
<MSBuild Projects="%(SwixSetupProjects.ProjectPath)"
Targets="Build"
Properties="LocaleCode=%(SwixSetupProjects.LocaleCode);LocaleId=%(SwixSetupProjects.LocaleId);LocaleParentId=%(SwixSetupProjects.LocaleParentId);LocaleParentCulture=%(SwixSetupProjects.LocaleParentCulture);LocaleSpecificCulture=%(SwixSetupProjects.LocaleSpecificCulture);IsLangPack=%(SwixSetupProjects.IsLangPack);FSharpPackageVersion=$(FSharpPackageVersion);VSGeneralVersion=$(VSGeneralVersion);TargetFramework=$(TargetFramework);$(CustomProps)"/>
Expand Down
25 changes: 15 additions & 10 deletions src/fsharp/CompileOps.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2793,22 +2793,26 @@ type TcConfig private (data : TcConfigBuilder, validate:bool) =
error(Error(FSComp.SR.buildExplicitCoreLibRequiresNoFramework("--noframework"), rangeStartup))

let ilGlobals = mkILGlobals ILScopeRef.Local

// clrRoot: the location of the primary assembly (mscorlib.dll or netstandard.dll or System.Runtime.dll)
//
// targetFrameworkVersionValue: Normally just HighestInstalledNetFrameworkVersion()
//
// Note, when mscorlib.dll has been given explicitly the actual value of
// targetFrameworkVersion shouldn't matter since resolution has already happened.
// In those cases where it does matter (e.g. --noframework is not being used or we are processing further
// resolutions for a script) then it is correct to just use HighestInstalledNetFrameworkVersion().
let clrRootValue, targetFrameworkVersionValue =
match primaryAssemblyExplicitFilenameOpt with
| Some(primaryAssemblyFilename) ->
| Some primaryAssemblyFilename ->
let filename = ComputeMakePathAbsolute data.implicitIncludeDir primaryAssemblyFilename
try
use ilReader = OpenILBinary(filename, data.reduceMemoryUsage, ilGlobals, None, data.shadowCopyReferences, data.tryGetMetadataSnapshot)
let ilModule = ilReader.ILModuleDef
match ilModule.ManifestOfAssembly.Version with
| Some(v1, v2, _, _) ->
let clrRoot = Some(Path.GetDirectoryName(FileSystem.GetFullPathShim(filename)))
clrRoot, (sprintf "v%d.%d" v1 v2)
| _ ->
failwith (FSComp.SR.buildCouldNotReadVersionInfoFromMscorlib())
let clrRoot = Some(Path.GetDirectoryName(FileSystem.GetFullPathShim(filename)))
clrRoot, data.legacyReferenceResolver.HighestInstalledNetFrameworkVersion()
with e ->
// We no longer expect the above to fail but leaving this just in case
error(Error(FSComp.SR.buildErrorOpeningBinaryFile(filename, e.Message), rangeStartup))
| _ ->
| None ->
#if !ENABLE_MONO_SUPPORT
// TODO: we have to get msbuild out of this
if data.useSimpleResolution then
Expand All @@ -2824,6 +2828,7 @@ type TcConfig private (data : TcConfigBuilder, validate:bool) =
let fsharpBinariesDirValue =
// NOTE: It's not clear why this behaviour has been changed for the NETSTANDARD compilations of the F# compiler
#if NETSTANDARD1_6 || NETSTANDARD2_0
ignore ilGlobals
data.defaultFSharpBinariesDir
#else
match fslibExplicitFilenameOpt with
Expand Down
1 change: 0 additions & 1 deletion src/fsharp/FSComp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ buildProductNameCommunity,"F# Compiler for F# %s"
213,buildInvalidAssemblyName,"'%s' is not a valid assembly name"
214,buildInvalidPrivacy,"Unrecognized privacy setting '%s' for managed resource, valid options are 'public' and 'private'"
215,buildMultipleReferencesNotAllowed,"Multiple references to '%s.dll' are not permitted"
buildCouldNotReadVersionInfoFromMscorlib,"Could not read version from mscorlib.dll"
218,buildCannotReadAssembly,"Unable to read assembly '%s'"
220,buildAssemblyResolutionFailed,"Assembly resolution failure at or near this location"
221,buildImplicitModuleIsNotLegalIdentifier,"The declarations in this file will be placed in an implicit module '%s' based on the file name '%s'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file."
Expand Down
46 changes: 24 additions & 22 deletions src/fsharp/SimulatedMSBuildReferenceResolver.fs
Original file line number Diff line number Diff line change
Expand Up @@ -147,35 +147,37 @@ let internal SimulatedMSBuildResolver =
match n.Version, n.GetPublicKeyToken() with
| null, _ | _,null ->
let options =
[ for gacdir in Directory.EnumerateDirectories(gac) do
let assdir = Path.Combine(gacdir,n.Name)
if Directory.Exists(assdir) then
for tdir in Directory.EnumerateDirectories(assdir) do
let trialPath = Path.Combine(tdir,qual)
if FileSystem.SafeExists(trialPath) then
yield trialPath ]
[ if Directory.Exists(gac) then
for gacdir in Directory.EnumerateDirectories(gac) do
let assemblyDir = Path.Combine(gacdir,n.Name)
if Directory.Exists(assemblyDir) then
for tdir in Directory.EnumerateDirectories(assemblyDir) do
let trialPath = Path.Combine(tdir,qual)
if FileSystem.SafeExists(trialPath) then
yield trialPath ]
//printfn "sorting GAC paths: %A" options
options
|> List.sort // puts latest version last
|> List.tryLast
|> function None -> () | Some p -> success p

| v,tok ->
for gacdir in Directory.EnumerateDirectories(gac) do
//printfn "searching GAC directory: %s" gacdir
let assdir = Path.Combine(gacdir,n.Name)
if Directory.Exists(assdir) then
//printfn "searching GAC directory: %s" assdir

let tokText = String.concat "" [| for b in tok -> sprintf "%02x" b |]
let verdir = Path.Combine(assdir,"v4.0_"+v.ToString()+"__"+tokText)
//printfn "searching GAC directory: %s" verdir

if Directory.Exists(verdir) then
let trialPath = Path.Combine(verdir,qual)
//printfn "searching GAC: %s" trialPath
if FileSystem.SafeExists(trialPath) then
success trialPath
if Directory.Exists(gac) then
for gacdir in Directory.EnumerateDirectories(gac) do
//printfn "searching GAC directory: %s" gacdir
let assemblyDir = Path.Combine(gacdir,n.Name)
if Directory.Exists(assemblyDir) then
//printfn "searching GAC directory: %s" assemblyDir

let tokText = String.concat "" [| for b in tok -> sprintf "%02x" b |]
let verdir = Path.Combine(assemblyDir,"v4.0_"+v.ToString()+"__"+tokText)
//printfn "searching GAC directory: %s" verdir

if Directory.Exists(verdir) then
let trialPath = Path.Combine(verdir,qual)
//printfn "searching GAC: %s" trialPath
if FileSystem.SafeExists(trialPath) then
success trialPath
with e -> logWarningOrError false "SR001" (e.ToString())
#endif

Expand Down
Loading