Skip to content

Commit

Permalink
Merge pull request #6252 from Microsoft/merges/master-to-dev16.1
Browse files Browse the repository at this point in the history
Merge master to dev16.1
  • Loading branch information
brettfo authored Feb 19, 2019
2 parents 9cc4238 + fc15661 commit bce0c11
Show file tree
Hide file tree
Showing 22 changed files with 76 additions and 142 deletions.
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
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
18 changes: 0 additions & 18 deletions src/fsharp/service/IncrementalBuild.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1534,22 +1534,14 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput
let stampedFileNamesNode = Vector.Stamp "SourceFileTimeStamps" StampFileNameTask fileNamesNode
let stampedReferencedAssembliesNode = Vector.Stamp "StampReferencedAssembly" StampReferencedAssemblyTask referencedAssembliesNode
let initialTcAccNode = Vector.Demultiplex "CombineImportedAssemblies" CombineImportedAssembliesTask stampedReferencedAssembliesNode
#if FCS_RETAIN_BACKGROUND_PARSE_RESULTS
let parseTreesNode = Vector.Map "ParseTrees" ParseTask stampedFileNamesNode
let tcStatesNode = Vector.ScanLeft "TypeCheckingStates" TypeCheckTask initialTcAccNode stampedFileNamesNode
#else
let tcStatesNode = Vector.ScanLeft "TypeCheckingStates" (fun ctok tcAcc n -> TypeCheckTask ctok tcAcc (ParseTask ctok n)) initialTcAccNode stampedFileNamesNode
#endif
let finalizedTypeCheckNode = Vector.Demultiplex "FinalizeTypeCheck" FinalizeTypeCheckTask tcStatesNode

// Outputs
let buildDescription = new BuildDescriptionScope ()

do buildDescription.DeclareVectorOutput stampedFileNamesNode
do buildDescription.DeclareVectorOutput stampedReferencedAssembliesNode
#if FCS_RETAIN_BACKGROUND_PARSE_RESULTS
do buildDescription.DeclareVectorOutput parseTreesNode
#endif
do buildDescription.DeclareVectorOutput tcStatesNode
do buildDescription.DeclareScalarOutput initialTcAccNode
do buildDescription.DeclareScalarOutput finalizedTypeCheckNode
Expand Down Expand Up @@ -1712,15 +1704,6 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput
member builder.GetParseResultsForFile (ctok: CompilationThreadToken, filename) =
cancellable {
let slotOfFile = builder.GetSlotOfFileName filename
#if FCS_RETAIN_BACKGROUND_PARSE_RESULTS
match GetVectorResultBySlot(parseTreesNode, slotOfFile, partialBuild) with
| Some (results, _) -> return results
| None ->
let! build = IncrementalBuild.EvalUpTo ctok SavePartialBuild (parseTreesNode, slotOfFile) partialBuild
match GetVectorResultBySlot(parseTreesNode, slotOfFile, build) with
| Some (results, _) -> return results
| None -> return! failwith "Build was not evaluated, expected the results to be ready after 'Eval' (GetParseResultsForFile)."
#else
let! results =
cancellable {
match GetVectorResultBySlot(stampedFileNamesNode, slotOfFile, partialBuild) with
Expand All @@ -1734,7 +1717,6 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput
}
// re-parse on demand instead of retaining
return ParseTask ctok results
#endif
}

