ImHex icon indicating copy to clipboard operation
ImHex copied to clipboard

[Feature] Support for macos 10.14?

Open Pomax opened this issue 3 years ago • 4 comments

What feature would you like to see?

I understand that if you're on a modern Mac, it's going to compile for that mac, but does it have to target 10.15? Is there anything that this tool does that only works on 10.15 and not on 10.14? Because for historical binary data, having to use an actual 10.14 based mac is not too unusual.

How will this feature be useful to you and others?

Really, just building against whatever is the oldest mac SDK given the features this needs is probably even better. If it works for 10.12 or even 10.10, and those .app files also work on 11 or 12, then better to compile against that old target?

Request Type

  • [ ] I can provide a PoC for this feature or am willing to work on it myself and submit a PR

Pomax avatar Jul 30 '22 23:07 Pomax

Hi Would it be possible for you to test if linking to an older SDK works fine on the newer OS versions? I don't have any mac myself so I can't really test this stuff myself, sorry.

WerWolv avatar Jul 30 '22 23:07 WerWolv

I'm not sure how we even define the target we build against. In the CI, we build against MacOS 11, not even 10.15

If you have any idea on how to use an older target..

iTrooz avatar Jul 31 '22 01:07 iTrooz

I poked around the code a few months back and didn't see anything specific to macOS >=11, so it's probably as simple as changing the target deployment version and compiling it on a 10.14 machine.

Homebrew links against libraries that are compiled for the macOS version of the worker/compiling machine, but GitHub Actions only supports 10.15 and higher. It looks like the location of the OpenGL headers have changed with the release of macOS 11, and I'm not sure it's worth debugging at all considering how Mojave has long been EOL and has such low market share.

Regardless, can you try the artifact from my branch and see if it works? I don't have Rosetta installed on the install of macOS I'm using right now and I especially don't have a computer with 10.14 installed: https://github.com/Raymonf/ImHex/actions/runs/2767862225

Raymonf avatar Jul 31 '22 02:07 Raymonf

@WerWolv

Would it be possible for you to test if linking to an older SDK works fine on the newer OS versions?

It's usually as simple as compiling each library with the proper (lower) target deployment version and it all gets figured out automagically. However, since the CI build uses the Homebrew package manager to install the dependencies (glfw, mbedtls, nlohmann-json, cmake, ccache, python3, freetype2, libmagic, pkg-config, and GCC 12), the installed pre-built binaries are compiled with the target deployment version set to the version of macOS it's being installed on.

From what I understand, those other packages would have to be compiled and installed manually (or at least in another way) within the workflow, since Homebrew doesn't allow or support downloading dependencies for older versions of macOS. I think it would suck to have to compile GCC within the workflow - maybe it'd be possible to get the build working with Clang to avoid that? But really, I don't know much about how others target older versions of macOS in their CI builds other than using a self-hosted worker since I'm largely a macOS end-user. It looks like Handbrake happily maintains a script to build every dependency they need.

Perhaps it's possible to set the target deployment version environment variable and take advantage of the --from-source option in Homebrew somehow to avoid having to deal with all of this.

Raymonf avatar Jul 31 '22 02:07 Raymonf

I lowered the link version to macOS 10.10 now. No idea if that helps at all but it's as far as I'd like to go. I rather don't want to do a bunch of weird stuff just to support older versions of an operating system I never used myself. If there's more small things that would help, I'm happy to change them but I don't want to re-make the entire build script.

WerWolv avatar Aug 01 '22 13:08 WerWolv

This is perfect - only discovered the tool yesterday and it looks great but I'm stuck on 10.14.

@WerWolv are you planning to roll 10.14 support into the next release?

Thank you

xerxesb avatar Aug 01 '22 23:08 xerxesb

@xerxesb As said above, it seems nobody here has a good idea of whether it’ll work or not.

Can you try the last CI build and see if it works for you on 10.14? If it works then that’s a good sign.

Raymonf avatar Aug 02 '22 00:08 Raymonf

Happy to help.

Previous version wouldn't let me open the app (it said it the binary only supported 10.15), but the CI version at least is identified as being 10.14 compatible and lets me launch it.

Unfortunately it crashes immediately on launch:

Process:               imhex [58320]
Path:                  /Applications/imhex.app/Contents/MacOS/imhex
Identifier:            net.WerWolv.ImHex
Version:               1.19 (1.19.3)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           imhex [58320]
User ID:               501

Date/Time:             2022-08-02 10:35:11.356 +1000
OS Version:            Mac OS X 10.14.6 (18G9216)
Report Version:        12
Bridge OS Version:     6.4 (19P4243)
Anonymous UUID:        5618C02C-8AB8-B6F9-FEE3-B68185E5E701

Sleep/Wake UUID:       21B4A97E-DCEC-4F06-9DD3-57BB9AA4A708

