dotnet / dotnet/fsharp

dotnet scripting / fsc compilation of .fsx scripts should package all the runtime dependencies along the compiled .exe

Open
#13,341 16 comments 2 reactions 0 assignees View on GitHub
Area-FSI Feature Request
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

`fsc` support for compiling .fsx files could be improved by packaging all the runtime dependencies in the output folder, next to the compiled .exe.

**Describe the solution you'd like**

I'd like this to be the default behaviour, but since it would be a change of behaviour, maybe it would require a flag (`--copy-runtime-dependencies-to-output-folder` ?)

It should take care of those constructs:

* DependencyManager that are pulled through `#r "extension: "` mechanism
* vanilla `#r "Assembly"` directives
* #load "otherscript.fsx"
* more generally, all the HashDirective constructs that F# supports in scripts

**Describe alternatives you've considered**

Alternative is to make a new compiler out of FCS, that would do that, but it seems more cohesive to expand the support for compiling .fsx that is already implemented in `fsc`

**Additional context**

Related to https://github.com/dotnet/fsharp/issues/13236#issuecomment-1162153774
Related to https://github.com/dotnet/interactive

cc: @KevinRansom @jonsequitur

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.