Skip to content

Conversation

@Forgind
Copy link
Contributor

@Forgind Forgind commented Jun 4, 2024

Fixes #41364

DebugSymbols=false is a parameter that ultimately gets passed to the compiler, disabling pdb generation. There's also DebugType, which, when set to None, is supposed to disable generating pdbs. When DebugSymbols is set but not DebugType, the SDK sees DebugType as not set and sets it to portable, leading to pdb generation even though DebugSymbols was set to false. This is unexpected, so this makes DebugType automatically None when DebugSymbols was false.

Otherwise we could end up passing contradictory parameters to the compiler.
@ghost ghost added Area-NetSDK untriaged Request triage from a team member labels Jun 4, 2024
</PropertyGroup>

<PropertyGroup>
<DebugType Condition="'$(DebugSymbols)' == 'false'">None</DebugType>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was undecided as to what I should do if DebugType already has a value. Open to suggestions.

Copy link
Member

Choose a reason for hiding this comment

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

I think DebugSymbols should take precedence. Honestly its very opinionated but the philosophy of the property / the whole point it exists is to disable the pdbs, so if it doesn't work when the other property is set it feels not so useful.

Furthermore, DebugSymbols has been around longer than DebugType. DebugSymbols is at least 8 years old.
MicrosoftDocs/visualstudio-docs@381d67e

Copy link
Member

@nagilson nagilson left a comment

Choose a reason for hiding this comment

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

The change looks good, but it would be nice to have a test to show this behavior and prevent regression.

This is also technically a breaking change, so we should be careful about that. Added the breaking-change doc label.

</PropertyGroup>

<PropertyGroup>
<DebugType Condition="'$(DebugSymbols)' == 'false'">None</DebugType>
Copy link
Member

Choose a reason for hiding this comment

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

I think DebugSymbols should take precedence. Honestly its very opinionated but the philosophy of the property / the whole point it exists is to disable the pdbs, so if it doesn't work when the other property is set it feels not so useful.

Furthermore, DebugSymbols has been around longer than DebugType. DebugSymbols is at least 8 years old.
MicrosoftDocs/visualstudio-docs@381d67e

@nagilson nagilson added breaking-change Using this label will notify dotnet/compat and trigger a request to file a compat bug Review for breaking changes needs-breaking-change-doc-created labels Jun 10, 2024
@dotnet-policy-service
Copy link
Contributor

Added needs-breaking-change-doc-created label because this PR has the breaking-change label.

When you commit this breaking change:

  1. Create and link to this PR and the issue a matching issue in the dotnet/docs repo using the breaking change documentation template, then remove this needs-breaking-change-doc-created label.
  2. Ask a committer to mail the .NET Breaking Change Notification DL.

Tagging @dotnet/compat for awareness of the breaking change.

@Forgind
Copy link
Contributor Author

Forgind commented Jun 10, 2024

This is also technically a breaking change

It's a user-visible change in behavior, but I believe this is going back to how things were before .NET 8, so I believe it's a fix for a regression rather than a new breaking change. I didn't actually check that, though; I'm just going off of what the bug says.

@nagilson
Copy link
Member

That's true, but it's certainly possible someone started relying on this behavior in .NET 8, setup an automated pipeline, and did not notice they had DebugSymbols=false. Then they would be pretty upset when they eventually find out that the pdb is no longer generated. I think this is the right change and it's good to have, but for almost any behavioral change in the SDK, someone is going to get broken by it 🥹

@Forgind
Copy link
Contributor Author

Forgind commented Jun 12, 2024

@dotnet-policy-service rerun

@Forgind Forgind changed the base branch from release/8.0.4xx to main June 12, 2024 16:35
@Forgind Forgind merged commit a7be949 into dotnet:main Jun 12, 2024
@Forgind Forgind deleted the respect-debugsymbols-false branch June 12, 2024 20:17
@rainersigwald
Copy link
Member

I believe this is going back to how things were before .NET 8

What's that based on @Forgind? I don't think the behavior is that new.

@Forgind
Copy link
Contributor Author

Forgind commented Jun 12, 2024

I believe this is going back to how things were before .NET 8

What's that based on @Forgind? I don't think the behavior is that new.

jkotas said the documentation didn't match .NET 8 behavior, which suggests that it changed a bit before .NET 8. To be clear, I wasn't saying it changed in .NET 8 or even .NET 7; I'm not really sure when 'before' .NET 8 it changed to this behavior. Because I didn't know, we ultimately decided to classify this as a standard breaking change and retarget to 9.0 accordingly.

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

Labels

Area-NetSDK breaking-change Using this label will notify dotnet/compat and trigger a request to file a compat bug needs-breaking-change-doc-created Review for breaking changes untriaged Request triage from a team member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

-p:DebugSymbols=false does not disable generation of .pdb files

3 participants