# New extensions can not work on Slicer 5.4.0 on MacOS

**URL:** https://discourse.slicer.org/t/new-extensions-can-not-work-on-slicer-5-4-0-on-macos/31535
**Category:** Support
**Created:** [September 4, 2023, 6:01am UTC](https://discourse.slicer.org/t/new-extensions-can-not-work-on-slicer-5-4-0-on-macos/31535 "2023-09-04T06:01:18Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)
#### Post date: [September 12, 2023, 10:09pm UTC](https://discourse.slicer.org/t/new-extensions-can-not-work-on-slicer-5-4-0-on-macos/31535/4 "2023-09-12T22:09:09Z")

</div>

To follow up on this issue as well as the one discussed in [Fiducial Registration Wizard Module not loading - #5 by Jayme\_Goodrum](https://discourse.slicer.org/t/fiducial-registration-wizard-module-not-loading/31513/5), the root cause of the problem has been identified and fixed.

The patch locally integrated in the build machine source tree was not the one effectively tested and contributed through [PR-7181](https://github.com/Slicer/Slicer/pull/7181) in `main`, and [PR-7182](https://github.com/Slicer/Slicer/pull/7182) in `5.4` maintenance branch.

This has now been addressed ✅

Valid stable extensions are expected to be uploaded in the next 12 hours 🚀

Thanks for your patience 🙏

### Details

It was an hard-coded version expected to work only for the _Preview_ source tree and not the _Stable_ source tree.

```diff
diff --git a/CMake/SlicerExtensionCPack.cmake b/CMake/SlicerExtensionCPack.cmake
index 842abbb6ff..b65b312d5a 100644
--- a/CMake/SlicerExtensionCPack.cmake
+++ b/CMake/SlicerExtensionCPack.cmake
@@ -193,6 +193,7 @@ if(APPLE)
   set(EXTENSION_BINARY_DIR ${EXTENSION_SUPERBUILD_BINARY_DIR}/${EXTENSION_BUILD_SUBDIRECTORY})
   set(EXTENSION_SUPERBUILD_DIR ${EXTENSION_SUPERBUILD_BINARY_DIR})
   get_filename_component(Slicer_SUPERBUILD_DIR ${Slicer_DIR}/.. ABSOLUTE)
+ set(Slicer_SUPERBUILD_DIR "/Users/svc-dashboard/D/P/A")
 
   #------------------------------------------------------------------------------
   # <ExtensionName>_FIXUP_BUNDLE_LIBRARY_DIRECTORIES

```

instead the following patch was added:

```diff
diff --git a/CMake/SlicerExtensionCPack.cmake b/CMake/SlicerExtensionCPack.cmake
index 842abbb6ff..6adec7bcac 100644
--- a/CMake/SlicerExtensionCPack.cmake
+++ b/CMake/SlicerExtensionCPack.cmake
@@ -194,6 +194,14 @@ if(APPLE)
   set(EXTENSION_SUPERBUILD_DIR ${EXTENSION_SUPERBUILD_BINARY_DIR})
   get_filename_component(Slicer_SUPERBUILD_DIR ${Slicer_DIR}/.. ABSOLUTE)
 
+ # If any, resolve synthetic firmlink (e.g from "/D/P/A" to "/Users/svc-dashboard/D/P/A")
+ #
+ # Since the output of "otool -L" reports paths with synthetic firmlinks resolved
+ # (see GetPrerequisitesWithRPath), we are using REAL_PATH below to also resolve
+ # Slicer_SUPERBUILD_DIR and ensure that the test in "SlicerExtensionCPackBundleFixup.cmake.in"
+ # checking if "${key}_ITEM" is a library built in Slicer itself work as expected.
+ file(REAL_PATH ${Slicer_SUPERBUILD_DIR} Slicer_SUPERBUILD_DIR)
+
   #------------------------------------------------------------------------------
   # <ExtensionName>_FIXUP_BUNDLE_LIBRARY_DIRECTORIES
   #------------------------------------------------------------------------------

```

---

_[View the full topic](https://discourse.slicer.org/t/new-extensions-can-not-work-on-slicer-5-4-0-on-macos/31535)._
