-
Notifications
You must be signed in to change notification settings - Fork 830
Getting FSharp out of GAC, and add --nocopyfsharpcore flag to fsc.exe #894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
20fecbc
91a5323
29f1952
b584ee7
cf47f70
0148c07
2f3d3f7
55f9833
62723aa
fcc5950
e73ad5a
318e679
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1781,7 +1781,27 @@ let ValidateKeySigningAttributes (tcConfig : TcConfig, tcGlobals, topAttrs) = | |
| | None -> tcConfig.container | ||
|
|
||
| SigningInfo (delaysign,signer,container) | ||
|
|
||
|
|
||
| // If the --nocopyfsharpcore switch is not specified, this will: | ||
| // 1) Look into the referenced assemblies, if FSharp.Core.dll is specified, it will copy it to output directory. | ||
| // 2) If not, but FSharp.Core.dll exists beside the compiler binaries, it will copy it to output directory. | ||
| // 3) If not, it will produce an error. | ||
| let copyFSharpCore(outFile: string, referencedDlls: AssemblyReference list) = | ||
| let outDir = Path.GetDirectoryName(outFile) | ||
| let fsharpCoreAssemblyName = GetFSharpCoreLibraryName() + ".dll" | ||
| let fsharpCoreDestinationPath = Path.Combine(outDir, fsharpCoreAssemblyName) | ||
|
|
||
| if not (File.Exists(fsharpCoreDestinationPath)) then | ||
| match referencedDlls |> Seq.tryFind (fun dll -> String.Equals(Path.GetFileName(dll.Text), fsharpCoreAssemblyName, StringComparison.CurrentCultureIgnoreCase)) with | ||
| | Some referencedFsharpCoreDll -> File.Copy(referencedFsharpCoreDll.Text, fsharpCoreDestinationPath) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MSBuild has a an option to enable or disable file copying for referenced dll's. Should we add --nocopyfsharpcore to the shipping project templates, to allow the ide options to work?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Per investigation, msbuild will take care of that (copying FSharp.Core.dll out of GAC) if the user specified CopyLocal=True in his project file. |
||
| | None -> | ||
| let compilerLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) | ||
| let compilerFsharpCoreDllPath = Path.Combine(compilerLocation, fsharpCoreAssemblyName) | ||
| if File.Exists(compilerFsharpCoreDllPath) then | ||
| File.Copy(compilerFsharpCoreDllPath, fsharpCoreDestinationPath) | ||
| else | ||
| errorR(Error(FSComp.SR.fsharpCoreNotFoundToBeCopied(), rangeCmdArgs)) | ||
|
|
||
| //---------------------------------------------------------------------------- | ||
| // main - split up to make sure that we can GC the | ||
| // dead data at the end of each phase. We explicitly communicate arguments | ||
|
|
@@ -2001,10 +2021,14 @@ let main4 (Args (tcConfig, errorLogger: ErrorLogger, ilGlobals, ilxMainModule, o | |
| FileWriter.EmitIL (tcConfig, ilGlobals, errorLogger, outfile, pdbfile, ilxMainModule, signingInfo, exiter) | ||
|
|
||
| AbortOnError(errorLogger, tcConfig, exiter) | ||
|
|
||
| if tcConfig.showLoadedAssemblies then | ||
| for a in System.AppDomain.CurrentDomain.GetAssemblies() do | ||
| dprintfn "%s" a.FullName | ||
|
|
||
| if tcConfig.copyFSharpCore then | ||
| copyFSharpCore(outfile, tcConfig.referencedDLLs) | ||
|
|
||
| SqmLoggerWithConfig tcConfig errorLogger.ErrorNumbers errorLogger.WarningNumbers | ||
|
|
||
| ReportTime tcConfig "Exiting" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use Path.Combine to concatenate file path bits in product code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not a path. This function just has the string "FSharp.Core". Path.Combine() is used in line 1792