From 75392d3c14e1206f6443e54787ef813341d46c40 Mon Sep 17 00:00:00 2001 From: ncave Date: Mon, 22 Aug 2016 08:40:27 -0700 Subject: [PATCH 1/3] Fixed binary reader error message --- src/fsharp/CompileOps.fs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs index 99966e12aaf..ddc732074c4 100644 --- a/src/fsharp/CompileOps.fs +++ b/src/fsharp/CompileOps.fs @@ -2565,8 +2565,8 @@ type TcConfig private (data : TcConfigBuilder,validate:bool) = clrRoot, (int v1, sprintf "v%d.%d" v1 v2), (v1=5us && v2=0us && v3=5us) // SL5 mscorlib is 5.0.5.0 | _ -> failwith (FSComp.SR.buildCouldNotReadVersionInfoFromMscorlib()) - with _ -> - error(Error(FSComp.SR.buildCannotReadAssembly(filename),rangeStartup)) + with e -> + error(Error(FSComp.SR.buildErrorOpeningBinaryFile(filename, e.Message), rangeStartup)) | _ -> #if !ENABLE_MONO_SUPPORT // TODO: we have to get msbuild out of this @@ -2626,8 +2626,8 @@ type TcConfig private (data : TcConfigBuilder,validate:bool) = checkFSharpBinaryCompatWithMscorlib filename ilReader.ILAssemblyRefs ilReader.ILModuleDef.ManifestOfAssembly.Version rangeStartup; let fslibRoot = Path.GetDirectoryName(FileSystem.GetFullPathShim(filename)) fslibRoot (* , sprintf "v%d.%d" v1 v2 *) - with _ -> - error(Error(FSComp.SR.buildCannotReadAssembly(filename),rangeStartup)) + with e -> + error(Error(FSComp.SR.buildErrorOpeningBinaryFile(filename, e.Message), rangeStartup)) | _ -> data.defaultFSharpBinariesDir From 1aff9d4b175e59e2af1c4418d421f6b5dd4356ea Mon Sep 17 00:00:00 2001 From: ncave Date: Wed, 24 Aug 2016 04:07:52 -0700 Subject: [PATCH 2/3] Fixed tests --- src/fsharp/CompileOps.fs | 4 ++-- tests/fsharpqa/Source/MultiTargeting/E_BadPathToFSharpCore.fs | 2 +- .../fsharpqa/Source/MultiTargeting/E_BadPathToFSharpCore.fsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs index ddc732074c4..84feed2185f 100644 --- a/src/fsharp/CompileOps.fs +++ b/src/fsharp/CompileOps.fs @@ -2565,7 +2565,7 @@ type TcConfig private (data : TcConfigBuilder,validate:bool) = clrRoot, (int v1, sprintf "v%d.%d" v1 v2), (v1=5us && v2=0us && v3=5us) // SL5 mscorlib is 5.0.5.0 | _ -> failwith (FSComp.SR.buildCouldNotReadVersionInfoFromMscorlib()) - with e -> + with e -> error(Error(FSComp.SR.buildErrorOpeningBinaryFile(filename, e.Message), rangeStartup)) | _ -> #if !ENABLE_MONO_SUPPORT @@ -2626,7 +2626,7 @@ type TcConfig private (data : TcConfigBuilder,validate:bool) = checkFSharpBinaryCompatWithMscorlib filename ilReader.ILAssemblyRefs ilReader.ILModuleDef.ManifestOfAssembly.Version rangeStartup; let fslibRoot = Path.GetDirectoryName(FileSystem.GetFullPathShim(filename)) fslibRoot (* , sprintf "v%d.%d" v1 v2 *) - with e -> + with e -> error(Error(FSComp.SR.buildErrorOpeningBinaryFile(filename, e.Message), rangeStartup)) | _ -> data.defaultFSharpBinariesDir diff --git a/tests/fsharpqa/Source/MultiTargeting/E_BadPathToFSharpCore.fs b/tests/fsharpqa/Source/MultiTargeting/E_BadPathToFSharpCore.fs index f9bc3fe2231..a11a5cea146 100644 --- a/tests/fsharpqa/Source/MultiTargeting/E_BadPathToFSharpCore.fs +++ b/tests/fsharpqa/Source/MultiTargeting/E_BadPathToFSharpCore.fs @@ -1,6 +1,6 @@ // #Regression #Multitargeting #NoMono #NETFX40Only // Regression test for FSHARP1.0:6026 // Just a dummy file... -//Unable to read assembly '.+I_DO_NOT_EXIST\\FSharp\.Core\.dll'$ +//Error opening binary file '.+I_DO_NOT_EXIST\\FSharp\.Core\.dll' exit 0 diff --git a/tests/fsharpqa/Source/MultiTargeting/E_BadPathToFSharpCore.fsx b/tests/fsharpqa/Source/MultiTargeting/E_BadPathToFSharpCore.fsx index f9bc3fe2231..a11a5cea146 100644 --- a/tests/fsharpqa/Source/MultiTargeting/E_BadPathToFSharpCore.fsx +++ b/tests/fsharpqa/Source/MultiTargeting/E_BadPathToFSharpCore.fsx @@ -1,6 +1,6 @@ // #Regression #Multitargeting #NoMono #NETFX40Only // Regression test for FSHARP1.0:6026 // Just a dummy file... -//Unable to read assembly '.+I_DO_NOT_EXIST\\FSharp\.Core\.dll'$ +//Error opening binary file '.+I_DO_NOT_EXIST\\FSharp\.Core\.dll' exit 0 From d1f6fb6a218fa6c4de0c9ed0e14d99d6c01a4398 Mon Sep 17 00:00:00 2001 From: ncave Date: Wed, 24 Aug 2016 07:44:59 -0700 Subject: [PATCH 3/3] No-op --- src/fsharp/CompileOps.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs index 84feed2185f..f5a0276b3ce 100644 --- a/src/fsharp/CompileOps.fs +++ b/src/fsharp/CompileOps.fs @@ -2565,7 +2565,7 @@ type TcConfig private (data : TcConfigBuilder,validate:bool) = clrRoot, (int v1, sprintf "v%d.%d" v1 v2), (v1=5us && v2=0us && v3=5us) // SL5 mscorlib is 5.0.5.0 | _ -> failwith (FSComp.SR.buildCouldNotReadVersionInfoFromMscorlib()) - with e -> + with e -> error(Error(FSComp.SR.buildErrorOpeningBinaryFile(filename, e.Message), rangeStartup)) | _ -> #if !ENABLE_MONO_SUPPORT