Skip to content

Commit c301020

Browse files
author
Omar Tawfik
committed
Merge pull request #894 from otawfik-ms/copyfsharpcore
Getting FSharp out of GAC, and add --nocopyfsharpcore flag to fsc.exe
2 parents feb99db + 318e679 commit c301020

File tree

18 files changed

+61
-30
lines changed

18 files changed

+61
-30
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,17 @@ src/fsharp/FSharp.LanguageService.Compiler/pplex.fs
7373
src/fsharp/FSharp.LanguageService.Compiler/pppars.fs
7474
src/fsharp/FSharp.LanguageService.Compiler/pppars.fsi
7575
vsintegration/src/unittests/Unittests.fsi
76+
tests/*FSharp_Failures.env
77+
tests/*FSharp_Failures.lst
7678
tests/fsharpqa/Source/CodeGen/EmittedIL/StaticInit/StaticInit_Module01.dll
7779
tests/fsharpqa/Source/CodeGen/EmittedIL/StaticInit/StaticInit_Module01.pdb
7880
tests/XFSharpQA_Failures.log.*
7981
vsintegration/src/vs/FsPkgs/FSharp.Project/FS/FSharp.ProjectSystem.FSharp.fsi
8082
vsintegration/src/vs/FsPkgs/FSharp.Project/FS/ctofiles/
8183
tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Utils.dll
8284
tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExprLibrary.dll
85+
tests/fsharpqa/Source/*FSharpQA_Failures.env
86+
tests/fsharpqa/Source/*FSharpQA_Failures.lst
8387
*.csproj.user
8488
*.sln.DotSettings.user
8589
*.ide

DEVGUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Restart Visual Studio, it should now be running your freshly-built Visual F# IDE
131131

132132
### Notes on the build
133133

134-
1. The `update.cmd` script adds the built `FSharp.Core` to the GAC, adds required strong name validation skips, and NGens the compiler and libraries. This requires admin privileges.
134+
1. The `update.cmd` script adds required strong name validation skips, and NGens the compiler and libraries. This requires admin privileges.
135135
1. The compiler binaries produced are "private" and strong-named signed with a test key.
136136
1. Some additional tools are required to build the compiler, notably `fslex.exe`, `fsyacc.exe`, `FSharp.PowerPack.Build.Tasks.dll`, `FsSrGen.exe`, `FSharp.SRGen.Build.Tasks.dll`, and the other tools found in the `lkg` directory.
137137
1. The overall bootstrapping process executes as follows

TESTGUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ In order to run all of the tests, you will need to install
2323

2424
* [Perl](http://www.perl.org/get.html) (ActiveState Perl 5.16.3 is known to work fine)
2525

26-
Perl must be included in the `%PATH%` for the below steps to work. It is also recommended that you run tests from an elevated command prompt, as there are a couple of test cases which modify the GAC, and this requires administrative privileges.
26+
Perl must be included in the `%PATH%` for the below steps to work. It is also recommended that you run tests from an elevated command prompt, as there are a couple of test cases which require administrative privileges.
2727

2828
Before running tests, make sure you have successfully built all required projects as specified in the 'Prepare For Tests' section of the [DEVGUIDE](DEVGUIDE.md).
2929

src/assemblyinfo/assemblyinfo.FSharp.Core.dll.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ open System.Runtime.InteropServices
1515

1616
#if PORTABLE
1717
[<assembly:AssemblyProduct("Microsoft\174 F#")>]
18-
[<assembly:AssemblyFlags(System.Reflection.AssemblyNameFlags.Retargetable)>] // ensure we replace any 4.0.30319.* or 4.0.31105.* versions in the GAC. These are the FileVersions for RTM VS2010 and SP1 VS2010
18+
[<assembly:AssemblyFlags(System.Reflection.AssemblyNameFlags.Retargetable)>]
1919
#endif
2020

2121
do()

src/assemblyinfo/assemblyinfo.FSharp.Data.TypeProviders.dll.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ do()
1717
[<assembly:System.Runtime.CompilerServices.InternalsVisibleTo("Unittests")>]
1818
[<assembly:System.Runtime.CompilerServices.InternalsVisibleTo("SystematicUnitTests")>]
1919
#else
20-
[<assembly:AssemblyFileVersion("4.0.40401.666")>] // ensure we replace any 4.0.30319.* or 4.0.31105.* versions in the GAC. These are the FileVersions for RTM VS2010 and SP1 VS2010
20+
[<assembly:AssemblyFileVersion("4.0.40401.9055")>]
2121
[<assembly:System.Runtime.CompilerServices.InternalsVisibleTo("Unittests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293")>]
2222
[<assembly:System.Runtime.CompilerServices.InternalsVisibleTo("SystematicUnitTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293")>]
2323
#endif

src/fsharp/CompileOps.fs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2033,6 +2033,10 @@ type TcConfigBuilder =
20332033
mutable emitDebugInfoInQuotations : bool
20342034

20352035
mutable exename : string option
2036+
2037+
// If true - the compiler will copy FSharp.Core.dll along the produced binaries
2038+
mutable copyFSharpCore : bool
2039+
20362040
/// When false FSI will lock referenced assemblies requiring process restart, false = disable Shadow Copy false (*default*)
20372041
mutable shadowCopyReferences : bool
20382042
}
@@ -2172,6 +2176,7 @@ type TcConfigBuilder =
21722176
sqmSessionStartedTime = System.DateTime.Now.Ticks
21732177
emitDebugInfoInQuotations = false
21742178
exename = None
2179+
copyFSharpCore = true
21752180
shadowCopyReferences = false
21762181
}
21772182

@@ -2638,6 +2643,7 @@ type TcConfig private (data : TcConfigBuilder,validate:bool) =
26382643
member x.sqmSessionGuid = data.sqmSessionGuid
26392644
member x.sqmNumOfSourceFiles = data.sqmNumOfSourceFiles
26402645
member x.sqmSessionStartedTime = data.sqmSessionStartedTime
2646+
member x.copyFSharpCore = data.copyFSharpCore
26412647
member x.shadowCopyReferences = data.shadowCopyReferences
26422648

26432649
static member Create(builder,validate) =

src/fsharp/CompileOps.fsi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ type TcConfigBuilder =
351351
sqmSessionStartedTime : int64
352352
mutable emitDebugInfoInQuotations : bool
353353
mutable exename : string option
354+
mutable copyFSharpCore : bool
354355
mutable shadowCopyReferences : bool }
355356

356357

@@ -508,6 +509,7 @@ type TcConfig =
508509
member sqmSessionGuid : System.Guid option
509510
member sqmNumOfSourceFiles : int
510511
member sqmSessionStartedTime : int64
512+
member copyFSharpCore : bool
511513
member shadowCopyReferences : bool
512514
513515
static member Create : TcConfigBuilder * validate: bool -> TcConfig

src/fsharp/CompileOptions.fs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ let PrintOptionInfo (tcConfigB:TcConfigBuilder) =
513513
printfn " debuginfo . . . . . . : %+A" tcConfigB.debuginfo
514514
printfn " resolutionEnvironment : %+A" tcConfigB.resolutionEnvironment
515515
printfn " product . . . . . . . : %+A" tcConfigB.productNameForBannerText
516+
printfn " copyFSharpCore . . . . : %+A" tcConfigB.copyFSharpCore
516517
tcConfigB.includes |> List.sort
517518
|> List.iter (printfn " include . . . . . . . : %A")
518519

@@ -611,6 +612,8 @@ let outputFileFlagsFsc (tcConfigB : TcConfigBuilder) =
611612

612613
CompilerOption("sig", tagFile, OptionString (setSignatureFile tcConfigB), None,
613614
Some (FSComp.SR.optsSig()));
615+
616+
CompilerOption("nocopyfsharpcore", tagNone, OptionUnit (fun () -> tcConfigB.copyFSharpCore <- false), None, Some (FSComp.SR.optsNoCopyFsharpCore()));
614617
]
615618

616619

src/fsharp/FSComp.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,7 @@ optsUseHighEntropyVA,"Enable high-entropy ASLR"
877877
optsSubSystemVersion,"Specify subsystem version of this assembly"
878878
optsTargetProfile,"Specify target framework profile of this assembly. Valid values are mscorlib or netcore. Default - mscorlib"
879879
optsEmitDebugInfoInQuotations,"Emit debug information in quotations"
880+
optsNoCopyFsharpCore,"Don't copy FSharp.Core.dll along the produced binaries"
880881
1051,optsInvalidSubSystemVersion,"Invalid version '%s' for '--subsystemversion'. The version must be 4.00 or greater."
881882
1052,optsInvalidTargetProfile,"Invalid value '%s' for '--targetprofile', valid values are 'mscorlib' or 'netcore'."
882883
typeInfoFullName,"Full name"
@@ -1269,3 +1270,4 @@ estApplyStaticArgumentsForMethodNotImplemented,"A type provider implemented GetS
12691270
3193,optsInvalidResponseFile,"Invalid response file '%s' ( '%s' )"
12701271
3194,optsResponseFileNotFound,"Response file '%s' not found in '%s'"
12711272
3195,optsResponseFileNameInvalid,"Response file name '%s' is empty, contains invalid characters, has a drive specification without an absolute path, or is too long"
1273+
3196,fsharpCoreNotFoundToBeCopied,"Cannot find FSharp.Core.dll in compiler's directory"

src/fsharp/ReferenceResolution.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,8 @@ module internal MSBuildResolver =
277277
// These are search paths for runtime-like or scripting resolution. GAC searching is present.
278278
yield! rawFileNamePath // Quick-resolve straight to filename first
279279
yield! explicitIncludeDirs // From -I, #I
280-
yield implicitIncludeDir // Usually the project directory
281280
yield fsharpCoreExplicitDirOrFSharpBinariesDir // Location of explicit reference to FSharp.Core, otherwise location of fsc.exe
281+
yield implicitIncludeDir // Usually the project directory
282282
yield "{TargetFrameworkDirectory}"
283283
yield registry
284284
yield "{AssemblyFolders}"
@@ -290,8 +290,8 @@ module internal MSBuildResolver =
290290
yield "{TargetFrameworkDirectory}"
291291
yield! rawFileNamePath // Quick-resolve straight to filename first
292292
yield! explicitIncludeDirs // From -I, #I
293-
yield implicitIncludeDir // Usually the project directory
294293
yield fsharpCoreExplicitDirOrFSharpBinariesDir // Location of explicit reference to FSharp.Core, otherwise location of fsc.exe
294+
yield implicitIncludeDir // Usually the project directory
295295
yield registry
296296
yield "{AssemblyFolders}"
297297
yield outputDirectory

0 commit comments

Comments
 (0)