未验证 提交 7376e22a 编写于 作者: D Don Syme 提交者: GitHub

debug fixes (#6170)

* debug fixes

* apply code review fixes
上级 54c22cde
......@@ -2790,22 +2790,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
......@@ -2821,6 +2825,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
......
......@@ -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."
......
......@@ -147,13 +147,14 @@ 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
......@@ -161,21 +162,22 @@ let internal SimulatedMSBuildResolver =
|> 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
......
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -217,11 +217,6 @@
<target state="translated">Birden çok '{0}.dll' başvurusuna izin verilmiyor</target>
<note />
</trans-unit>
<trans-unit id="buildCouldNotReadVersionInfoFromMscorlib">
<source>Could not read version from mscorlib.dll</source>
<target state="translated">Sürüm, mscorlib.dll'den okunamadı</target>
<note />
</trans-unit>
<trans-unit id="buildCannotReadAssembly">
<source>Unable to read assembly '{0}'</source>
<target state="translated">'{0}' bütünleştirilmiş kodu okunamıyor</target>
......
......@@ -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>
......
......@@ -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>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册