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

Strip libmonosgen linked library #53240

Merged
merged 16 commits into from
Jun 8, 2021
Merged

Conversation

directhex
Copy link
Member

@directhex directhex commented May 25, 2021

It seems in all Mono .symbols.nupkg packages, instead of a stripped .dylib/so and companion .dwarf/.dbg, we've just been shipping unstripped libs (and shipping unstripped libs in the non-symbols packages too). This commit largely duplicates the functions from eng/native/functions.cmake into an MSbuild proj, as our entire install logic is already in MSbuild not CMake. Moving to the common CMake functions would be a much larger task.

This should reduce our install size, and better mirror the rest of dotnet's debug infra & behaviour.

It seems in the .symbols.nupkg package, instead of a stripped .dylib/so and
companion .dwarf/.dbg, we've just been shipping unstripped libs. This commit
largely duplicates the functions from eng/native/functions.cmake into an
MSbuild proj, as our entire logic is already in MSbuild not CMake.
@directhex
Copy link
Member Author

directhex commented May 26, 2021

Copy link
Member

@akoeplinger akoeplinger left a comment

Choose a reason for hiding this comment

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

This probably also fixes #45013, though we should check we don't impact XA/XI.

src/mono/mono.proj Outdated Show resolved Hide resolved
@akoeplinger
Copy link
Member

What's the status of this PR?

@directhex
Copy link
Member Author

I think it's fine, just running into flakiness in unrelated places in testing

@akoeplinger
Copy link
Member

Retriggered the lanes just to be sure :)

@lateralusX
Copy link
Member

lateralusX commented Jun 4, 2021

@directhex we would need to strip libmono-component-*.so when doing dynamic components build (currently only on Android), something we could add into this PR as well?

@directhex
Copy link
Member Author

@lateralusX how can i force a dynamic components build on... anything that isn't android? that's one platform i don't have the environment set up locally for

@directhex
Copy link
Member Author

wait, docker, right. bleh

@directhex
Copy link
Member Author

Failed to create CoreCLR, HRESULT: 0x8007FF06

I hate docker

@directhex
Copy link
Member Author

@lateralusX this is looking good locally

$ unzip -lf /home/directhex/Projects/runtime/artifacts/packages/Release/Shipping/Microsoft.NETCore.App.Runtime.Mono.android-arm64.6.0.0-ci.symbols.nupkg | grep
dbg
  1717872  2021-06-08 14:05   runtimes/android-arm64/native/libmono-component-diagnostics_tracing.so.dbg
   475664  2021-06-08 14:05   runtimes/android-arm64/native/libmono-component-hot_reload.so.dbg
 17705560  2021-06-08 14:05   runtimes/android-arm64/native/libmonosgen-2.0.so.dbg
  2766008  2021-06-08 14:05   runtimes/android-arm64/native/libSystem.IO.Compression.Native.so.dbg
   313464  2021-06-08 14:05   runtimes/android-arm64/native/libSystem.Native.so.dbg
   751080  2021-06-08 14:05   runtimes/android-arm64/native/libSystem.Security.Cryptography.Native.Android.so.dbg

$ unzip -lf /home/directhex/Projects/runtime/artifacts/packages/Release/Shipping/Microsoft.NETCore.App.Runtime.Mono.android-arm64.6.0.0-ci.nupkg | grep dbg

@lateralusX
Copy link
Member

@lateralusX how can i force a dynamic components build on... anything that isn't android? that's one platform i don't have the environment set up locally for

Sorry, just saw this, there is MonoComponentsStatic in mono.proj controling build, so not setting it or make sure cmake won't get -DSTATIC_COMPONENTS=1 should enable dynamic component builds.

@lateralusX
Copy link
Member

What is the size of the stripped .so files?

@directhex
Copy link
Member Author

@lateralusX

-rw-r--r-- 3 root root 275K Jun  8 10:05 artifacts/bin/mono/Android.arm64.Release/libmono-component-diagnostics_tracing.so
-rwxr-xr-x 3 root root 1.7M Jun  8 10:05 artifacts/bin/mono/Android.arm64.Release/libmono-component-diagnostics_tracing.so.dbg
-rw-r--r-- 3 root root 131K Jun  8 10:05 artifacts/bin/mono/Android.arm64.Release/libmono-component-hot_reload.so
-rwxr-xr-x 3 root root 465K Jun  8 10:05 artifacts/bin/mono/Android.arm64.Release/libmono-component-hot_reload.so.dbg
-rw-r--r-- 3 root root 3.2M Jun  8 10:05 artifacts/bin/mono/Android.arm64.Release/libmonosgen-2.0.so
-rwxr-xr-x 3 root root  17M Jun  8 10:05 artifacts/bin/mono/Android.arm64.Release/libmonosgen-2.0.so.dbg

@directhex directhex merged commit 84c11e4 into dotnet:main Jun 8, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Jul 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants