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

Is there a way to mute NU1603? #5913

Closed
forki opened this Issue Sep 21, 2017 · 17 comments

Comments

Projects
None yet
5 participants
@forki

forki commented Sep 21, 2017

On Windows (I haven't tested this on macOS or Linux)

  1. Install .NET Core 2.0.2

  2. Clone fable-suave-scaffold

  3. Instal Node LTS and Yarn latest

  4. Run build.cmd

Expected behaviour

No NU1603 since paket controls the dependencies

Actual behaviour

image

@emgarten

This comment has been minimized.

Show comment
Hide comment
Collaborator

emgarten commented Sep 21, 2017

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Sep 21, 2017

is that something we can set in nuget.config? Or ar least when we add PackageReferences in memory?

forki commented Sep 21, 2017

is that something we can set in nuget.config? Or ar least when we add PackageReferences in memory?

@emgarten

This comment has been minimized.

Show comment
Hide comment
@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Sep 21, 2017

ok but setting it in Paket.Restore.targets should work as well, right?

forki commented Sep 21, 2017

ok but setting it in Paket.Restore.targets should work as well, right?

@emgarten

This comment has been minimized.

Show comment
Hide comment
@emgarten

emgarten Sep 21, 2017

Collaborator

Should work if you can set it before it is read. Let me know if it doesn't and we can find a different way.

Collaborator

emgarten commented Sep 21, 2017

Should work if you can set it before it is read. Let me know if it doesn't and we can find a different way.

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Sep 21, 2017

image

urgs. now other tools (in this case F# compiler) complain about that

/cc @dsyme @KevinRansom @cartermp

forki commented Sep 21, 2017

image

urgs. now other tools (in this case F# compiler) complain about that

/cc @dsyme @KevinRansom @cartermp

forki added a commit to fsprojects/Paket that referenced this issue Sep 21, 2017

@emgarten

This comment has been minimized.

Show comment
Hide comment
@emgarten

emgarten Sep 21, 2017

Collaborator

Gah! Seems like we should test these on all project types going forward.

The design for this was to use the exact same fields as the compiler so that users could add these through the project properties window.

Collaborator

emgarten commented Sep 21, 2017

Gah! Seems like we should test these on all project types going forward.

The design for this was to use the exact same fields as the compiler so that users could add these through the project properties window.

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Sep 21, 2017

ok reverting that for now. We need another solution. If people are using warnaserror in F# then things will crash.

forki commented Sep 21, 2017

ok reverting that for now. We need another solution. If people are using warnaserror in F# then things will crash.

forki added a commit to fsprojects/Paket that referenced this issue Sep 21, 2017

@emgarten

This comment has been minimized.

Show comment
Hide comment
@emgarten

emgarten Sep 21, 2017

Collaborator

Alternatively you could set HideWarningsAndErrors to true and then replay them after restore from project.assets.json with filtering. It would be much more work than just setting nowarn however.

Collaborator

emgarten commented Sep 21, 2017

Alternatively you could set HideWarningsAndErrors to true and then replay them after restore from project.assets.json with filtering. It would be much more work than just setting nowarn however.

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki commented Sep 21, 2017

O_o

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Sep 21, 2017

sorry, what I meant is: NuGet's current approach is not working with F# and that has nothing to do with paket. If you set the NoWarn in the project then the compiler will scream at you.

forki commented Sep 21, 2017

sorry, what I meant is: NuGet's current approach is not working with F# and that has nothing to do with paket. If you set the NoWarn in the project then the compiler will scream at you.

@mishra14

This comment has been minimized.

Show comment
Hide comment
@mishra14

mishra14 Sep 22, 2017

Collaborator

Closing this issue in the favor of Microsoft/visualfsharp#3626.

Please feel free to reopen this if you feel otherwise.

Collaborator

mishra14 commented Sep 22, 2017

Closing this issue in the favor of Microsoft/visualfsharp#3626.

Please feel free to reopen this if you feel otherwise.

@mishra14 mishra14 closed this Sep 22, 2017

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Sep 22, 2017

forki commented Sep 22, 2017

@rrelyea

This comment has been minimized.

Show comment
Hide comment
@rrelyea

rrelyea Sep 22, 2017

Contributor

@forki - Hear ya. We should have communicated with more compilers than we did during 15.3. Sorry that we didn't.

Contributor

rrelyea commented Sep 22, 2017

@forki - Hear ya. We should have communicated with more compilers than we did during 15.3. Sorry that we didn't.

@KevinRansom

This comment has been minimized.

Show comment
Hide comment
@KevinRansom

KevinRansom Sep 22, 2017

@rrelyea
I believe this design makes use of a bug in the C# compiler. It ignores anything it doesn't understand ... and it only understands numeric values. I doubt if the bug will ever get fixed though.

You should consider changing the name of the msbuild property from NoWarn to NugetNoWarn or NoWarnNuget.

Kevin

The C# bug:

namespace ConsoleApp10 {
    class Program {
        static void Main(string[] args) {
            int x = 7;
        }
    }
}

csc Program.cs

Microsoft (R) Visual C# Compiler version 2.3.2.62019 (b7354608)
Copyright (C) Microsoft Corporation. All rights reserved.

Program.cs(13,17): warning CS0219: The variable 'x' is assigned but its value is never used

csc Program.cs /nowarn:0219

Microsoft (R) Visual C# Compiler version 2.3.2.62019 (b7354608)
Copyright (C) Microsoft Corporation. All rights reserved.

now this:
csc Program.cs /nowarn:cs0219

Microsoft (R) Visual C# Compiler version 2.3.2.62019 (b7354608)
Copyright (C) Microsoft Corporation. All rights reserved.

Program.cs(13,17): warning CS0219: The variable 'x' is assigned but its value is never used

C# ignores any non numeric value including cs0219. It is a C# bug, and it is very likely it won't get fixed.

KevinRansom commented Sep 22, 2017

@rrelyea
I believe this design makes use of a bug in the C# compiler. It ignores anything it doesn't understand ... and it only understands numeric values. I doubt if the bug will ever get fixed though.

You should consider changing the name of the msbuild property from NoWarn to NugetNoWarn or NoWarnNuget.

Kevin

The C# bug:

namespace ConsoleApp10 {
    class Program {
        static void Main(string[] args) {
            int x = 7;
        }
    }
}

csc Program.cs

Microsoft (R) Visual C# Compiler version 2.3.2.62019 (b7354608)
Copyright (C) Microsoft Corporation. All rights reserved.

Program.cs(13,17): warning CS0219: The variable 'x' is assigned but its value is never used

csc Program.cs /nowarn:0219

Microsoft (R) Visual C# Compiler version 2.3.2.62019 (b7354608)
Copyright (C) Microsoft Corporation. All rights reserved.

now this:
csc Program.cs /nowarn:cs0219

Microsoft (R) Visual C# Compiler version 2.3.2.62019 (b7354608)
Copyright (C) Microsoft Corporation. All rights reserved.

Program.cs(13,17): warning CS0219: The variable 'x' is assigned but its value is never used

C# ignores any non numeric value including cs0219. It is a C# bug, and it is very likely it won't get fixed.

@mishra14

This comment has been minimized.

Show comment
Hide comment
@mishra14

mishra14 Sep 22, 2017

Collaborator

@KevinRansom Thanks for the detailed response.

I have one correction - /nowarn:CS0219 works as expected -

F:\validation\test\addpkg>csc Program.cs  /nowarn:CS0219
Microsoft (R) Visual C# Compiler version 2.4.0.62025 (a0507c1e)
Copyright (C) Microsoft Corporation. All rights reserved.


F:\validation\test\addpkg>csc Program.cs  /nowarn:cs0219
Microsoft (R) Visual C# Compiler version 2.4.0.62025 (a0507c1e)
Copyright (C) Microsoft Corporation. All rights reserved.

Program.cs(9,17): warning CS0219: The variable 'x' is assigned but its value is never used

F:\validation\test\addpkg>

Note that it is case sensitive, so cs0219 is not the same as CS0219.

Collaborator

mishra14 commented Sep 22, 2017

@KevinRansom Thanks for the detailed response.

I have one correction - /nowarn:CS0219 works as expected -

F:\validation\test\addpkg>csc Program.cs  /nowarn:CS0219
Microsoft (R) Visual C# Compiler version 2.4.0.62025 (a0507c1e)
Copyright (C) Microsoft Corporation. All rights reserved.


F:\validation\test\addpkg>csc Program.cs  /nowarn:cs0219
Microsoft (R) Visual C# Compiler version 2.4.0.62025 (a0507c1e)
Copyright (C) Microsoft Corporation. All rights reserved.

Program.cs(9,17): warning CS0219: The variable 'x' is assigned but its value is never used

F:\validation\test\addpkg>

Note that it is case sensitive, so cs0219 is not the same as CS0219.

@KevinRansom

This comment has been minimized.

Show comment
Hide comment
@KevinRansom

KevinRansom Sep 23, 2017

KevinRansom commented Sep 23, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment