In other words, let’s say I have 2 or more apps installed, which utilize the same shared module. Are they going to share the same compiled library from the shared module between them, or does the compiled library still live in each app prefix / installation directory separately (same as if its build instructions are added regularly via the app manifest)?
I’m asking because the documentation isn’t very clear about how exactly are they shared between apps.
Long answer: Flatpak uses internally a system called OSTree. Each file is store once in the local OSTree repository, referenced by its hash. From these files, Flatpak constructs the file tree for each app using hard links. This means that if one file is used by more than one app, only one copy is stored on the system and used by all apps.
The shared modules ensure that all applications which use a certain module build the exact same version of said module. Since each app uses an identical version of the module, its files are deduplicated using OSTree.
Thanks for the answer. I knew OStree does deduplication for runtimes, but didn’t know it does it for apps as well.
Do you know if it’s possible to automatically update shared modules and avoid doing a “git submodule update” every time there’s a new version? There’s a lot of conflicting information about it, but I heard it should be possible by using x-checker-data.
If so, then would this be the correct way to add x-checker-data to a submodule?
No x-checker will not work on shared-modules. You can configure dependabot to update gitmodules in your repo, but note that most of the shared modules are EOL software and rarely receive updates.
If you are configuring dependabot make sure to have it on a reasonable schedule like once/twice a week.