member __.SourceFiles = sourceFiles |> List.map (fun (_, f, _) -> f)
Expand Down
5 changes: 0 additions & 5 deletions src/fsharp/xlf/FSComp.txt.cs.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,6 @@
<target state="translated">Víc odkazů na knihovnu {0}.dll se nepovoluje.</target>
<note />
</trans-unit>
<trans-unit id="buildCouldNotReadVersionInfoFromMscorlib">
<source>Could not read version from mscorlib.dll</source>
<target state="translated">Nedala se přečíst verze souboru mscorlib.dll.</target>
<note />
</trans-unit>
<trans-unit id="buildCannotReadAssembly">
<source>Unable to read assembly '{0}'</source>
<target state="translated">Sestavení {0} se nedá přečíst.</target>
Expand Down
5 changes: 0 additions & 5 deletions src/fsharp/xlf/FSComp.txt.de.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,6 @@
<target state="translated">Mehrere Verweise auf "{0}.dll" sind nicht zulässig</target>
<note />
</trans-unit>
<trans-unit id="buildCouldNotReadVersionInfoFromMscorlib">
<source>Could not read version from mscorlib.dll</source>
<target state="translated">Version konnte nicht aus "mscorlib.dll" gelesen werden.</target>
<note />
</trans-unit>
<trans-unit id="buildCannotReadAssembly">
<source>Unable to read assembly '{0}'</source>
<target state="translated">Assembly "{0}" kann nicht gelesen werden.</target>
Expand Down
5 changes: 0 additions & 5 deletions src/fsharp/xlf/FSComp.txt.en.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,6 @@
<target state="new">Multiple references to '{0}.dll' are not permitted</target>
<note />
</trans-unit>
<trans-unit id="buildCouldNotReadVersionInfoFromMscorlib">
<source>Could not read version from mscorlib.dll</source>
<target state="new">Could not read version from mscorlib.dll</target>
<note />
</trans-unit>
<trans-unit id="buildCannotReadAssembly">
<source>Unable to read assembly '{0}'</source>
<target state="new">Unable to read assembly '{0}'</target>
Expand Down
5 changes: 0 additions & 5 deletions src/fsharp/xlf/FSComp.txt.es.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,6 @@
<target state="translated">No se permiten varias referencias a '{0}.dll'.</target>
<note />
</trans-unit>
<trans-unit id="buildCouldNotReadVersionInfoFromMscorlib">
<source>Could not read version from mscorlib.dll</source>
<target state="translated">No se pudo leer la versión de mscorlib.dll.</target>
<note />
</trans-unit>
<trans-unit id="buildCannotReadAssembly">
<source>Unable to read assembly '{0}'</source>
<target state="translated">No se puede leer el ensamblado '{0}'.</target>
Expand Down
5 changes: 0 additions & 5 deletions src/fsharp/xlf/FSComp.txt.fr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,6 @@
<target state="translated">Les références multiples à '{0}.dll' ne sont pas autorisées</target>
<note />
</trans-unit>
<trans-unit id="buildCouldNotReadVersionInfoFromMscorlib">
<source>Could not read version from mscorlib.dll</source>
<target state="translated">Impossible de lire la version à partir de mscorlib.dll</target>
<note />
</trans-unit>
<trans-unit id="buildCannotReadAssembly">
<source>Unable to read assembly '{0}'</source>
<target state="translated">Impossible de lire l'assembly '{0}'</target>
Expand Down
5 changes: 0 additions & 5 deletions src/fsharp/xlf/FSComp.txt.it.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,6 @@
<target state="translated">Non sono consentiti più riferimenti a '{0}.dll'</target>
<note />
</trans-unit>
<trans-unit id="buildCouldNotReadVersionInfoFromMscorlib">
<source>Could not read version from mscorlib.dll</source>
<target state="translated">Non è stato possibile leggere la versione da mscorlib.dll</target>
<note />
</trans-unit>
<trans-unit id="buildCannotReadAssembly">
<source>Unable to read assembly '{0}'</source>
<target state="translated">Non è possibile leggere l'assembly '{0}'</target>
Expand Down
5 changes: 0 additions & 5 deletions src/fsharp/xlf/FSComp.txt.ja.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,6 @@
<target state="translated">'{0}.dll' に対する複数の参照は許可されていません</target>
<note />
</trans-unit>
<trans-unit id="buildCouldNotReadVersionInfoFromMscorlib">
<source>Could not read version from mscorlib.dll</source>
<target state="translated">mscorlib.dll からバージョンを読み取ることができませんでした</target>
<note />
</trans-unit>
<trans-unit id="buildCannotReadAssembly">
<source>Unable to read assembly '{0}'</source>
<target state="translated">アセンブリ '{0}' を読み取れません</target>
Expand Down
5 changes: 0 additions & 5 deletions src/fsharp/xlf/FSComp.txt.ko.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,6 @@
<target state="translated">'{0}.dll'에 대한 다중 참조는 허용되지 않습니다.</target>
<note />
</trans-unit>
<trans-unit id="buildCouldNotReadVersionInfoFromMscorlib">
<source>Could not read version from mscorlib.dll</source>
<target state="translated">mscorlib.dll에서 버전을 읽을 수 없습니다.</target>
<note />
</trans-unit>
<trans-unit id="buildCannotReadAssembly">
<source>Unable to read assembly '{0}'</source>
<target state="translated">'{0}' 어셈블리를 읽을 수 없습니다.</target>
Expand Down
5 changes: 0 additions & 5 deletions src/fsharp/xlf/FSComp.txt.pl.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,6 @@
<target state="translated">Używanie wielu odwołań do pliku „{0}.dll” jest niedozwolone</target>
<note />
</trans-unit>
<trans-unit id="buildCouldNotReadVersionInfoFromMscorlib">
<source>Could not read version from mscorlib.dll</source>
<target state="translated">Nie można odczytać wersji z pliku mscorlib.dll</target>
<note />
</trans-unit>
<trans-unit id="buildCannotReadAssembly">
<source>Unable to read assembly '{0}'</source>
<target state="translated">Nie można odczytać zestawu „{0}”</target>
Expand Down
5 changes: 0 additions & 5 deletions src/fsharp/xlf/FSComp.txt.pt-BR.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,6 @@
<target state="translated">As referências múltiplas '{0}.dll' não são permitidas</target>
<note />
</trans-unit>
<trans-unit id="buildCouldNotReadVersionInfoFromMscorlib">
<source>Could not read version from mscorlib.dll</source>
<target state="translated">Não foi possível ler a versão em mscorlib.dll</target>
<note />
</trans-unit>
<trans-unit id="buildCannotReadAssembly">
<source>Unable to read assembly '{0}'</source>
<target state="translated">Não é possível ler o assembly '{0}'</target>
Expand Down
Loading

0 comments on commit bce0c11

Please sign in to comment.