Vala moves from the base org.gnome.Sdk to a separate Sdk Extension

Hi all!

With GNOME 45 version of the Flatpak Runtime we are planning to move the valac compiler from being included with the runtime to a separate Sdk.Extension. This way the vala team can provide a better experience and bundle extra tools needed for development of applications, such as the Vala language server without being constrained by the stability guarantees of the Stable runtime.

An extension for using the version stable of the Vala compiler has existed for a while in flathub, org.freedesktop.Sdk.Extension.vala but we have also started publishing a Nightly version of the extension straight from the Vala repo, in the GNOME Nightly Flatpak remote.

GNOME core applications must to use the vala-nightly extension to match GNOME OS builds. Third party applications should use the stable org.freedesktop.Sdk.Extension.vala from Flathub, unless they explicitly want to depend on the Nightly compiler.

What do I need to do:

If your application needs valac you will have to add the following to your manifest for GNOME 45 and onward:

"sdk-extensions" : [
    "org.freedesktop.Sdk.Extension.vala"
]
...
"build-options" : {
    "prepend-path" : "/usr/lib/sdk/vala/bin/",
    "prepend-ld-library-path" : "/usr/lib/sdk/vala/lib"
}

To use the Nightly version install org.freedesktop.Sdk.Extension.vala-nightlyand use /usr/lib/sdk/vala-nightly paths instead.

If you need to install libgee or any other autotools vala dependency, you should add something like this:

        {
            "name" : "libgee",
            "buildsystem" : "autotools",
            "build-options" : {
                "env" : {
                    "ACLOCAL_PATH" : "/usr/lib/sdk/vala-nightly/share/aclocal"
                }
            },
            "sources" : [
                {
                    "type" : "git",
                    "url" : "https://gitlab.gnome.org/GNOME/libgee.git",
                    "branch" : "main"
                }
            ]
        },

To build Autotools projects using Vala, you’ll need to set the ACLOCAL_PATH environment variable to point to /usr/lib/sdk/vala/share/aclocal or /usr/lib/sdk/vala-nightly/share/aclocal, depending on whether you’re using the stable or nightly extension. This is because the vala.m4 macros are installed outside the usual aclocal search path. You will see extremely confusing configure script errors if you forget this.


For more details and background, refer to this issue

6 Likes

I’d love to switch, but:

flatpak install --user org.freedesktop.Sdk.Extension.vala-nightly//master
Looking for matches…
...
Installation complete.

$ flatpak-builder build-dir flatpak/org.gnome.Shotwell.json  --force-clean
...
error: Requested extension org.freedesktop.Sdk.Extension.vala-nightly/x86_64/master not installed
Error: Child process exited with code 1

Ah right yea,

The extension branch needs to match the freedesktop-sdk version the runtime uses. The error is actually asking for the wrong version. Install org.freedesktop.Sdk.Extension.vala-nightly//22.08 and then it should get mounted into the sandbox properly.

(accidentally I pushed //master as well, haven’t cleaned up the ref from the repo yet)

Ah! Thanks, that works now. I was installing master because I am on GNOME SDK master, but should’ve probably guessed by the name that that extenstion isn’t related to that but the base SDK of that.

I also have the same issue with Calculator after adding the vala-nightly sdk-extension, and I have also installed vala extension 22.08 and 23.08-beta, also checked the fellow devs @jensgeorg’s Shotwell manifest, and have made all the changes similarly to that, but I am still getting “Requested extension org.freedektop.Sdk.Extension.vala-nightly/x86_64/master not installed”. What am I missing?

If you are talking about the CI, you have to also install it in your .gitlab-ci.yml like this

  before_script:
    - flatpak --user install -y org.freedesktop.Sdk.Extension.vala-nightly//22.08

Hmm that’s strange. Nightly master is using 23.08beta now and 43 and 44 are on 22.08 but I believe the CI images should already be updated with the appropriate extensions already installed.

There is definitely something broken then. See tonights build of shotwell after the translation update (I didn’t bump the manual install yet):

error: Requested extension org.freedesktop.Sdk.Extension.vala-nightly/aarch64/master not installed

Fixed that couple days ago, had forgot to revert a change once my Vala mr got merged.

Also fixed a typo in the original snippet where the json was saying:

"sdk-extensions" : [
    "org.freedektop.Sdk.Extension.vala"
]

dektop instead of desktop

1 Like

Hi, this change has been temporarily reverted due to infrastructure problems. We will try again to land it soon.

Hi, we have landed the change again. Vala is once again removed from the runtime.

libgee is also removed. If your application depends on libgee, you will need to bundle it. Here is an example of bundling the nightly version of libgee:


        {
            "name" : "libgee",
            "buildsystem" : "autotools",
            "build-options" : {
                "env" : {
                    "ACLOCAL_PATH" : "/usr/lib/sdk/vala-nightly/share/aclocal"
                }
            },
            "sources" : [
                {
                    "type" : "git",
                    "url" : "https://gitlab.gnome.org/GNOME/libgee.git",
                    "branch" : "main"
                }
            ]
        },

To build Autotools projects using Vala, you’ll need to set the ACLOCAL_PATH environment variable to point to /usr/lib/sdk/vala/share/aclocal or /usr/lib/sdk/vala-nightly/share/aclocal, depending on whether you’re using the stable or nightly extension. This is because the vala.m4 macros are installed outside the usual aclocal search path. You will see extremely confusing configure script errors if you forget this.

We need to back this out yet again because vapigen is broken. We’ll try again after we figure out what is wrong with vapigen.

Change is not always easy. :slight_smile:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.