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

mac app bundling using cmake on m1 failure due to install_name_tool #348

Open
ipatch opened this issue Jul 28, 2022 · 11 comments
Open

mac app bundling using cmake on m1 failure due to install_name_tool #348

ipatch opened this issue Jul 28, 2022 · 11 comments
Assignees
Labels
help wanted useful issues that provide useful information

Comments

@ipatch
Copy link
Collaborator

ipatch commented Jul 28, 2022

my FreeCAD.app mac app bundle crashes on launch after using cmake, make install to build the bundle. below is the crash report i see after the bundle crashes.

sw_vers

ProductName:    macOS
ProductVersion: 12.4
BuildVersion:   21F79

i'm seeing a flurry of these messages when aseembling the bundle,

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Users/chris/code/freecad-git/installs/build.release.0.20.bundledir/FreeCAD.app/Contents/lib/python3.10/site-packages/PIL/.dylibs/libopenjp2.2.5.0.dylib
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Users/chris/code/freecad-git/installs/build.release.0.20.bundledir/FreeCAD.app/Contents/lib/python3.10/site-packages/pivy/_coin.cpython-310-darwin.so
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Users/chris/code/freecad-git/installs/build.release.0.20.bundledir/FreeCAD.app/Contents/lib/python3.10/config-3.10-darwin/libpython3.10.dylib

--

crash report

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               FreeCAD [83834]
Path:                  /Users/USER/*/FreeCAD.app/Contents/MacOS/FreeCAD
Identifier:            
Version:               0.20.0 (0.20.0)
Code Type:             ARM-64 (Native)
Parent Process:        launchd [1]
User ID:               502

Date/Time:             2022-07-28 12:45:20.2686 -0500
OS Version:            macOS 12.4 (21F79)
Report Version:        12
Anonymous UUID:        5CC24BCD-B012-CF28-443B-7DF02AEE10CC


Time Awake Since Boot: 350000 seconds

System Integrity Protection: enabled

Crashed Thread:        0

Exception Type:        EXC_BAD_ACCESS (SIGKILL (Code Signature Invalid))
Exception Codes:       UNKNOWN_0x32 at 0x00000001034ac000
Exception Codes:       0x0000000000000032, 0x00000001034ac000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    Namespace CODESIGNING, Code 2 

VM Region Info: 0x1034ac000 is in 0x1034ac000-0x103654000;  bytes after start: 0  bytes before end: 1736703
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      mapped file                 1032f0000-1034ac000    [ 1776K] r--/rwx SM=COW  ...t_id=88272747
--->  mapped file                 1034ac000-103654000    [ 1696K] r-x/rwx SM=COW  ...t_id=8771e347
      VM_ALLOCATE (reserved)      103654000-1037a4000    [ 1344K] rw-/rwx SM=NUL  ...(unallocated)

Thread 0 Crashed:
0   dyld                          	       0x102a78008 dyld3::MachOFile::isMachO(Diagnostics&, unsigned long long) const + 20
1   dyld                          	       0x102a592cc dyld4::Loader::mapSegments(Diagnostics&, dyld4::RuntimeState&, char const*, unsigned long long, dyld4::Loader::CodeSignatureInFile const&, bool, dyld3::Array<dyld4::Loader::Region> const&, bool, bool, dyld4::Loader::FileValidationInfo const&) + 1096
2   dyld                          	       0x102a592cc dyld4::Loader::mapSegments(Diagnostics&, dyld4::RuntimeState&, char const*, unsigned long long, dyld4::Loader::CodeSignatureInFile const&, bool, dyld3::Array<dyld4::Loader::Region> const&, bool, bool, dyld4::Loader::FileValidationInfo const&) + 1096
3   dyld                          	       0x102a5eb88 invocation function for block in dyld4::JustInTimeLoader::makeJustInTimeLoaderDisk(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, bool, unsigned int) + 68
4   dyld                          	       0x102a5e528 dyld4::JustInTimeLoader::withRegions(dyld3::MachOAnalyzer const*, void (dyld3::Array<dyld4::Loader::Region> const&) block_pointer) + 292
5   dyld                          	       0x102a5eadc invocation function for block in dyld4::JustInTimeLoader::makeJustInTimeLoaderDisk(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, bool, unsigned int) + 480
6   dyld                          	       0x102a63d58 dyld4::SyscallDelegate::withReadOnlyMappedFile(Diagnostics&, char const*, bool, void (void const*, unsigned long, bool, dyld4::FileID const&, char const*) block_pointer) const + 132
7   dyld                          	       0x102a5e8c8 dyld4::JustInTimeLoader::makeJustInTimeLoaderDisk(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, bool, unsigned int) + 204
8   dyld                          	       0x102a586d0 invocation function for block in dyld4::Loader::getLoader(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&) + 1384
9   dyld                          	       0x102a58b40 invocation function for block in dyld4::Loader::forEachResolvedAtPathVar(dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, dyld4::ProcessConfig::PathOverrides::Type, bool&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer) + 320
10  dyld                          	       0x102a45f98 dyld3::MachOFile::forEachLoadCommand(Diagnostics&, void (load_command const*, bool&) block_pointer) const + 168
11  dyld                          	       0x102a836d4 dyld3::MachOAnalyzer::forEachRPath(void (char const*, bool&) block_pointer) const + 128
12  dyld                          	       0x102a57b78 dyld4::Loader::forEachResolvedAtPathVar(dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, dyld4::ProcessConfig::PathOverrides::Type, bool&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer) + 708
13  dyld                          	       0x102a577ec invocation function for block in dyld4::Loader::forEachPath(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer) + 148
14  dyld                          	       0x102a4dee4 dyld4::ProcessConfig::PathOverrides::forEachPathVariant(char const*, dyld3::Platform, bool, bool&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer) const + 672
15  dyld                          	       0x102a57740 dyld4::Loader::forEachPath(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer) + 172
16  dyld                          	       0x102a57f60 dyld4::Loader::getLoader(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&) + 864
17  dyld                          	       0x102a5cb60 invocation function for block in dyld4::JustInTimeLoader::loadDependents(Diagnostics&, dyld4::RuntimeState&, dyld4::Loader::LoadOptions const&) + 380
18  dyld                          	       0x102a79264 invocation function for block in dyld3::MachOFile::forEachDependentDylib(void (char const*, bool, bool, bool, unsigned int, unsigned int, bool&) block_pointer) const + 148
19  dyld                          	       0x102a45f98 dyld3::MachOFile::forEachLoadCommand(Diagnostics&, void (load_command const*, bool&) block_pointer) const + 168
20  dyld                          	       0x102a790ac dyld3::MachOFile::forEachDependentDylib(void (char const*, bool, bool, bool, unsigned int, unsigned int, bool&) block_pointer) const + 172
21  dyld                          	       0x102a5c8c8 dyld4::JustInTimeLoader::loadDependents(Diagnostics&, dyld4::RuntimeState&, dyld4::Loader::LoadOptions const&) + 164
22  dyld                          	       0x102a495c0 dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 1092
23  dyld                          	       0x102a4906c start + 488


Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x00000001034ac000   x1: 0x000000016d73df18   x2: 0x00000000001a8000   x3: 0x0000000000040012
    x4: 0x0000000000000003   x5: 0x0000000000000000   x6: 0x0000000000000000   x7: 0x0000000000000000
    x8: 0x0000000102abc62c   x9: 0x0000000102abdea8  x10: 0x000000001e000000  x11: 0x08000000001e0000
   x12: 0x0000000000000001  x13: 0x0000000000000001  x14: 0x0000000000117d00  x15: 0x0000000000000000
   x16: 0x00000000000000c5  x17: 0x6ae100016d73d6f8  x18: 0x0000000000000000  x19: 0x000000016d73df18
   x20: 0x00000001026dc060  x21: 0x00000000002f8000  x22: 0x0000000000000003  x23: 0x000000016d73da08
   x24: 0x0000000000000040  x25: 0x0000000000000000  x26: 0x000000016d73d78c  x27: 0x0000000000000000
   x28: 0x00000001034ac000   fp: 0x000000016d73d350   lr: 0x933e000102a592cc
    sp: 0x000000016d73d340   pc: 0x0000000102a78008 cpsr: 0x00001000
   far: 0x00000001034ac000  esr: 0x92000007 (Data Abort) byte read Translation fault

Binary Images:
       0x102a44000 -        0x102aa3fff dyld (*) <d9c2a46e-8dc4-3950-9d6a-f799e8ccb683> /usr/lib/dyld
               0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=688K resident=0K(0%) swapped_out_or_unallocated=688K(100%)
Writable regions: Total=10.4M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=10.4M(100%)

                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
STACK GUARD                       56.0M        1 
Stack                             8176K        1 
VM_ALLOCATE (reserved)            1408K        3         reserved VM address space (unallocated)
__DATA                              32K        2 
__DATA_CONST                       112K        2 
__LINKEDIT                         240K        2 
__TEXT                             448K        2 
dyld private memory               1024K        1 
mapped file                       28.0M       11 
===========                     =======  ======= 
TOTAL                             95.2M       25 
TOTAL, minus reserved VM space    93.8M       25 



-----------
Full Report
-----------

{"app_name":"FreeCAD","timestamp":"2022-07-28 12:45:20.00 -0500","app_version":"0.20.0","slice_uuid":"ff0b9b0f-9759-31b9-8372-ddafac1e1963","build_version":"0.20.0","platform":1,"bundleID":"","share_with_app_devs":1,"is_first_party":0,"bug_type":"309","os_version":"macOS 12.4 (21F79)","incident_id":"A333F0C6-F8A4-437D-B582-1BFE8B760B2B","name":"FreeCAD"}
{
  "uptime" : 350000,
  "procLaunch" : "2022-07-28 12:45:17.1606 -0500",
  "procRole" : "Background",
  "version" : 2,
  "userID" : 502,
  "deployVersion" : 210,
  "modelCode" : "Macmini9,1",
  "procStartAbsTime" : 8443563114619,
  "coalitionID" : 64005,
  "osVersion" : {
    "train" : "macOS 12.4",
    "build" : "21F79",
    "releaseType" : "User"
  },
  "captureTime" : "2022-07-28 12:45:20.2686 -0500",
  "incident" : "A333F0C6-F8A4-437D-B582-1BFE8B760B2B",
  "bug_type" : "309",
  "pid" : 83834,
  "procExitAbsTime" : 8443637672023,
  "translated" : false,
  "cpuType" : "ARM-64",
  "procName" : "FreeCAD",
  "procPath" : "\/Users\/USER\/*\/FreeCAD.app\/Contents\/MacOS\/FreeCAD",
  "bundleInfo" : {"CFBundleShortVersionString":"0.20.0","CFBundleVersion":"0.20.0","CFBundleIdentifier":""},
  "storeInfo" : {"deviceIdentifierForVendor":"1186669F-9198-5B19-B8CF-3DCA66B5EFE1","thirdParty":true},
  "parentProc" : "launchd",
  "parentPid" : 1,
  "crashReporterKey" : "5CC24BCD-B012-CF28-443B-7DF02AEE10CC",
  "sip" : "enabled",
  "vmRegionInfo" : "0x1034ac000 is in 0x1034ac000-0x103654000;  bytes after start: 0  bytes before end: 1736703\n      REGION TYPE                    START - END         [ VSIZE] PRT\/MAX SHRMOD  REGION DETAIL\n      mapped file                 1032f0000-1034ac000    [ 1776K] r--\/rwx SM=COW  ...t_id=88272747\n--->  mapped file                 1034ac000-103654000    [ 1696K] r-x\/rwx SM=COW  ...t_id=8771e347\n      VM_ALLOCATE (reserved)      103654000-1037a4000    [ 1344K] rw-\/rwx SM=NUL  ...(unallocated)",
  "isCorpse" : 1,
  "exception" : {"codes":"0x0000000000000032, 0x00000001034ac000","rawCodes":[50,4350197760],"type":"EXC_BAD_ACCESS","signal":"SIGKILL (Code Signature Invalid)","subtype":"UNKNOWN_0x32 at 0x00000001034ac000"},
  "termination" : {"namespace":"CODESIGNING","flags":0,"code":2},
  "vmregioninfo" : "0x1034ac000 is in 0x1034ac000-0x103654000;  bytes after start: 0  bytes before end: 1736703\n      REGION TYPE                    START - END         [ VSIZE] PRT\/MAX SHRMOD  REGION DETAIL\n      mapped file                 1032f0000-1034ac000    [ 1776K] r--\/rwx SM=COW  ...t_id=88272747\n--->  mapped file                 1034ac000-103654000    [ 1696K] r-x\/rwx SM=COW  ...t_id=8771e347\n      VM_ALLOCATE (reserved)      103654000-1037a4000    [ 1344K] rw-\/rwx SM=NUL  ...(unallocated)",
  "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0},
  "faultingThread" : 0,
  "threads" : [{"triggered":true,"id":1704429,"threadState":{"x":[{"value":4350197760},{"value":6131277592},{"value":1736704},{"value":262162},{"value":3},{"value":0},{"value":0},{"value":0},{"value":4339779116,"symbolLocation":172,"symbol":"_main_thread"},{"value":4339785384,"symbolLocation":0,"symbol":"errno"},{"value":503316480},{"value":576460752305389568},{"value":1},{"value":1},{"value":1146112},{"value":0},{"value":197},{"value":7701436843911534328},{"value":0},{"value":6131277592},{"value":4335714400},{"value":3112960},{"value":3},{"value":6131276296},{"value":64},{"value":0},{"value":6131275660},{"value":0},{"value":4350197760}],"flavor":"ARM_THREAD_STATE64","lr":{"value":10609917776470840012},"cpsr":{"value":4096},"fp":{"value":6131274576},"sp":{"value":6131274560},"esr":{"value":2449473543,"description":"(Data Abort) byte read Translation fault"},"pc":{"value":4339499016,"matchesCrashFrame":1},"far":{"value":4350197760}},"frames":[{"imageOffset":213000,"symbol":"dyld3::MachOFile::isMachO(Diagnostics&, unsigned long long) const","symbolLocation":20,"imageIndex":0},{"imageOffset":86732,"symbol":"dyld4::Loader::mapSegments(Diagnostics&, dyld4::RuntimeState&, char const*, unsigned long long, dyld4::Loader::CodeSignatureInFile const&, bool, dyld3::Array<dyld4::Loader::Region> const&, bool, bool, dyld4::Loader::FileValidationInfo const&)","symbolLocation":1096,"imageIndex":0},{"imageOffset":86732,"symbol":"dyld4::Loader::mapSegments(Diagnostics&, dyld4::RuntimeState&, char const*, unsigned long long, dyld4::Loader::CodeSignatureInFile const&, bool, dyld3::Array<dyld4::Loader::Region> const&, bool, bool, dyld4::Loader::FileValidationInfo const&)","symbolLocation":1096,"imageIndex":0},{"imageOffset":109448,"symbol":"invocation function for block in dyld4::JustInTimeLoader::makeJustInTimeLoaderDisk(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, bool, unsigned int)","symbolLocation":68,"imageIndex":0},{"imageOffset":107816,"symbol":"dyld4::JustInTimeLoader::withRegions(dyld3::MachOAnalyzer const*, void (dyld3::Array<dyld4::Loader::Region> const&) block_pointer)","symbolLocation":292,"imageIndex":0},{"imageOffset":109276,"symbol":"invocation function for block in dyld4::JustInTimeLoader::makeJustInTimeLoaderDisk(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, bool, unsigned int)","symbolLocation":480,"imageIndex":0},{"imageOffset":130392,"symbol":"dyld4::SyscallDelegate::withReadOnlyMappedFile(Diagnostics&, char const*, bool, void (void const*, unsigned long, bool, dyld4::FileID const&, char const*) block_pointer) const","symbolLocation":132,"imageIndex":0},{"imageOffset":108744,"symbol":"dyld4::JustInTimeLoader::makeJustInTimeLoaderDisk(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, bool, unsigned int)","symbolLocation":204,"imageIndex":0},{"imageOffset":83664,"symbol":"invocation function for block in dyld4::Loader::getLoader(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&)","symbolLocation":1384,"imageIndex":0},{"imageOffset":84800,"symbol":"invocation function for block in dyld4::Loader::forEachResolvedAtPathVar(dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, dyld4::ProcessConfig::PathOverrides::Type, bool&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer)","symbolLocation":320,"imageIndex":0},{"imageOffset":8088,"symbol":"dyld3::MachOFile::forEachLoadCommand(Diagnostics&, void (load_command const*, bool&) block_pointer) const","symbolLocation":168,"imageIndex":0},{"imageOffset":259796,"symbol":"dyld3::MachOAnalyzer::forEachRPath(void (char const*, bool&) block_pointer) const","symbolLocation":128,"imageIndex":0},{"imageOffset":80760,"symbol":"dyld4::Loader::forEachResolvedAtPathVar(dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, dyld4::ProcessConfig::PathOverrides::Type, bool&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer)","symbolLocation":708,"imageIndex":0},{"imageOffset":79852,"symbol":"invocation function for block in dyld4::Loader::forEachPath(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer)","symbolLocation":148,"imageIndex":0},{"imageOffset":40676,"symbol":"dyld4::ProcessConfig::PathOverrides::forEachPathVariant(char const*, dyld3::Platform, bool, bool&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer) const","symbolLocation":672,"imageIndex":0},{"imageOffset":79680,"symbol":"dyld4::Loader::forEachPath(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer)","symbolLocation":172,"imageIndex":0},{"imageOffset":81760,"symbol":"dyld4::Loader::getLoader(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&)","symbolLocation":864,"imageIndex":0},{"imageOffset":101216,"symbol":"invocation function for block in dyld4::JustInTimeLoader::loadDependents(Diagnostics&, dyld4::RuntimeState&, dyld4::Loader::LoadOptions const&)","symbolLocation":380,"imageIndex":0},{"imageOffset":217700,"symbol":"invocation function for block in dyld3::MachOFile::forEachDependentDylib(void (char const*, bool, bool, bool, unsigned int, unsigned int, bool&) block_pointer) const","symbolLocation":148,"imageIndex":0},{"imageOffset":8088,"symbol":"dyld3::MachOFile::forEachLoadCommand(Diagnostics&, void (load_command const*, bool&) block_pointer) const","symbolLocation":168,"imageIndex":0},{"imageOffset":217260,"symbol":"dyld3::MachOFile::forEachDependentDylib(void (char const*, bool, bool, bool, unsigned int, unsigned int, bool&) block_pointer) const","symbolLocation":172,"imageIndex":0},{"imageOffset":100552,"symbol":"dyld4::JustInTimeLoader::loadDependents(Diagnostics&, dyld4::RuntimeState&, dyld4::Loader::LoadOptions const&)","symbolLocation":164,"imageIndex":0},{"imageOffset":21952,"symbol":"dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*)","symbolLocation":1092,"imageIndex":0},{"imageOffset":20588,"symbol":"start","symbolLocation":488,"imageIndex":0}]}],
  "usedImages" : [
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 4339286016,
    "size" : 393216,
    "uuid" : "d9c2a46e-8dc4-3950-9d6a-f799e8ccb683",
    "path" : "\/usr\/lib\/dyld",
    "name" : "dyld"
  },
  {
    "size" : 0,
    "source" : "A",
    "base" : 0,
    "uuid" : "00000000-0000-0000-0000-000000000000"
  }
],
  "sharedCache" : {
  "base" : 6821232640,
  "size" : 3136077824,
  "uuid" : "513553bb-5ca5-3b9e-a613-b0603ffe3038"
},
  "vmSummary" : "ReadOnly portion of Libraries: Total=688K resident=0K(0%) swapped_out_or_unallocated=688K(100%)\nWritable regions: Total=10.4M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=10.4M(100%)\n\n                                VIRTUAL   REGION \nREGION TYPE                        SIZE    COUNT (non-coalesced) \n===========                     =======  ======= \nSTACK GUARD                       56.0M        1 \nStack                             8176K        1 \nVM_ALLOCATE (reserved)            1408K        3         reserved VM address space (unallocated)\n__DATA                              32K        2 \n__DATA_CONST                       112K        2 \n__LINKEDIT                         240K        2 \n__TEXT                             448K        2 \ndyld private memory               1024K        1 \nmapped file                       28.0M       11 \n===========                     =======  ======= \nTOTAL                             95.2M       25 \nTOTAL, minus reserved VM space    93.8M       25 \n",
  "legacyInfo" : {
  "threadTriggered" : {

  }
},
  "trialInfo" : {
  "rollouts" : [
    {
      "rolloutId" : "60186475825c62000ccf5450",
      "factorPackIds" : {
        "SIRI_VALUE_INFERENCE_CONTACT_RESOLUTION" : "62bdc4218fe09c1632d841e9"
      },
      "deploymentId" : 240000023
    },
    {
      "rolloutId" : "61af99aeda72d16a4beb7756",
      "factorPackIds" : {

      },
      "deploymentId" : 240000277
    }
  ],
  "experiments" : [

  ]
}
}

Model: Macmini9,1, BootROM 7459.121.3, proc 8:4:4 processors, 8 GB, SMC 
Graphics: Apple M1, Apple M1, Built-In
Display: LG HDR 4K, 3840 x 2160 (2160p/4K UHD 1 - Ultra High Definition), Main, MirrorOff, Online
Memory Module: LPDDR4
AirPort: Wi-Fi, wl0: Mar 23 2022 19:57:59 version 18.60.27.0.7.8.129 FWID 01-570be953
Bluetooth: Version (null), 0 services, 0 devices, 0 incoming serial ports
Network Service: Wi-Fi, AirPort, en1
USB Device: USB31Bus
USB Device: USB31Bus
USB Device: Magic Keyboard with Numeric Keypad
USB Device: USB30Bus
Thunderbolt Bus: Mac mini, Apple Inc.
Thunderbolt Bus: Mac mini, Apple Inc.

@ageeye

you care to weigh in on this. i know you've been building app bundles with cmake on an m1?

@ipatch ipatch changed the title mac app bundling using cmake on m1 mac app bundling using cmake on m1 failure due to install_name_tool Jul 28, 2022
@ipatch
Copy link
Collaborator Author

ipatch commented Jul 29, 2022

it seems there is a similar take on how mac app bundling is done, but the below approach uses a shell script instead of python but seems the project is making a m1 app bundle that works with m1 based macs.

https://github.com/apfelkraut/darktable/blob/9b672a2ab28a083c73ec5855d97b545d935d1f50/packaging/macosx/3_make_hb_darktable_package.sh

@ipatch
Copy link
Collaborator Author

ipatch commented Jul 31, 2022

progress...

image

@ipatch
Copy link
Collaborator Author

ipatch commented Aug 1, 2022

@ageeye

you care to share cmake commands you're using to build a self contained mac app bundle for FreeCAD.app ?

@TristanDebrunner
Copy link

progress...

I'm running into the same problem. How did you get the app to open? Manually using codesign?

@ipatch
Copy link
Collaborator Author

ipatch commented Aug 3, 2022

progress...

I'm running into the same problem. How did you get the app to open? Manually using codesign?

by not updating the loader paths for the bins and libs, but thus renders the app no relocatable.

@TristanDebrunner
Copy link

ah. Is there a cmake option to skip that step?

@ipatch
Copy link
Collaborator Author

ipatch commented Aug 3, 2022

ah. Is there a cmake option to skip that step?

not that i'm aware of.

@MatthiasWM
Copy link

MatthiasWM commented Sep 16, 2022

Assuming that src/Tools/MakeMacBundleRelocatable.py runs all the way through (as of today, it does not), running

find FreeCAD.app/Contents/lib/ -exec codesign --force -s -  \{\} \;

will codesign all changed libraries after they have been relocated and their paths have been fixed. It is brute force, but at least for development on the local machine, it makes FreeCAD.app relocatable.

I patched src/Tools/MakeMacBundleRelocatable.py to find all the paths to Qt frameworks, but it's a horrible hack and maybe even linking the wrong libraries. But in any case, the resulting bundle runs and can be moved around.

--- a/src/Tools/MakeMacBundleRelocatable.py
+++ b/src/Tools/MakeMacBundleRelocatable.py
@@ -161,3 +162,8 @@ def create_dep_nodes(install_names, search_paths):
             if not path:
                 path = install_path
 
+        qt_path = []
+        qt_path.append("/opt/homebrew/Cellar/qt@5/5.15.5_2/lib/" + lib_name + ".framework")
+        if not path:
+            path = get_path(lib_name, qt_path)

Edit: I originally published the Qt5 link commented out, and a Qt6 link active, which was wrong.

@ipatch
Copy link
Collaborator Author

ipatch commented Sep 16, 2022

@MatthiasWM

+        qt_path = []
+        #qt_path.append("/opt/homebrew/Cellar/qt@5/5.15.5_2/lib/" + lib_name + ".framework")
+        qt_path.append("/opt/homebrew/Cellar/qt/6.3.1_3/lib/" + lib_name + ".framework")
+        if not path:
+            path = get_path(lib_name, qt_path)

you might want to doublecheck that. it looks like you commented out the path to qt@5 which freecad uses, and then you added the path to qt ie. qt@6 which freecad currently does not support.

@MatthiasWM
Copy link

you might want to doublecheck that. it looks like you commented out the path to qt@5 which freecad uses, and then you added the path to qt ie. qt@6 which freecad currently does not support.

Yes, you are right of course. I published the wrong patch. The Qt5 link is the correct one.

@ipatch ipatch added the useful issues that provide useful information label Mar 20, 2024
@ipatch ipatch self-assigned this Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted useful issues that provide useful information
Projects
None yet
Development

No branches or pull requests

3 participants