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

Nuget warnings in fsi are emitted to stdout and cannot be suppressed with --quiet #18086

Open
legezam opened this issue Nov 29, 2024 · 2 comments
Labels
Area-FSI Bug help wanted Impact-Low (Internal MS Team use only) Describes an issue with limited impact on existing code.
Milestone

Comments

@legezam
Copy link

legezam commented Nov 29, 2024

in F# interactive, Nuget warnings are not suppressed when using --quiet flag.

Repro steps

using this fsx script:

#r "nuget:Dmx.Amyris.Bio"


let [| |] = [||]
  1. dotnet fsi --quiet foo.fsx
  2. observe that nuget warnings are emitted to stdout instead of stderr, regardless whether you add --quiet flag or not:
/home/legezam/.packagemanagement/nuget/Projects/110555--97ce5992-5bc5-4645-82e6-4431e11b5756/Project.fsproj : warning NU1608: Detected package version outside of dependency constraint: Dmx.Amyris.Bio 2.0.32 requires FSharp.Core (>= 6.0.0 && < 7.0.0) but version FSharp.Core 8.0.300 was resolved.
/home/legezam/.packagemanagement/nuget/Projects/110555--97ce5992-5bc5-4645-82e6-4431e11b5756/Project.fsproj : warning NU1608: Detected package version outside of dependency constraint: Dmx.Amyris.Bio 2.0.32 requires FSharp.Core (>= 6.0.0 && < 7.0.0) but version FSharp.Core 8.0.300 was resolved.

This makes it impossible to create a unix like command that prints its results to stdout because fsi puts garbage to stdout.

Expected behavior

  1. maybe the nuget warnings should go to stderr by default
  2. even if they don't, --quiet should make them go away as per the promises in fsi help

Actual behavior

F# compiler warnings are not emitted correctly, nuget warnings go to stdout.

Known workarounds

Found no workarounds.

Related information

This happens on Ubuntu linux for me but i suppose the issue is general.

Thanks!

@T-Gro
Copy link
Member

T-Gro commented Dec 2, 2024

F# should translate the --quiet flag into equivalent information for project created on the background, to make it silence nuget warnings as well (which are not coming from F# processing).

I assume /verbosity:quiet could work here, instead of NoWarn different NU**** codes.

@T-Gro T-Gro added the Area-FSI label Dec 2, 2024
@baronfel
Copy link
Member

baronfel commented Dec 2, 2024

Even with a quiet verbosity you will still see the warnings - silent mode is only truly silent on success cases. I don't think it's reasonable to try and denylist specific nowarns either.

@0101 0101 added Impact-Low (Internal MS Team use only) Describes an issue with limited impact on existing code. help wanted and removed Needs-Triage labels Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-FSI Bug help wanted Impact-Low (Internal MS Team use only) Describes an issue with limited impact on existing code.
Projects
Status: New
Development

No branches or pull requests

4 participants