C++ Logo

sg15

Advanced search

Re: P2717R1, EcoIS Introspection

From: René Ferdinand Rivera Morell <grafikrobot_at_[hidden]>
Date: Thu, 15 Jun 2023 15:51:30 -0500
On Thu, Jun 15, 2023 at 3:16 PM Stephen Kelly <steveire_at_[hidden]> wrote:
>
>
> I have seen the suggestion of a command line option, and the option of a file next to the tool, but I haven't seen a suggestion of what Qt does for the last 11 years for plugin loading, which has many of the same challenges with cross-compiling etc. That is - embed the metadata into the binary itself and read the data from a readonly section of the binary:
>
> $ objcopy /usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqtiff.so /dev/null --dump-section .qtmetadata=/dev/stdout
> QTMETADATA !�x1org.qt-project.Qt.QImageIOHandlerFactoryInterfacekQTiffPlugin�dKeys�dtiffctifiMimeTypes�jimage/tiffjimage/tiff
>
>
> I think in Qt 6 it works the same way, but the plugins have cbor data encoded in them. This allows Qt to know whether a plugin can load .jpg or .png etc.
>
> https://lists.qt-project.org/pipermail/development/2012-February/001827.html
>
> You could try to pursue something similar, but it would assume/require a way to read data sections from a binary.

That's an interesting approach. Does that mean you would need
different methods to get the data based on the environment? And how do
those methods work if the binary is for another environment?

Something else that a friend brought up is that the introspection
information may depend on environment information that is only
available at install time. I.e. that it can't be fixed data.


-- 
-- René Ferdinand Rivera Morell
-- Don't Assume Anything  -- No Supone Nada
-- Robot Dreams - http://robot-dreams.net

Received on 2023-06-15 20:51:45