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

ENH: RFC bundle fixup script in python #889

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ihnorton
Copy link
Member

@ihnorton ihnorton commented Feb 5, 2018

See commit message for more detailed information. The goal here is to make the packaging system easier to use and debug. Using python allows for shorter code, and makes the fixup step much faster: the total packaging time is reduced to ~3 min as compared to ~1 hr (make package in an up-to-date build tree). The script can also be debugged with pdb. Hopefully this makes other build system improvements easier to test and iterate, because the turn-around to test changes will be shorter.

@ihnorton
Copy link
Member Author

ihnorton commented Feb 5, 2018

Note, not ready to merge. To do:

  • Extension support
  • Windows support
  • Linux support
  • Exclude Qt headers? (IIUC the current packager excludes them, but that may be done by the qt-easy-build?)

Add a new BundleFixup.py script to replace the CMakeScript
"fixup_bundle" routine. Advantages are:

  - speed: `make package` runs in ~3 min as compared to ~1 hr
  - debuggability: can be debugged in-place with standard pdb
    (note: For debugging, it is very helpful to create a git
           image of the package directory after the install step.
           Then the script can be run/re-run stand-alone, and
           reset without deleting or re-running other CMake steps)

There are two steps to the process:

  - find all dependencies. For this, we start from the `libs`
    passed by SlicerCPackBundleFixup (generated based on configured
    libraries). We look at all dependencies, and based on various
    criteria, may copy the dependency into the bundle. Similar to
    existing script, and uses modified versions of the existing regex
    filters to map source_lib -> target_dir in the bundle.

  - fixup step: this is a change from the existing script. We look
    at *all* Mach-O files in the potential bundle, and correct dylib
    references based on *which files are actually in the bundle*.
    System library or allow-listed references are ignored (currently
    only pqsql and mysql re allow-listed -- they are needed by the
    optional qt database drivers).

      - implicit verification -- bundling will fail if the dependency
        is not found or allow-listed.

      - we remove all absolute RPATH references. This should allow to
        run tests from the bundle itself on the factory, as a
        separate verification step (we can't check dlopen calls, but
        assuming we only `dlopen` checked dylibs from inside the
        bundle...).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 participants