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

.NET: Not generating .dSYMs #14067

Closed
rolfbjarne opened this issue Feb 4, 2022 · 0 comments · Fixed by #14335
Closed

.NET: Not generating .dSYMs #14067

rolfbjarne opened this issue Feb 4, 2022 · 0 comments · Fixed by #14335
Assignees
Labels
bug If an issue is a bug or a pull request a bug fix dotnet An issue or pull request related to .NET (6) dotnet-pri0 .NET 6: required for stable release
Milestone

Comments

@rolfbjarne
Copy link
Member

From #13838 (comment) (CC @lauxjpn)


It seems that net6.0-ios builds do not generate dSYM symbols. What is the recommended approach for generating them?

I am currently using the following workaround:

<Target Name="PrepareGenerateDSymFiles"
        AfterTargets="_PrepareDebugSymbolGeneration"
        BeforeTargets="_GenerateDebugSymbols">
    <ItemGroup>
        <_AppExtensionDebugSymbolProperties>
            <NoDSymUtil>true</NoDSymUtil>
            <NoSymbolStrip>true</NoSymbolStrip>
        </_AppExtensionDebugSymbolProperties>
    </ItemGroup>
</Target>

<Target Name="GenerateDSymFiles"
        AfterTargets="_CopyAppExtensionsToBundle"
        DependsOnTargets="_GetNativeExecutableName;
                          _PrepareDebugSymbolGeneration;
                          PrepareGenerateDSymFiles;
                          _GenerateDebugSymbols">
</Target>
@rolfbjarne rolfbjarne added dotnet An issue or pull request related to .NET (6) dotnet-pri0 .NET 6: required for stable release labels Feb 4, 2022
@rolfbjarne rolfbjarne added this to the .NET 6 milestone Feb 4, 2022
@rolfbjarne rolfbjarne added the bug If an issue is a bug or a pull request a bug fix label Feb 4, 2022
@rolfbjarne rolfbjarne self-assigned this Feb 11, 2022
rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this issue Mar 2, 2022
…ripping. Fixes dotnet#14067.

----

This turned out somewhat non-straight-forward for universal builds, because debug
symbols are created for the universal app bundle, not for each rid-specific version
of the app bundle.

So I had to add logic to create the native symbol lists (MtouchSymbolsList) for each
rid-specific build, but then collect them and merge those lists for the universal
app bundle.

The existing SymbolStrip call we did right after linking the native executable was
removed, because we have to do that after creating the dSYM (which the GenerateDebugSymbols
target does).

Also add tests.

---

Fixes dotnet#14067.
rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this issue Mar 4, 2022
…ripping. Fixes dotnet#14067.

----

This turned out somewhat non-straight-forward for universal builds, because debug
symbols are created for the universal app bundle, not for each rid-specific version
of the app bundle.

So I had to add logic to create the native symbol lists (MtouchSymbolsList) for each
rid-specific build, but then collect them and merge those lists for the universal
app bundle.

The existing SymbolStrip call we did right after linking the native executable was
removed, because we have to do that after creating the dSYM (which the GenerateDebugSymbols
target does).

Also add tests.

---

Fixes dotnet#14067.
rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this issue Mar 8, 2022
…ripping. Fixes dotnet#14067.

----

This turned out somewhat non-straight-forward for universal builds, because debug
symbols are created for the universal app bundle, not for each rid-specific version
of the app bundle.

So I had to add logic to create the native symbol lists (MtouchSymbolsList) for each
rid-specific build, but then collect them and merge those lists for the universal
app bundle.

The existing SymbolStrip call we did right after linking the native executable was
removed, because we have to do that after creating the dSYM (which the GenerateDebugSymbols
target does).

Also add tests.

---

Fixes dotnet#14067.
rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this issue Mar 10, 2022
…code signing. Fixes dotnet#14067.

Change code signing to only sign when we're building the outermost app bundle (previously
we'd sign each app extension or watch app before copying them into the app bundle).
This makes it easier to handle code signing fpr .NET universal apps, when we merge
RID-specific bundles and can only codesign at the very end anyway.

This also means that we have to change dSYM generation and native stripping accordingly:
they're done immediately before code signing now, in a newly minted post processing
target.

Challenges:

* Both calling 'strip' and 'codesign' on an executable modifies that executable,
  which means that we must make sure to not call 'dsymutil' on the same binary at
  a later point unless it's been rebuilt.
* Thus we must make sure to update 'dsymutil's stamp file whenever we call 'strip'
  and/or 'codesign' on an executable.

# Changes

* macOS: we'll always sign frameworks (like we've always signed dylibs).

# TODO

Run submission tests.

----

This turned out somewhat non-straight-forward for universal builds, because debug
symbols are created for the universal app bundle, not for each rid-specific version
of the app bundle.

So I had to add logic to create the native symbol lists (MtouchSymbolsList) for each
rid-specific build, but then collect them and merge those lists for the universal
app bundle.

The existing SymbolStrip call we did right after linking the native executable was
removed, because we have to do that after creating the dSYM (which the GenerateDebugSymbols
target does).

Also add tests.

---

Fixes dotnet#14067.
rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this issue Mar 11, 2022
…code signing. Fixes dotnet#14067.

Change code signing to only sign when we're building the outermost app bundle (previously
we'd sign each app extension or watch app before copying them into the app bundle).
This makes it easier to handle code signing fpr .NET universal apps, when we merge
RID-specific bundles and can only codesign at the very end anyway.

This also means that we have to change dSYM generation and native stripping accordingly:
they're done immediately before code signing now, in a newly minted post processing
target.

Challenges:

* Both calling 'strip' and 'codesign' on an executable modifies that executable,
  which means that we must make sure to not call 'dsymutil' on the same binary at
  a later point unless it's been rebuilt.
* Thus we must make sure to update 'dsymutil's stamp file whenever we call 'strip'
  and/or 'codesign' on an executable.

* macOS: we'll always sign frameworks (like we've always signed dylibs).

Run submission tests.

----

This turned out somewhat non-straight-forward for universal builds, because debug
symbols are created for the universal app bundle, not for each rid-specific version
of the app bundle.

So I had to add logic to create the native symbol lists (MtouchSymbolsList) for each
rid-specific build, but then collect them and merge those lists for the universal
app bundle.

The existing SymbolStrip call we did right after linking the native executable was
removed, because we have to do that after creating the dSYM (which the GenerateDebugSymbols
target does).

Also add tests.

---

Fixes dotnet#14067.
rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this issue Mar 16, 2022
…code signing. Fixes dotnet#14067.

Change code signing to only sign when we're building the outermost app bundle (previously
we'd sign each app extension or watch app before copying them into the app bundle).
This makes it easier to handle code signing fpr .NET universal apps, when we merge
RID-specific bundles and can only codesign at the very end anyway.

This also means that we have to change dSYM generation and native stripping accordingly:
they're done immediately before code signing now, in a newly minted post processing
target.

Challenges:

* Both calling 'strip' and 'codesign' on an executable modifies that executable,
  which means that we must make sure to not call 'dsymutil' on the same binary at
  a later point unless it's been rebuilt.
* Thus we must make sure to update 'dsymutil's stamp file whenever we call 'strip'
  and/or 'codesign' on an executable.

* macOS: we'll always sign frameworks (like we've always signed dylibs).

Run submission tests.

----

This turned out somewhat non-straight-forward for universal builds, because debug
symbols are created for the universal app bundle, not for each rid-specific version
of the app bundle.

So I had to add logic to create the native symbol lists (MtouchSymbolsList) for each
rid-specific build, but then collect them and merge those lists for the universal
app bundle.

The existing SymbolStrip call we did right after linking the native executable was
removed, because we have to do that after creating the dSYM (which the GenerateDebugSymbols
target does).

Also add tests.

---

Fixes dotnet#14067.
rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this issue Mar 16, 2022
…code signing. Fixes dotnet#14067.

Change code signing to only sign when we're building the outermost app bundle (previously
we'd sign each app extension or watch app before copying them into the app bundle).
This makes it easier to handle code signing fpr .NET universal apps, when we merge
RID-specific bundles and can only codesign at the very end anyway.

This also means that we have to change dSYM generation and native stripping accordingly:
they're done immediately before code signing now, in a newly minted post processing
target.

Challenges:

* Both calling 'strip' and 'codesign' on an executable modifies that executable,
  which means that we must make sure to not call 'dsymutil' on the same binary at
  a later point unless it's been rebuilt.
* Thus we must make sure to update 'dsymutil's stamp file whenever we call 'strip'
  and/or 'codesign' on an executable.

* macOS: we'll always sign frameworks (like we've always signed dylibs).

Run submission tests.

----

This turned out somewhat non-straight-forward for universal builds, because debug
symbols are created for the universal app bundle, not for each rid-specific version
of the app bundle.

So I had to add logic to create the native symbol lists (MtouchSymbolsList) for each
rid-specific build, but then collect them and merge those lists for the universal
app bundle.

The existing SymbolStrip call we did right after linking the native executable was
removed, because we have to do that after creating the dSYM (which the GenerateDebugSymbols
target does).

Also add tests.

---

Fixes dotnet#14067.
rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this issue Mar 17, 2022
…code signing. Fixes dotnet#14067.

Change code signing to only sign when we're building the outermost app bundle (previously
we'd sign each app extension or watch app before copying them into the app bundle).
This makes it easier to handle code signing fpr .NET universal apps, when we merge
RID-specific bundles and can only codesign at the very end anyway.

This also means that we have to change dSYM generation and native stripping accordingly:
they're done immediately before code signing now, in a newly minted post processing
target.

Challenges:

* Both calling 'strip' and 'codesign' on an executable modifies that executable,
  which means that we must make sure to not call 'dsymutil' on the same binary at
  a later point unless it's been rebuilt.
* Thus we must make sure to update 'dsymutil's stamp file whenever we call 'strip'
  and/or 'codesign' on an executable.

* macOS: we'll always sign frameworks (like we've always signed dylibs).

Run submission tests.

----

This turned out somewhat non-straight-forward for universal builds, because debug
symbols are created for the universal app bundle, not for each rid-specific version
of the app bundle.

So I had to add logic to create the native symbol lists (MtouchSymbolsList) for each
rid-specific build, but then collect them and merge those lists for the universal
app bundle.

The existing SymbolStrip call we did right after linking the native executable was
removed, because we have to do that after creating the dSYM (which the GenerateDebugSymbols
target does).

Also add tests.

---

Fixes dotnet#14067.
rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this issue Mar 22, 2022
dotnet#14067.

Change dSYM generation and native stripping to occur immediately before code signing,
in a newly minted post processing target.

Challenges:

* Both calling 'strip' and 'codesign' on an executable modifies that executable,
  which means that we must make sure to not call 'dsymutil' on the same binary at
  a later point unless it's been rebuilt.
* Thus we must make sure to update 'dsymutil's stamp file whenever we call 'strip'
  and/or 'codesign' on an executable.
* Just like for code signing, we must store the libraries (either static or dynamic)
  we post process in extension/watch/rid-specific projects, so that these libraries
  can be loaded in containing projects and processed there.
* In universal .NET builds, debug symbols are created for the universal app bundle,
  not for each rid-specific version of the app bundle. So I had to add logic to create
  the native symbol lists (MtouchSymbolsList) for each rid-specific build, but then
  collect them and merge those lists for the universal app bundle.

The existing SymbolStrip call we did right after linking the native executable has
been removed, because we have to do that after creating the dSYM (which the GenerateDebugSymbols
target does).

Also add tests.

Fixes dotnet#14067.
rolfbjarne added a commit that referenced this issue Mar 24, 2022
#14067. (#14335)

Change dSYM generation and native stripping to occur immediately before code signing,
in a newly minted post processing target.

Challenges:

* Both calling 'strip' and 'codesign' on an executable modifies that executable,
  which means that we must make sure to not call 'dsymutil' on the same binary at
  a later point unless it's been rebuilt.
* Thus we must make sure to update 'dsymutil's stamp file whenever we call 'strip'
  and/or 'codesign' on an executable.
* Just like for code signing, we must store the list libraries (either static or dynamic)
  we post process in extension/watch/rid-specific projects, so that these libraries
  can be loaded in containing projects and processed there.
* In universal .NET builds, debug symbols are created for the universal app bundle,
  not for each rid-specific version of the app bundle. So I had to add logic to create
  the native symbol lists (MtouchSymbolsList) for each rid-specific build, but then
  collect them and merge those lists for the universal app bundle.

The existing SymbolStrip call we did right after linking the native executable has
been removed, because we have to do that after creating the dSYM.

Also add tests.

Fixes #14067.
@ghost ghost locked as resolved and limited conversation to collaborators Apr 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug If an issue is a bug or a pull request a bug fix dotnet An issue or pull request related to .NET (6) dotnet-pri0 .NET 6: required for stable release
Projects
None yet
1 participant