Skip to content
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

Fsc deletes the output directory #12140

Closed
queil opened this issue Sep 11, 2021 · 0 comments · Fixed by #12381
Closed

Fsc deletes the output directory #12140

queil opened this issue Sep 11, 2021 · 0 comments · Fixed by #12381
Labels
Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code.

Comments

@queil
Copy link

queil commented Sep 11, 2021

fsc deletes the output directory when the --out flag is set to a rooted path and the compiled script contains NuGet references.

Repro steps

Provide the steps required to reproduce the problem:

  1. The following Dockerfile reproduces the problem:
FROM mcr.microsoft.com/dotnet/sdk:6.0.100-preview.7-alpine3.13

WORKDIR /repro

RUN echo "#r \"nuget: FSharp.Data, 4.2.2\"" > ./script.fsx && \
    dotnet /usr/share/dotnet/sdk/6.0.100-preview.7.21379.14/FSharp/fsc.dll \
    -a script.fsx \
    --targetprofile:netcore \
    --target:library \
    -r:/root/.nuget/packages/fsharp.data/4.2.2/lib/netstandard2.0/FSharp.Data.dll \
    --out:/repro/work/my-dll.dll

# the below fails
RUN ls /repro/work/my-dll.dll

Expected behavior

The work directory should not get deleted and my-dll.dll should be there.

Actual behavior

The work directory gets deleted and the compilation output is lost.

Known workarounds

Do not use rooted paths as the --out flag values.

Related information

Provide any related information (optional):

  • Operating system: Linux (Ubuntu and Alpine)
  • .NET Runtime kind (.NET Core, .NET Framework, Mono): 6.0.100-preview.7.21379.14
  • Editing Tools (e.g. Visual Studio Version, Visual Studio): N/A
@KevinRansom KevinRansom added the Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code. label Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants