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

Release Installer size is larger than expected #159

Open
jcfr opened this issue Sep 26, 2020 · 2 comments
Open

Release Installer size is larger than expected #159

jcfr opened this issue Sep 26, 2020 · 2 comments
Assignees
Labels
Type: Bug Something isn't working

Comments

@jcfr
Copy link
Collaborator

jcfr commented Sep 26, 2020

Description

The size of the installer (843MB vs 215MB) is partially explained by the fact the MNI atlas is now shipped with the application. We noticed that the install rules were installing the complete download folders instead of selectively installing the relevant MNI files.

See https://github.com/BICCN/cell-locator/releases

Screenshots

image

image

@jcfr jcfr added the Status: Triage Issues/PRs that need to be triaged label Sep 26, 2020
@jcfr jcfr changed the title Installer size to larger than expected Release 0.1.0-2020-09-18 Installer size is larger than expected Sep 26, 2020
@jcfr jcfr added Type: Bug Something isn't working and removed Status: Triage Issues/PRs that need to be triaged labels May 26, 2021
@jcfr jcfr changed the title Release 0.1.0-2020-09-18 Installer size is larger than expected Release Installer size is larger than expected May 26, 2021
@jcfr
Copy link
Collaborator Author

jcfr commented Jun 2, 2021

the install rules for the data files are implemented here:

function(CellLocator_install_datafiles datafile)
install(
FILES ${datafile} ${ARGN}
DESTINATION "${Slicer_INSTALL_QTSCRIPTEDMODULES_LIB_DIR}/"
COMPONENT RuntimeLibraries
)
endfunction()

That said the problem is related to the install rule of the scripted modules.

Indeed, the content of the D:\D\P\CL-0-build\Slicer-build\E\Modules\Scripted\Home\cmake_install.cmake file generated is the following. Despite of selectively listing the data files, the parent folder is systematically copied.

[...]

if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xRuntimeLibrariesx" OR NOT CMAKE_INSTALL_COMPONENT)
  file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/./lib/CellLocator-4.13/qt-scripted-modules" TYPE DIRECTORY FILES "D:/D/P/CL-0-build/Slicer-build/lib/CellLocator-4.13/qt-scripted-modules/" USE_SOURCE_PERMISSIONS)
endif()

if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xRuntimeLibrariesx" OR NOT CMAKE_INSTALL_COMPONENT)
  file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/./lib/CellLocator-4.13/qt-scripted-modules" TYPE FILE FILES
    "D:/D/P/CL-0-build/Slicer-build/lib/CellLocator-4.13/qt-scripted-modules/CellLocatorData/ccf_average_template_25.nrrd"
    "D:/D/P/CL-0-build/Slicer-build/lib/CellLocator-4.13/qt-scripted-modules/CellLocatorData/ccf_annotation_25_contiguous.nrrd"
    "D:/D/P/CL-0-build/Slicer-build/lib/CellLocator-4.13/qt-scripted-modules/CellLocatorData/ccf_annotation_color_table.txt"
    "D:/D/P/CL-0-build/Slicer-build/lib/CellLocator-4.13/qt-scripted-modules/CellLocatorData/ccf_annotation_color_allen2slicer_mapping.json"
    "D:/D/P/CL-0-build/Slicer-build/lib/CellLocator-4.13/qt-scripted-modules/CellLocatorData/ccf_annotation_color_slicer2allen_mapping.json"
    "D:/D/P/CL-0-build/Slicer-build/lib/CellLocator-4.13/qt-scripted-modules/CellLocatorData/ccf-ontology-formatted.json"
    )
endif()

if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xRuntimeLibrariesx" OR NOT CMAKE_INSTALL_COMPONENT)
  file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/./lib/CellLocator-4.13/qt-scripted-modules" TYPE FILE FILES
    "D:/D/P/CL-0-build/Slicer-build/lib/CellLocator-4.13/qt-scripted-modules/CellLocatorData/mni_icbm152_t1_tal_nlin_sym_09b_hires.nii"
    "D:/D/P/CL-0-build/Slicer-build/lib/CellLocator-4.13/qt-scripted-modules/CellLocatorData/mni_annotation_contiguous.nrrd"
    "D:/D/P/CL-0-build/Slicer-build/lib/CellLocator-4.13/qt-scripted-modules/CellLocatorData/mni_annotation_color_table.txt"
    "D:/D/P/CL-0-build/Slicer-build/lib/CellLocator-4.13/qt-scripted-modules/CellLocatorData/mni_annotation_color_allen2slicer_mapping.json"
    "D:/D/P/CL-0-build/Slicer-build/lib/CellLocator-4.13/qt-scripted-modules/CellLocatorData/mni_annotation_color_slicer2allen_mapping.json"
    "D:/D/P/CL-0-build/Slicer-build/lib/CellLocator-4.13/qt-scripted-modules/CellLocatorData/mni-ontology-formatted.json"
    )
endif()

if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xRuntimeLibrariesx" OR NOT CMAKE_INSTALL_COMPONENT)
  file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/./lib/CellLocator-4.13/qt-scripted-modules" TYPE FILE FILES
    "D:/D/P/CL-0-build/Slicer-build/lib/CellLocator-4.13/qt-scripted-modules/CellLocatorData/ccf_annotation_layer_color_table.txt"
    "D:/D/P/CL-0-build/Slicer-build/lib/CellLocator-4.13/qt-scripted-modules/CellLocatorData/ccf-layer-ontology-formatted.json"
    )
endif()

@jcfr
Copy link
Collaborator Author

jcfr commented Jun 2, 2021

The macro responsible for installing the module is slicerMacroBuildScriptedModule:

slicerMacroBuildScriptedModule(
NAME ${MODULE_NAME}
SCRIPTS ${MODULE_PYTHON_SCRIPTS} ${MODULE_PYTHON_QRC_RESOURCES}
RESOURCES ${MODULE_PYTHON_RESOURCES}
WITH_GENERIC_TESTS
)

and looking at the implementation, we can observe that the directory is always installed:

https://github.com/KitwareMedical/Slicer/blob/7fde09a0168d0b2e6f2a12ad01a18ac2889da7a1/CMake/SlicerMacroBuildScriptedModule.cmake#L105-L106

Fixing ctkMacroCompilePythonScript used in slicerMacroBuildScriptedModule to explicitly install each files would be ideal.

But since this may be a more involved change, we could look into few approaches:

  • Check why the sub directory are installed ... this is seems to be a "bug" because we do not pass the WITH_SUBDIR to slicerMacroBuildScriptedModule

  • Update slicerMacroBuildScriptedModule to add a NO_INSTALL to fully skip the install of script and instead explicitly install relevant scripts.

References:

@jcfr jcfr assigned jcfr and unassigned allemangD Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants