Unfortunately, I have had no luck installing/running developer tool chains with flatpak. Being new to flatpak, I assume I’m missing some fundamental step but I don’t know what it is.
This is on the Endless Mini (ARMv7), OS version 3.1.8, though that should not make a difference here.
This should install both the org.freedesktop.Platform and org.freedesktop.Sdk (as dependencies) along with the Gnome Platform/SDK on top of that. I do see the download the install complete and I’m returned to the command line, so I assume all is well. But now…
$ flatpak list
Nothing. I see no installed packages. So now I try to open a session into a sandbox:
$ flatpak run --command=bash -d --filesystem=home org.gnome.Sdk
error: app/org.gnome.Sdk/arm/master not installed
Well, I’m not surprised since I could not see anything installed after listing the flatpaks.
After some experimenting I seem to have stumbled upon a way to list installed runtimes:
flatpak run is the right thing but I believe it searches in the app/ namespace rather than runtime/ namespace unless you provide the full ref to the runtime you want.
Try like this:
ramcq@upsilon:~$ flatpak list --runtime -d
...
org.gnome.Sdk/x86_64/3.24 gnome f8ac436bb208 - 1.5 GB system
ramcq@upsilon:~$ flatpak run --filesystem=home --command=bash org.gnome.Sdk
error: app/org.gnome.Sdk/x86_64/master not installed
ramcq@upsilon:~$ flatpak run --filesystem=home --command=bash org.gnome.Sdk/x86_64/3.24
ramcq@upsilon:~$ # woop
ramcq@upsilon:~$ exit
exit
ramcq@upsilon:~$
One issue I ran into is that once I’m inside a sandbox I only have access to the tools in /bin/apps and /usr/bin and those don’t always overlap with the tools I had access to outside.
So for example, I can use gcc from inside the sandbox but I can’t now get at vi (so can’t edit files). I have to either exit the sandbox or open a terminal outside to edit files. That’s really inconvenient and I can’t believe there is not a simpler way to accomplish this.
Thanks for the suggestion but that doesn’t work unfortunately. Its pretty awkward to have to edit files in one terminal and compile in another. I cannot access both gcc and vi in the same session using the org.freedesktop runtime.
Use an SDK/editor which is already “Flatpak’d” or even one that supports Flatpak already. For example GNOME Builder is available on Endless from the gnome-apps repository which we enable by default. It actually uses a “host portal” to escape the Flatpak sandbox for compilation/debugging/etc purposes, and also natively supports building/running your projects under other Flatpak SDKs. It’s definitely going to be closest to giving you a well-polished “native” Flatpak developer experience, if you’re happy to use it as your development environment.
Build the app(s)/editors/etc you want as Flatpaks by writing .json files to feed to flatpak-builder. Then you can run that editor app inside a sandbox based on the GNOME SDK, and do all of your editing/building inside that sandbox.
Write a wrapper script that you put into your path (eg /usr/local/bin) which is symlinked to a number of different names (eg gcc, make, etc) and simply invokes the tool via flatpak:
Your proposed solution using symlinks is pretty clever and is probably the most flexible so long as the tools you want are already flatpak’ed.
As for GNOME Builder, I have the Endless Mini and did not see this in the App Center. I assumed it was because Builder is not supported on ARM. If this is not the case, can you tell me how I can access Builder?