How can we find which macOS releases (x.y.z) include a specific dylib version?

Let's say there is a dylib whose source code is available in a repository of https://github.com/apple-oss-distributions.

I can see a version/tag for this release in github.

Now I want to find which versions of macOS include this version of the dylib.

This requires to be able to tell which version of the lib is distributed with a specific macOS version. And this is already being a problem.

  • If I create a small executable that is linked to this library and I use otool -L to see the version of the dylib, I get 1.0.0. Which definitely does not match a version/tag from github.
  • If I use dlopen and the mach-o/dylib.h APIs to find the version listed in the appropriate segment/section, I also get 1.0.0.

The next step I'm looking at is to spend some time to successfully build the dyld_shared_cache_util to extract the dylib from the cache and hope there will be more info.

But, maybe, there is a document on Apple's website or a feature in the github repository that I missed.

So the question is: is there a simple way to get this info?

is there a simple way to get this info?

Yes and no. Oh wait, you said a simple way. That’s “No and no.” )-:

There’s a fundamental problem here, namely that, for any given project, we don’t guarantee that the code in Darwin matches the code running on the associated version of macOS. Some stuff is removed by the Darwin publication process. There’s no getting around that.

What I usually do is start here. That gives me the build number for the OS I care about. And if a build isn’t there, I generally look at the closest builds and interpolate from there.

If I create a small executable that is linked to this library and I use otool -L to see the version of the dylib, I get 1.0.0.

Yep. Those are different version spaces. The Mach-O version is largely vestigial these days.

If the code is bundled, you’ll often find the version encoded in its Info.plist. For example:

% sw_vers 
ProductName:		macOS
ProductVersion:		13.3.1
ProductVersionExtra:	(a)
BuildVersion:		22E772610a
% plutil -p /System/Library/Frameworks/Security.framework/Versions/Current/Resources/Info.plist | grep CFBundleVersion
  "CFBundleVersion" => "60420.101.4"

That’s pretty close to the 60420.81.3 value listed on the above-mentioned page for macOS 13.2.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Thanks.

This at least helped narrowing things to smaller ranges of macOS 12.

For macOS 11, unfortunately, the most recent versions are not listed in the page.

For macOS 11, unfortunately, the most recent versions are not listed in the page.

What are you really trying to do here?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

How can we find which macOS releases (x.y.z) include a specific dylib version?
 
 
Q