Skip to content

Conversation

@ViktorHofer
Copy link
Member

It's fairly common for repositories to set a default DebugType and/or DebugSymbols setting in their Directory.Build.props file. As an example, Arcade does that which impacts every repository in the .NET stack. The NoTargets SDK should overwrite these default settings (including the Microsoft.NET.Sdk setting) as the project clearly doesn't produce a symbol. Setting in the props file to allow a project to overwrite the setting if it explicitly wants to do so.

@MeikTranel
Copy link
Contributor

Not that my review matters, but i've noticed this quite a while ago and forgot to pass this on.

@jeffkl
Copy link
Contributor

jeffkl commented May 18, 2022

I'm conflicted on this change. On one hand, this SDK should be a good citizen and not override properties that are already declared. On the other hand, the SDK is known to not emit symbols and so it might as well create a pit of success. If everyone's Directory.Build.props conditioned their logic it would be fine but I don't think anyone knows that NoTargets project should be special...

What's everyone's thoughts?

@ViktorHofer
Copy link
Member Author

If everyone's Directory.Build.props conditioned their logic it would be fine but I don't think anyone knows that NoTargets project should be special...

Right. Neither Arcade nor dotnet/runtime nor any other repository that I know of, thinks about this SDK when writing property conditions.

I'm conflicted on this change. On one hand, this SDK should be a good citizen and not override properties that are already declared.

I understand your concern. This SDK already intentionally overwrites properties, mostly in targets files. As another example, the Traversal SDK overwrites tons of targets that are set by the MSBuild's common logic. I don't think that the NoTargets SDK can continue to exist without overwriting properties / targets set by the Microsoft.NET.Sdk or MSBuild's common files.

I would even go as far as suggest to move these two properties into the SDK's targets file so that props or project level settings are intentionally overwritten.

@jeffkl
Copy link
Contributor

jeffkl commented May 19, 2022

Okay I agree, the feature of emitting symbols for a NoTarget is already disabled in other ways

<DebugSymbolsProjectOutputGroupOutput Remove="@(DebugSymbolsProjectOutputGroupOutput)" />

And there's precedence for setting properties and not letting them be set by the user

<ProduceReferenceAssembly>false</ProduceReferenceAssembly>

I'm going to update your branch to move the properties to Sdk.targets and update the unit tests

ViktorHofer and others added 3 commits May 19, 2022 10:04
It's fairly common for repositories to set a default DebugType and/or DebugSymbols setting in their Directory.Build.props file. As an example, Arcade does that which impacts every repository in the .NET stack. The NoTargets SDK should overwrite these default settings (including the Microsoft.NET.Sdk setting) as the project clearly doesn't produce a symbol. Setting in the props file to allow a project to overwrite the setting if it explicitly wants to do so.
Copy link
Contributor

@jeffkl jeffkl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ViktorHofer!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants