Create xplat and Windows native symbol packages#7756
Conversation
src/Native/CMakeLists.txt
Outdated
| endif(CLR_CMAKE_PLATFORM_UNIX) | ||
| endfunction() | ||
|
|
||
| function(install_clr targetName) |
There was a problem hiding this comment.
NIT: I believe I understand why this function is named like it is (since these targets initially came from CoreCLR), but maybe we should instead call it install_corefx or install_library_and_symbols ?
There was a problem hiding this comment.
Yep, that's the reason, but I agree. I like install_library_and_symbols. System.Native still uses normal install for the static lib and using a more descriptive name for the dynamic lib will make the difference more obvious than install vs. install_corefx. (And if we need to change install_... to do more stuff than just libraries and symbols I think we could just refactor at that point.) Renaming.
On windows, you could consider using @mikem8361 might know if there is a similar tool on OSX/Linux to ensure that the a symbol file matches up to a |
| </File> | ||
|
|
||
| <!-- Include placeholder pdb on non-Windows platforms to ensure package is treated like a symbol package. --> | ||
| <File Include="$(MSBuildThisFileDirectory)\_.pdb" Condition="'$(PackageTargetRuntime)'!='' AND '$(OSGroup)'!='Windows_NT'"> |
There was a problem hiding this comment.
Have we talked with MyGet/NuGet to understand if this sort of thing is reasonable to be doing? I worry a little bit it's going to cause problems for downstream consumers.
There was a problem hiding this comment.
No, we're trying to work out what the way forward here should be in general, too, so we still need to talk to MyGet. I added you to the thread about this. --But we should definitely talk to them before publishing these to our real feed, even just to make sure they're aware of this.
I don't see how these would cause any problems, though--these packages upload straight to a MyGet-specific feature (skipping the dotnet-core feed), so it seems like it would require quite some effort to notice this, let alone get broken by it. Maybe I don't understand the kind of problems you're thinking of.
(Edit) I've been in contact with MyGet, VSTS, NuGet, and there haven't been objections.
|
Good idea. I tried out
|
We'll need to get a symbol file produced before we start using this |
|
I added a linker flag to create Windows/Release |
|
@mikem8361https://github.com/mikem8361 might know if there is a similar tool on OSX/Linux to ensure that the a symbol file matches up to a .so |
|
#7840 does the Windows native pdb packaging, so once that goes in I'll remove the Windows changes I have here to get rid of the merge conflict that'll show up. 😄 (For testing I resolved the merge locally and it works after that.) |
|
@dagood done! PDBs will be produced with clrcompression now. |
80723d6 to
207c31a
Compare
|
@ianhays Thanks! Rebased on master. |
f907ce9 to
50dc286
Compare
|
Rebased this on latest and cleaned up. Previously I'd thought we were going a different direction with the symbol packages, but it turns out this PR is the way we're going forward. At some point we won't need the placeholder |
50dc286 to
f5c0bb4
Compare
|
@dotnet-bot test Innerloop OSX Release Build and Test (rebooted machine by accident) |
|
Packaging changes look reasonable to me. Make sure to diff the nuspecs before/after your change to make sure you only see changes you expect. I commonly use |
src/Native/pkg/dir.props
Outdated
|
|
||
| <!-- Add path globs specific to native binaries to exclude unnecessary files in packages. --> | ||
| <ItemGroup> | ||
| <AdditionalLibPackageExcludes Include="%2A%2A\%2A.dbg" Condition="'$(OSGroupPath)'=='Linux'" /> |
There was a problem hiding this comment.
Can we just use $(SymbolFileExtension) here instead (and have the glob be the same?)
There was a problem hiding this comment.
Good idea, and I think I'll do similar for the other globs. (I'll also move the condition to the ItemGroup to continue not adding these on Windows.)
|
@dagood, you will need another rebase to pick up the Open Suse 13.2 package authoring stuff, so you can make changes to that pkgproj as well, I think. |
Simple replacement. This allows the symbol files to be added later with the correct File items.
|
@ellismg Thanks, rebased again and changed those pkgprojs. @ericstj Good idea. It indeed added pdbs to Windows Debug and Release nuspecs, and only added the xplat native symbols on the Release build (where they would be stripped into the symbol file). Only other change was that it ordered the |
|
Other than my small comments, LGTM. Thanks for doing this, Davis. |
f5c0bb4 to
bb49b7a
Compare
Rename install_clr function to install_library_and_symbols.
bb49b7a to
834d657
Compare
|
@dotnet-bot test Innerloop OSX Debug Build and Test |
Create xplat and Windows native symbol packages Commit migrated from dotnet/corefx@9823256
On Windows, in Debug configuration, creates symbol packages with the
.pdbfrom the native build.On Linux/OSX, in Release configuration, creates symbol packages with symbols that have been stripped from the release library. On Linux the symbol files are
.so.dbg, on OSX.dylib.dwarf.The symbol stripping code is from https://github.com/dotnet/coreclr/blob/afdce3a592e/CMakeLists.txt#L279-L340 as well as some simplified platform detection logic from earlier in that file. I also looked at the PRs for stripping coreclr symbols (dotnet/coreclr#3872) and creating coreclr symbol packages (dotnet/coreclr#4218) a lot while making these changes.
I've tested on Win10, OSX 10.11, and Ubuntu 14.04.4. I've uploaded the resulting native symbol packages to https://www.myget.org/gallery/dagood-test-native-symbols-corefx.
I had to rig a few things to test this out (I'll be looking into them further):
RuntimeOStoosx.10.10inbuild-packages.sh. It's being used to filter which packages are created, and myosx.10.11resulted in no runtime packages being made./p:ConfigurationGroup=Release(orDebug) tobuild-packages. The command should probably have a switch built in./cc @ericstj @weshaggard @brianrob