Time Awake Since Boot: 1600000 seconds
Time Since Wake:       490000 seconds

System Integrity Protection: enabled

Crashed Thread:        0

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    DYLD, [0x1] Library missing

Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
  Library not loaded: /System/Library/Frameworks/UniformTypeIdentifiers.framework/Versions/A/UniformTypeIdentifiers
  Referenced from: /Applications/imhex.app/Contents/MacOS/imhex
  Reason: image not found

Binary Images:
       0x102caa000 -        0x102d75fef +net.WerWolv.ImHex (1.19 - 1.19.3) <3FCF9A4F-709E-37FF-86DE-70BFBA3D174E> /Applications/imhex.app/Contents/MacOS/imhex
       0x102d91000 -        0x10388cfff +libimhex.1.19.3.dylib (0) <9009F841-6ED0-35B4-8CE5-9C3730A1073F> /Applications/imhex.app/Contents/Frameworks/libimhex.1.19.3.dylib
       0x1041e4000 -        0x104267fff +libfreetype.6.dylib (0) <B44A5C29-49E4-367F-817E-A09CE34D1EC1> /Applications/imhex.app/Contents/Frameworks/libfreetype.6.dylib
       0x10428a000 -        0x1042adff3 +libglfw.3.3.dylib (0) <56FB13F1-96E0-399F-8984-9BEE63C5DF3F> /Applications/imhex.app/Contents/Frameworks/libglfw.3.3.dylib
       0x1042cc000 -        0x1042e7fff +libmagic.1.dylib (0) <40A62A06-F8DA-32EF-9BF2-C0FDDB359439> /Applications/imhex.app/Contents/Frameworks/libmagic.1.dylib
       0x1042f9000 -        0x10431cff3 +libmbedtls.3.2.1.dylib (0) <CB29B669-07C7-3ECD-A2E0-F7D8AAC2FD72> /Applications/imhex.app/Contents/Frameworks/libmbedtls.3.2.1.dylib
       0x104332000 -        0x10433dff7 +libmbedx509.3.2.1.dylib (0) <AB6DB2C1-0CAE-365F-8835-4ED57D1B00D9> /Applications/imhex.app/Contents/Frameworks/libmbedx509.3.2.1.dylib
       0x10434d000 -        0x10439cff3 +libmbedcrypto.3.2.1.dylib (0) <FA82C4B5-6471-3838-AFE9-7F5775FAE681> /Applications/imhex.app/Contents/Frameworks/libmbedcrypto.3.2.1.dylib
       0x1043c4000 -        0x1043efffb +libssh2.1.dylib (0) <7B98FF4D-4BE4-3908-82F9-7B7B4D438E9B> /Applications/imhex.app/Contents/Frameworks/libssh2.1.dylib
       0x104406000 -        0x1046c5fff +org.python.python (3.9.13, [c] 2001-2021 Python Software Foundation. - 3.9.13) <8B460950-AFFC-349B-A079-88C9800C75E6> /Applications/imhex.app/Contents/Frameworks/Python.framework/Versions/3.9/Python
       0x10478c000 -        0x10493bfe7 +libstdc++.6.dylib (0) <77062E6F-9899-34D1-BC77-7A3D783FE15C> /Applications/imhex.app/Contents/Frameworks/libstdc++.6.dylib
       0x10c638000 -        0x10c6a270f  dyld (655.1.1) <AF217C8D-5AF1-34FF-8643-A3FB0537E9D0> /usr/lib/dyld
    0x7fff5098c000 -     0x7fff51741ffb  com.apple.AppKit (6.9 - 1671.60.109) <13EBDF4A-1B54-36F6-BC85-E23526B163F6> /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
    0x7fff555fe000 -     0x7fff559acffb  com.apple.Foundation (6.9 - 1575.405) <1177B3CF-C81D-3982-BCC2-819731D99F01> /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
    0x7fff5751a000 -     0x7fff5754fff3  com.apple.LDAPFramework (2.4.28 - 194.5) <313F6B35-86A0-3228-8CC2-B059186F7176> /System/Library/Frameworks/LDAP.framework/Versions/A/LDAP
    0x7fff5d028000 -     0x7fff5d037ffb  com.apple.opengl (17.7.3 - 17.7.3) <7AC113CD-89D7-3123-9E44-898F5B238BEC> /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
    0x7fff7eb2b000 -     0x7fff7eb3dff7  libz.1.dylib (70.200.4) <B048FC1F-058F-3A08-A1FE-81D5308CB3E6> /usr/lib/libz.1.dylib

xerxesb avatar Aug 02 '22 00:08 xerxesb

Then I think the conversation should move to #597 (Currently I have no idea what the problem is and how to fix it, so if you have any idea, feel free to tell them there !)

iTrooz avatar Aug 02 '22 00:08 iTrooz