# Nightly build TESTS failing for extensions with dependencies to other scriptable modules

**URL:** <https://discourse.slicer.org/t/nightly-build-tests-failing-for-extensions-with-dependencies-to-other-scriptable-modules/1483>\
**Category:** Development\
**Created:** [November 17, 2017, 7:45pm UTC](https://discourse.slicer.org/t/nightly-build-tests-failing-for-extensions-with-dependencies-to-other-scriptable-modules/1483 "2017-11-17T19:45:16Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [November 22, 2017, 8:55pm UTC](https://discourse.slicer.org/t/nightly-build-tests-failing-for-extensions-with-dependencies-to-other-scriptable-modules/1483/41 "2017-11-22T20:55:59Z")

</div>

> [@fedorov](#):
>
> developers cannot have python modules that are independent from Slicer

By “module” I mean Slicer scripted module. You can use any Python packages that are independent from Slicer, in any way you want. You just have to place them in a subdirectory of any Slicer module directory so that Python can find it.

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [November 22, 2017, 9:07pm UTC](https://discourse.slicer.org/t/nightly-build-tests-failing-for-extensions-with-dependencies-to-other-scriptable-modules/1483/42 "2017-11-22T21:07:27Z")

</div>

I think in the case of @che85, the issue comes from the dependency on a Slicer extension, SlicerDevelopmentToolbox, that contains a set of python packages to reuse from multiple Slicer modules, and it is not loaded when it is needed. It sounds like we would need to add “fake” widget/logic to the classes from that extension to make it loaded in order. Christian, please correct me if I am wrong.

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [November 22, 2017, 9:11pm UTC](https://discourse.slicer.org/t/nightly-build-tests-failing-for-extensions-with-dependencies-to-other-scriptable-modules/1483/43 "2017-11-22T21:11:07Z")

</div>

It doesn’t need to be an actual module, the only thing that needs to be ensured is that the python files are deployed to the proper location, which is recognized by the extension. An example can be DICOMLib or Modules/Loadable/Segmentations/EditorEffects/Python.

If the files are deployed to the right place, the dependencies need to be added (at least this is how I managed to get it to work). See the git commits I referenced [above](https://discourse.slicer.org/t/nightly-build-tests-failing-for-extensions-with-dependencies-to-other-scriptable-modules/1483/38?u=cpinter).

---

<div class="post-metadata">

**Author:** ![che85](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/che85/32/636_2.png) [@che85](https://discourse.slicer.org/u/che85)\
**Post date:** [November 22, 2017, 10:34pm UTC](https://discourse.slicer.org/t/nightly-build-tests-failing-for-extensions-with-dependencies-to-other-scriptable-modules/1483/44 "2017-11-22T22:34:13Z")

</div>

@cpinter It would be great if that works. In my opinion Slicer should set those in a generic manner instead of having those attributes set within the extensions CMakeLists. I think otherwise it would be very error prone and a lot of overhead.

No idea if that can be done in Slicer itself.

---

<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:** [November 22, 2017, 11:36pm UTC](https://discourse.slicer.org/t/nightly-build-tests-failing-for-extensions-with-dependencies-to-other-scriptable-modules/1483/45 "2017-11-22T23:36:15Z")

</div>

Hi,

You can build the project Slicer/extensions/Cmake.

Look for “build extensionindex” on the devel FAQ.

Hth  
Jc

---

<div class="post-metadata">

**Author:** ![che85](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/che85/32/636_2.png) [@che85](https://discourse.slicer.org/u/che85)\
**Post date:** [November 22, 2017, 11:54pm UTC](https://discourse.slicer.org/t/nightly-build-tests-failing-for-extensions-with-dependencies-to-other-scriptable-modules/1483/46 "2017-11-22T23:54:10Z")

</div>

@jcfr That’s what I did and those are the results: [http://slicer.cdash.org/testDetails.php?test=8443330&build=11357232](http://slicer.cdash.org/testDetails.php?test=8443330&build=11357232)

---

<div class="post-metadata">

**Author:** ![ihnorton](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ihnorton/32/9_2.png) [@ihnorton](https://discourse.slicer.org/u/ihnorton)\
**Post date:** [November 23, 2017, 2:11am UTC](https://discourse.slicer.org/t/nightly-build-tests-failing-for-extensions-with-dependencies-to-other-scriptable-modules/1483/47 "2017-11-23T02:11:11Z")

</div>

> [@lassoan](#):
>
> seems to be due to the limit on total size of all the load commands in the dynamic library in the MacOS loader.

@che85 you can confirm this with `otool -l LIBRARYNAME`.

There is a [hack](https://github.com/NixOS/nixpkgs/pull/27536) we could use, essentially to daisy-chain dependencies, but at that level of effort we’re better off reducing the number of shared libraries.

(last time I looked at the slow startup issue on macOS – especially debug build – I think there were over 600 shared libraries loaded, and majority of them were ours. IIRC there were something like 30 million `strcmp`s during startup while sorting symbols).

---

<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:** [November 23, 2017, 2:32am UTC](https://discourse.slicer.org/t/nightly-build-tests-failing-for-extensions-with-dependencies-to-other-scriptable-modules/1483/48 "2017-11-23T02:32:33Z")

</div>

FWIW, a patch is being integrated into VTK to get ride of the PythonD  
library and remove the number of libraries.

We could backport it.

Jc

---

<div class="post-metadata">

**Author:** ![che85](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/che85/32/636_2.png) [@che85](https://discourse.slicer.org/u/che85)\
**Post date:** [November 23, 2017, 4:24am UTC](https://discourse.slicer.org/t/nightly-build-tests-failing-for-extensions-with-dependencies-to-other-scriptable-modules/1483/49 "2017-11-23T04:24:37Z")

</div>

@ihnorton Here is the output of otool

> <https://gist.github.com/che85/5f767b593cfce938a475fa813830e83f>

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [November 23, 2017, 1:32pm UTC](https://discourse.slicer.org/t/nightly-build-tests-failing-for-extensions-with-dependencies-to-other-scriptable-modules/1483/50 "2017-11-23T13:32:31Z")

</div>

Update: Those path additions that enabled the tests to run locally didn’t do the trick on the factory.  
[http://slicer.cdash.org/testDetails.php?test=8445508&build=1136268](http://slicer.cdash.org/testDetails.php?test=8445508&build=1136268)  
The only reason I can see is that the \*\_DIR paths are not correct. I’ll check on our factory machine.

---

<div class="post-metadata">

**Author:** ![che85](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/che85/32/636_2.png) [@che85](https://discourse.slicer.org/u/che85)\
**Post date:** [January 19, 2018, 9:37pm UTC](https://discourse.slicer.org/t/nightly-build-tests-failing-for-extensions-with-dependencies-to-other-scriptable-modules/1483/51 "2018-01-19T21:37:40Z")

</div>

Hi guys,

are there any updates/ideas for solving this issue?

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [January 19, 2018, 9:50pm UTC](https://discourse.slicer.org/t/nightly-build-tests-failing-for-extensions-with-dependencies-to-other-scriptable-modules/1483/52 "2018-01-19T21:50:29Z")

</div>

Considering the switch to Qt5 and other dramatic changes in the core, it is unfortunate that we don’t have a reliable way to test extensions to identify regressions associated with that process.

---

<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:** [January 19, 2018, 10:04pm UTC](https://discourse.slicer.org/t/nightly-build-tests-failing-for-extensions-with-dependencies-to-other-scriptable-modules/1483/53 "2018-01-19T22:04:52Z")

</div>

> [@fedorov](#):
>
> unfortunate that we don’t have a reliable way to test extensions to identify regressions associated with that process

To clarify, extensions are still build and tested nightly. It means you will be able to look at the build report every day.

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [January 19, 2018, 10:40pm UTC](https://discourse.slicer.org/t/nightly-build-tests-failing-for-extensions-with-dependencies-to-other-scriptable-modules/1483/54 "2018-01-19T22:40:31Z")

</div>

> [@jcfr](#):
>
> To clarify, extensions are still build and tested nightly. It means you will be able to look at the build report every day.

@jcfr not sure I understand. My understanding was that the issue is “Nightly build TESTS failing for extensions with dependencies to other scriptable modules”, which means we have false alarms instead of actually checking for regressions in the code. Am I missing something?

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [January 20, 2018, 4:10am UTC](https://discourse.slicer.org/t/nightly-build-tests-failing-for-extensions-with-dependencies-to-other-scriptable-modules/1483/55 "2018-01-20T04:10:29Z")

</div>

@che85 is there a bug report that documents the problem? If not, can you submit one?

---

<div class="post-metadata">

**Author:** ![che85](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/che85/32/636_2.png) [@che85](https://discourse.slicer.org/u/che85)\
**Post date:** [January 22, 2018, 4:18pm UTC](https://discourse.slicer.org/t/nightly-build-tests-failing-for-extensions-with-dependencies-to-other-scriptable-modules/1483/56 "2018-01-22T16:18:00Z")

</div>

I created a bug report for this issue. See [https://issues.slicer.org/view.php?id=4498](https://issues.slicer.org/view.php?id=4498)

---

<div class="post-metadata">

**Author:** ![che85](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/che85/32/636_2.png) [@che85](https://discourse.slicer.org/u/che85)\
**Post date:** [February 5, 2018, 7:00am UTC](https://discourse.slicer.org/t/nightly-build-tests-failing-for-extensions-with-dependencies-to-other-scriptable-modules/1483/57 "2018-02-05T07:00:43Z")

</div>

Seems like the tests are running now. I added the following lines to CMakeLists.txt

> <https://github.com/QIICR/QuantitativeReporting/blob/450ac0437ef77172349d72b347af2a854d5f4ce3/CMakeLists.txt#L21-L38>

and

> <https://github.com/QIICR/QuantitativeReporting/blob/450ac0437ef77172349d72b347af2a854d5f4ce3/Testing/CMakeLists.txt#L1-L6>

[http://slicer.cdash.org/testDetails.php?test=8625898&build=1194275](http://slicer.cdash.org/testDetails.php?test=8625898&build=1194275)

The `find_package` commands are commented out because they caused CMake configure errors, which in my opinion is giving misleading information to the developer:

[http://slicer.cdash.org/viewConfigure.php?buildid=1193166](http://slicer.cdash.org/viewConfigure.php?buildid=1193166)

For any reason when using those find\_package commands, DCMQI is not found. @jcfr I feel like the following warnings are always displayed. Is that correct?

```auto
CMake Warning at /home/kitware/Dashboards/Nightly/Slicer-0/Extensions/CMake/SlicerBlockAdditionalLauncherSettings.cmake:48 (message):
  Dependent extension PETDICOMExtension cannot be found by CMake
  find_package(), therefore paths variables cannot be imported from this
  extension. The problem can be resolved by generating
  PETDICOMExtensionConfig.cmake by adding
  include(${Slicer_EXTENSION_GENERATE_CONFIG}) to the top-level
  CMakeLists.txt of the dependent exension.

```

---

<div class="post-metadata">

**Author:** ![che85](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/che85/32/636_2.png) [@che85](https://discourse.slicer.org/u/che85)\
**Post date:** [February 5, 2018, 4:06pm UTC](https://discourse.slicer.org/t/nightly-build-tests-failing-for-extensions-with-dependencies-to-other-scriptable-modules/1483/58 "2018-02-05T16:06:15Z")

</div>

Looking at the command line of [1] I am also wondering, why `${SlicerDevelopmentToolbox_DIR}` could be resolved to `/Users/kitware/Dashboards/Nightly/S-481-E-b/SlicerDevelopmentToolbox-build/`, but neither`${PETDICOMExtension_DIR}` could be resolved --\> `PETDICOMExtension_DIR-NOTFOUND` nor `${DCMQI_DIR}` could be resolved --\> `DCMQI_DIR-NOTFOUND`.

I will run some more tests.

[1] [http://slicer.cdash.org/testDetails.php?test=8625898&build=1194275](http://slicer.cdash.org/testDetails.php?test=8625898&build=1194275)

---

<div class="post-metadata">

**Author:** ![che85](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/che85/32/636_2.png) [@che85](https://discourse.slicer.org/u/che85)\
**Post date:** [February 5, 2018, 4:21pm UTC](https://discourse.slicer.org/t/nightly-build-tests-failing-for-extensions-with-dependencies-to-other-scriptable-modules/1483/59 "2018-02-05T16:21:41Z")

</div>

@jcfr @lassoan Can you explain why those messages still appear even though I included the mentioned files for every single project and built each one on its own? Am I missing something? Configuring only works, if I specify the directories manually.

```auto
CMake Warning at /Users/christian/sources/cpp/Slicer/Extensions/CMake/SlicerBlockAdditionalLauncherSettings.cmake:48 (message):
  Dependent extension SlicerDevelopmentToolbox cannot be found by CMake
  find_package(), therefore paths variables cannot be imported from this
  extension. The problem can be resolved by generating
  SlicerDevelopmentToolboxConfig.cmake by adding
  include(${Slicer_EXTENSION_GENERATE_CONFIG}) to the top-level
  CMakeLists.txt of the dependent exension.
Call Stack (most recent call first):
  /Users/christian/D/S4R/Slicer-build/UseSlicer.cmake:281 (include)
  CMakeLists.txt:19 (include)

CMake Warning at /Users/christian/sources/cpp/Slicer/Extensions/CMake/SlicerBlockAdditionalLauncherSettings.cmake:48 (message):
  Dependent extension DCMQI cannot be found by CMake find_package(),
  therefore paths variables cannot be imported from this extension. The
  problem can be resolved by generating DCMQIConfig.cmake by adding
  include(${Slicer_EXTENSION_GENERATE_CONFIG}) to the top-level
  CMakeLists.txt of the dependent exension.
Call Stack (most recent call first):
  /Users/christian/D/S4R/Slicer-build/UseSlicer.cmake:281 (include)
  CMakeLists.txt:19 (include)

CMake Warning at /Users/christian/sources/cpp/Slicer/Extensions/CMake/SlicerBlockAdditionalLauncherSettings.cmake:48 (message):
  Dependent extension PETDICOMExtension cannot be found by CMake
  find_package(), therefore paths variables cannot be imported from this
  extension. The problem can be resolved by generating
  PETDICOMExtensionConfig.cmake by adding
  include(${Slicer_EXTENSION_GENERATE_CONFIG}) to the top-level
  CMakeLists.txt of the dependent exension.
Call Stack (most recent call first):
  /Users/christian/D/S4R/Slicer-build/UseSlicer.cmake:281 (include)
  CMakeLists.txt:19 (include)

```

---

<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:** [February 7, 2018, 7:02am UTC](https://discourse.slicer.org/t/nightly-build-tests-failing-for-extensions-with-dependencies-to-other-scriptable-modules/1483/60 "2018-02-07T07:02:38Z")

</div>

To summarize, this last issue was due to missing dependencies and missing config files generation in the extensions. The following commits address the problem: [Slicer/ExtensionsIndex@34a0896](https://github.com/Slicer/ExtensionsIndex/commit/34a08966493d756e344a0a42471ebcb9ef8f2e7f) and [Slicer/ExtensionsIndex@3bdb20a](https://github.com/Slicer/ExtensionsIndex/commit/3bdb20a7df2c931ecde9f50b682df34c3dbe127c)

[Previous page](https://discourse.slicer.org/t/nightly-build-tests-failing-for-extensions-with-dependencies-to-other-scriptable-modules/1483.md?page=2)

[Next page](https://discourse.slicer.org/t/nightly-build-tests-failing-for-extensions-with-dependencies-to-other-scriptable-modules/1483.md?page=4)
