From: rickmark@... Date: 2021-03-22T19:50:45+00:00 Subject: [ruby-core:102978] [Ruby master Feature#17730] Ruby on macOS transitively links to ~150 dylibs Issue #17730 has been updated by rickmark (Rick Mark). File ruby_final.txt added rickmark (Rick Mark) wrote in #note-8: > nobu (Nobuyoshi Nakada) wrote in #note-5: > > The Security framework is linked only when it is available but CommonRandom is not. > > It is the case that the minimum required macOS version is 10.7(Lion)..10.9(Mavericks). > > I'm not sure whether other sources are available on these old versions. > > From compiling recently it looks like `Security.framework` is always linked (see the static linkage results from the text files) > > I can rework this patch to do what we would expect (use Security.framework on 10.7-10.9 and then use CoreCrypto for > 10.10) > > Will open a new issue for that work Nevermind - I just recompiled ruby from head. Looks like the linking is correct now. Must have been Foundation brining in Security causing my confusion. Final linking output attached ---------------------------------------- Feature #17730: Ruby on macOS transitively links to ~150 dylibs https://bugs.ruby-lang.org/issues/17730#change-91041 * Author: rickmark (Rick Mark) * Status: Closed * Priority: Normal ---------------------------------------- By using `-framework Security` and `-framework Foundation` Ruby 3 pulls in about 150 dylibs when compiled for macOS By using CoreCrypto / CoreFoundation I was able to reduce this to ~50. This greatly reduces Ruby's surface area and dependencies on macOS. Further CoreFoundation is only used for one call in the entire codebase of `CFStringNormalize(m, kCFStringNormalizationFormC);` - if we can replace this, Ruby could work with only `libSystem` and `libgmp`. ---Files-------------------------------- ruby_deps_after.txt (2.24 KB) ruby_deps_before.txt (9.81 KB) 0001-Remove-unneeded-dependencies-on-macOS.patch (2.36 KB) ruby_final.txt (2.24 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: