From b834b1284ef36e04b3d4ce624b457ceb6209ebb6 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Tue, 24 Sep 2019 12:15:04 -0700 Subject: [PATCH] relax multiple load objection (#7613) --- src/fsharp/CompileOps.fs | 12 ++++-------- src/fsharp/FSComp.txt | 1 - src/fsharp/xlf/FSComp.txt.cs.xlf | 5 ----- src/fsharp/xlf/FSComp.txt.de.xlf | 5 ----- src/fsharp/xlf/FSComp.txt.es.xlf | 5 ----- src/fsharp/xlf/FSComp.txt.fr.xlf | 5 ----- src/fsharp/xlf/FSComp.txt.it.xlf | 5 ----- src/fsharp/xlf/FSComp.txt.ja.xlf | 5 ----- src/fsharp/xlf/FSComp.txt.ko.xlf | 5 ----- src/fsharp/xlf/FSComp.txt.pl.xlf | 5 ----- src/fsharp/xlf/FSComp.txt.pt-BR.xlf | 5 ----- src/fsharp/xlf/FSComp.txt.ru.xlf | 5 ----- src/fsharp/xlf/FSComp.txt.tr.xlf | 5 ----- src/fsharp/xlf/FSComp.txt.zh-Hans.xlf | 5 ----- src/fsharp/xlf/FSComp.txt.zh-Hant.xlf | 5 ----- 15 files changed, 4 insertions(+), 74 deletions(-) diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs index 624a27f92d9..e2cbf4474f6 100644 --- a/src/fsharp/CompileOps.fs +++ b/src/fsharp/CompileOps.fs @@ -2572,17 +2572,13 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) = let filename = ComputeMakePathAbsolute data.implicitIncludeDir r.Text if FileSystem.SafeExists filename then r, Some filename - else + else // If the file doesn't exist, let reference resolution logic report the error later... defaultCoreLibraryReference, if Range.equals r.Range rangeStartup then Some(filename) else None match data.referencedDLLs |> List.filter (fun assemblyReference -> assemblyReference.SimpleAssemblyNameIs libraryName) with - | [r] -> nameOfDll r - | [] -> - defaultCoreLibraryReference, None - | r :: _ -> - // Recover by picking the first one. - errorR(Error(FSComp.SR.buildMultipleReferencesNotAllowed libraryName, rangeCmdArgs)) - nameOfDll r + | [] -> defaultCoreLibraryReference, None + | [r] + | r :: _ -> nameOfDll r // Look for an explicit reference to mscorlib/netstandard.dll or System.Runtime.dll and use that to compute clrRoot and targetFrameworkVersion let primaryAssemblyReference, primaryAssemblyExplicitFilenameOpt = computeKnownDllReference(data.primaryAssembly.Name) diff --git a/src/fsharp/FSComp.txt b/src/fsharp/FSComp.txt index 096da0a7cc7..703a8cd3a1e 100644 --- a/src/fsharp/FSComp.txt +++ b/src/fsharp/FSComp.txt @@ -43,7 +43,6 @@ buildProductNameCommunity,"F# Compiler for F# %s" 212,buildInvalidFilename,"'%s' is not a valid filename" 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" 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." diff --git a/src/fsharp/xlf/FSComp.txt.cs.xlf b/src/fsharp/xlf/FSComp.txt.cs.xlf index 996f007de8d..10fa84ce31a 100644 --- a/src/fsharp/xlf/FSComp.txt.cs.xlf +++ b/src/fsharp/xlf/FSComp.txt.cs.xlf @@ -267,11 +267,6 @@ Nerozpoznané nastavení ochrany osobních údajů {0} pro spravovaný prostředek. Platné možnosti jsou public a private. - - Multiple references to '{0}.dll' are not permitted - Víc odkazů na knihovnu {0}.dll se nepovoluje. - - Unable to read assembly '{0}' Sestavení {0} se nedá přečíst. diff --git a/src/fsharp/xlf/FSComp.txt.de.xlf b/src/fsharp/xlf/FSComp.txt.de.xlf index 44db98820d9..2a97ef5d770 100644 --- a/src/fsharp/xlf/FSComp.txt.de.xlf +++ b/src/fsharp/xlf/FSComp.txt.de.xlf @@ -267,11 +267,6 @@ Unbekannte Datenschutzeinstellung "{0}" für verwaltete Ressource; gültige Optionen sind "public" und "private". - - Multiple references to '{0}.dll' are not permitted - Mehrere Verweise auf "{0}.dll" sind nicht zulässig - - Unable to read assembly '{0}' Assembly "{0}" kann nicht gelesen werden. diff --git a/src/fsharp/xlf/FSComp.txt.es.xlf b/src/fsharp/xlf/FSComp.txt.es.xlf index f67f43053ce..0a1069b1ad1 100644 --- a/src/fsharp/xlf/FSComp.txt.es.xlf +++ b/src/fsharp/xlf/FSComp.txt.es.xlf @@ -267,11 +267,6 @@ Configuración de privacidad '{0}' no reconocida para un recurso administrado. Las opciones válidas son 'public' y 'private'. - - Multiple references to '{0}.dll' are not permitted - No se permiten varias referencias a '{0}.dll'. - - Unable to read assembly '{0}' No se puede leer el ensamblado '{0}'. diff --git a/src/fsharp/xlf/FSComp.txt.fr.xlf b/src/fsharp/xlf/FSComp.txt.fr.xlf index e16fb76681e..f19c1db7fde 100644 --- a/src/fsharp/xlf/FSComp.txt.fr.xlf +++ b/src/fsharp/xlf/FSComp.txt.fr.xlf @@ -267,11 +267,6 @@ Paramètre de confidentialité '{0}' non reconnu pour la ressource managée, les options valides sont 'public' et 'private' - - Multiple references to '{0}.dll' are not permitted - Les références multiples à '{0}.dll' ne sont pas autorisées - - Unable to read assembly '{0}' Impossible de lire l'assembly '{0}' diff --git a/src/fsharp/xlf/FSComp.txt.it.xlf b/src/fsharp/xlf/FSComp.txt.it.xlf index 2ef271b33ed..ec424688dcd 100644 --- a/src/fsharp/xlf/FSComp.txt.it.xlf +++ b/src/fsharp/xlf/FSComp.txt.it.xlf @@ -267,11 +267,6 @@ Impostazione di privacy '{0}' non riconosciuta per una risorsa gestita. Le opzioni valide sono 'public' e 'private' - - Multiple references to '{0}.dll' are not permitted - Non sono consentiti più riferimenti a '{0}.dll' - - Unable to read assembly '{0}' Non è possibile leggere l'assembly '{0}' diff --git a/src/fsharp/xlf/FSComp.txt.ja.xlf b/src/fsharp/xlf/FSComp.txt.ja.xlf index d64338297fa..6b78b55eccd 100644 --- a/src/fsharp/xlf/FSComp.txt.ja.xlf +++ b/src/fsharp/xlf/FSComp.txt.ja.xlf @@ -267,11 +267,6 @@ マネージド リソースの認識されないプライバシー設定 '{0}'。有効なオプションは 'public' および 'private' です。 - - Multiple references to '{0}.dll' are not permitted - '{0}.dll' に対する複数の参照は許可されていません - - Unable to read assembly '{0}' アセンブリ '{0}' を読み取れません diff --git a/src/fsharp/xlf/FSComp.txt.ko.xlf b/src/fsharp/xlf/FSComp.txt.ko.xlf index 03880250e9f..c6643da5ec5 100644 --- a/src/fsharp/xlf/FSComp.txt.ko.xlf +++ b/src/fsharp/xlf/FSComp.txt.ko.xlf @@ -267,11 +267,6 @@ 관리되는 리소스에 대해 인식할 수 없는 개인 정보 보호 설정 '{0}'입니다. 올바른 옵션은 'public' 및 'private'입니다. - - Multiple references to '{0}.dll' are not permitted - '{0}.dll'에 대한 다중 참조는 허용되지 않습니다. - - Unable to read assembly '{0}' '{0}' 어셈블리를 읽을 수 없습니다. diff --git a/src/fsharp/xlf/FSComp.txt.pl.xlf b/src/fsharp/xlf/FSComp.txt.pl.xlf index 98461fea0af..8dcbcc291ba 100644 --- a/src/fsharp/xlf/FSComp.txt.pl.xlf +++ b/src/fsharp/xlf/FSComp.txt.pl.xlf @@ -267,11 +267,6 @@ Nierozpoznane ustawienie prywatności „{0}” dla zasobu zarządzanego. Prawidłowe opcje to „public” i „private” - - Multiple references to '{0}.dll' are not permitted - Używanie wielu odwołań do pliku „{0}.dll” jest niedozwolone - - Unable to read assembly '{0}' Nie można odczytać zestawu „{0}” diff --git a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf index bf05ba3e776..717ad3dd6d3 100644 --- a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf +++ b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf @@ -267,11 +267,6 @@ A configuração de privacidade '{0}' não foi reconhecida pelo recurso gerenciado, as opções válidas são 'public' e 'private' - - Multiple references to '{0}.dll' are not permitted - As referências múltiplas '{0}.dll' não são permitidas - - Unable to read assembly '{0}' Não é possível ler o assembly '{0}' diff --git a/src/fsharp/xlf/FSComp.txt.ru.xlf b/src/fsharp/xlf/FSComp.txt.ru.xlf index 16272ba0dc8..e1aa38d3560 100644 --- a/src/fsharp/xlf/FSComp.txt.ru.xlf +++ b/src/fsharp/xlf/FSComp.txt.ru.xlf @@ -267,11 +267,6 @@ Нераспознанный параметр конфиденциальности "{0}" для управляемого ресурса. Допускается использование параметров "public" и "private" - - Multiple references to '{0}.dll' are not permitted - Множественные ссылки на файлы "{0}.dll" не допускаются - - Unable to read assembly '{0}' Не удается прочитать сборку "{0}" diff --git a/src/fsharp/xlf/FSComp.txt.tr.xlf b/src/fsharp/xlf/FSComp.txt.tr.xlf index 85f8ee2f025..ec02c915490 100644 --- a/src/fsharp/xlf/FSComp.txt.tr.xlf +++ b/src/fsharp/xlf/FSComp.txt.tr.xlf @@ -267,11 +267,6 @@ Yönetilen kaynak için tanınmayan gizlilik ayarı '{0}'; geçerli seçenekler: 'public' ve 'private' - - Multiple references to '{0}.dll' are not permitted - Birden çok '{0}.dll' başvurusuna izin verilmiyor - - Unable to read assembly '{0}' '{0}' bütünleştirilmiş kodu okunamıyor diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf index c0dbdcb1876..99448a0a6a0 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf @@ -267,11 +267,6 @@ 无法识别的受管理资源隐私设置“{0}”,有效的选项为 "public" 和 "private" - - Multiple references to '{0}.dll' are not permitted - 不允许多次引用“{0}.dll” - - Unable to read assembly '{0}' 无法读取程序集“{0}” diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf index 90be2ee0817..0eabef76078 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf @@ -267,11 +267,6 @@ 受控資源的無法辨識隱私設定 '{0}',有效的選項是 'public' 和 'private' - - Multiple references to '{0}.dll' are not permitted - 不允許多次參考 '{0}.dll' - - Unable to read assembly '{0}' 無法讀取組件 '{0}'