Flatpak: runtime change

Hello everyone,

I have been maintaining the ROOT flatpak and I would like to change the runtime it uses. Currently it uses the Sdk which is heavier and less common. In this sense, it would be better not to use the SDK and instead use one that is shared with other applications on the system. My first approach has been to simply copy the contents of “/usr/include” to “/app/include” and set the environment variables so that root finds the includes. In this scenario it seems that the program runs well.
I have run the demo script (.demo) as a test and it ends well.

As a drawback, only the message appears:
ERROR in cling::CIFactory::createCI(): cannot extract standard library include paths!
Invoking:
LC_ALL=C x86_64-unknown-linux-gnu-g++ -xc++ -E -v /dev/null 2>&1 | sed -n -e ‘/^.include/,${’ -e ‘/^ /.*++/p’ -e ‘}’
Results was:
With exit code 0

My question is:
Does doing this alter or harm ROOT’s behavior in any way?

(this is a translation)

That’s the application telling you the runtime and build time environment aren’t in sync. This is equivalent to running a version of ROOT for the wrong distribution. It will probably work for trivial use cases, but not for actual work.

It’s true that most apps wouldn’t use the SDK as a runtime environment, but most Flatpaks are nothing like ROOT.

You absolutely need to ensure the build time environment is the runtime environment or the app will fall over in ways that cannot be worked around. For the snap, this involves shipping GCC, Python, PyPi packages, the C STDLIB, Fortran, graphics drivers. To get stuff like ACLIC+ working, I had to patch the ROOT build system into rewriting the hardcoded strings in the metadata, because even the paths used for the build environment differ from the runtime environment breaking more things.

Don’t let file size motivate you here. The ROOT snap started out about the same file size. It then increased to 10x the amount because “being small” wasn’t enough justification for being broken. It worked for a lot of use cases, people wanted more, their desires weren’t unreasonable but “one small thing” will pull in a dependency chain the size of Mount Everest if you get unlucky.

In summary, you really want to avoid relying on runtimes at all, unless you happened to control them, because all that will happen is other people will push updates to the runtimes that will work fine for every other Flatpak that exists but breaks yours for using it in a way most others don’t, and these will be downloaded by your users automatically and the experience for some of them will be it randomly breaks with no clear cause as to why.

This is why I don’t use the Gnome/KDE extensions in the Snap, because they cannot provide the guarantees ROOT needs, even though they’re fit for purpose in general desktop usage.

Thanks for clarifying it for me. Then I will continue using the Sdk.

As I mentioned, to verify that ROOT is working correctly I run some programs; Is there any test implemented in ROOT to verify its operation and integrity?

ROOT does have a test infrastructure, but I think from your perspective you’d want to focus on things beyond that primarily, and more on the system integration and reliability side of things.

With the snap, I’ve always advertised it as a sort of ROOT-Lite. A good package for the physics university student going into higher-education, it gets you (most) things needed to get going. And it’s also true that there’s a fair bit of use beyond that in actual production workloads, but it’s not those I target because production workloads are very well covered by everyone else, whereas new users aren’t to the same extent.

The reason I bring that up is because it’s impossible to please everyone. Whether over lesser things like file size (as I say, the snap started out 150MB and is now closer to 1.3GB, that happened over about 2-3 months), the libraries you bundle (the snap forces its own versions of packages, and the UX is hostile to “sideloading”, to the point some would find it easier to just rebuild their own), or the features embedded (I can’t get tkinter in Python working without breaking ACLiC, and had to make the choice which I’d prefer, it was ACLiC, you can still use TKInter in Jupyter, but you won’t get ACLiC at all if I broke that).

Specifically then I’d encourage you to consider:

  1. Desktop entries to the main CLI (root) itself
  2. Are all the various root commands supported and exposed? E.G hadd is a good example, I know from other Flatpaks that systems don’t tend to add the flatpak bin directory to $PATH. Do your users have instructions recommending they should, to avoid needing e.g flatpak run cern.root.hadd.
  3. Importantly, I’d simulate a few updates on your own workstation, and make sure that things like filepaths don’t come into play, does ROOT keep working reliably on upgrades? To what extent?

For ACLIC in the snap for example, you get about 2 years of stability before I upgrade the runtime environment to break ABI compatibility. That doesn’t effect 99% of users, but it means there’s a specific point where I know I am breaking people with no ability to do anything about that. It’s important that they know that so they can react appropriately if needs be. (Though in the student use case, that’s basically just rerun the compiler, it’s not a big ask, but it can be a surprising ask).

And ultimately, being a Flatpak, people are going to expect that it works cross distribution. Have you tested a wide variety of distributions? With the snap 90% of users use Ubuntu, which fits with my target audience. But there are 10% who would use Fedora, CentOS, RHEL, etc, where it happens to work too.

With Flatpak, I’d imagine you’d have a much much more varied demographic to cover, so it’d be worth actively trialing a few of them to see if the expectations hold up.

In summary, there are tests yes, and you should look into using them. But if you know in advance that you’ll never hit 100% compatibility because it’s impossible even at a technical level, then my advice would be to actually set a specific goal and work towards that.

I tell people regularly to not use my own package, there’s no shame in that. It’s good at what it focuses on, and less good where it doesn’t, that’s not an attack on myself or the technology behind it, just a truth that has to be acknowledged. Ultimately, it’s had somewhere around 30,000-50,000 unique users over its lifetime; I can see people install when University starts and uninstall when University ends. And if they then move onto a different ROOT package more suited for them after that point, well I’ve done my job.

I hadn’t thought about runtime updates and I probably can’t do anything if the package breaks as a result of a runtime update, other than recompile.
As for the target audience, when I created the package I did it for myself because sometimes some versions offered by the page broke on my system. I don’t need too much, just the terminal and that’s why I care about the size. My goal is not so altruistic.
On the other hand, the fact that the flatpak is built on top of the SDK allows for good integration with pip and the ability to install software from there.

I didn’t know about Hadd, I’ll investigate it, see if it makes things easier for me.
Thanks for your help and points of view.

(this is a translation)