omniosorg / pkg5

Image Packaging System
https://omnios.org/
Other
11 stars 55 forks source link

Support resolving cross dependencies #473

Closed citrus-it closed 7 months ago

citrus-it commented 7 months ago

Now that python 3.12 has been fixed so that it properly detects the host triple, shared objects include this triple in the filename. This means that the filename search list for a module called foo is now:

        pkg.debug.depend.file=64/foo.abi3.so
        pkg.debug.depend.file=64/foo.cpython-312-x86_64-pc-solaris2.so
        pkg.debug.depend.file=64/foo.so
        pkg.debug.depend.file=foo.abi3.so
        pkg.debug.depend.file=foo.cpython-312-x86_64-pc-solaris2.so
        pkg.debug.depend.file=foo.py
        pkg.debug.depend.file=foo.pyc
        pkg.debug.depend.file=foo.pyo
        pkg.debug.depend.file=foo.so
        pkg.debug.depend.file=foo/__init__.py

This obviously doesn't work for aarch64, and we were effectively getting away with it before because the shared objects were just named foo.cpython-312.so. With this patch, if the environment contains

        PKG_CROSS_DEPEND=aarch64-unknown-solaris2

the search list is:

        pkg.debug.depend.file=foo.abi3.so
        pkg.debug.depend.file=foo.cpython-312-aarch64-unknown-solaris2.so
        pkg.debug.depend.file=foo.py
        pkg.debug.depend.file=foo.pyc
        pkg.debug.depend.file=foo.pyo
        pkg.debug.depend.file=foo.so
        pkg.debug.depend.file=foo/__init__.py

Note also that the 64/ paths have been removed for cross targets.