Skip to content

SDK: Fix so libraries dangling symlinks#294

Open
3v1n0 wants to merge 10 commits intoubuntu:gnome-46-2404-sdkfrom
3v1n0:sdk-fix-dangling-symlinks
Open

SDK: Fix so libraries dangling symlinks#294
3v1n0 wants to merge 10 commits intoubuntu:gnome-46-2404-sdkfrom
3v1n0:sdk-fix-dangling-symlinks

Conversation

@3v1n0
Copy link
Contributor

@3v1n0 3v1n0 commented Apr 21, 2025

libraries .so files provided by -dev packages normally point to the
versioned so file, but if these files are provided by the core snap or
another base snap then we should instead use them, if they're not
provided by the SDK itself.

So, ensure that all the symlinks in the lib directory are actually
pointing to a library file, trying to resolve them with the
core-provided libraries as first try.

This fixes the compile issue we have with gnome-boxes as per the linking issues:

2025-04-21 20:49:32.887 :: /snap/gnome-46-2404-sdk/current/usr/bin/ld: /snap/gnome-46-2404-sdk/current/usr/lib/x86_64-linux-gnu/libpciaccess.a(linux_sysfs.o): warning: relocation against `stderr@@GLIBC_2.2.5' in read-only section `.text'
2025-04-21 20:49:32.887 :: /snap/gnome-46-2404-sdk/current/usr/bin/ld: /snap/gnome-46-2404-sdk/current/usr/lib/x86_64-linux-gnu/libpciaccess.a(common_device_name.o): in function `populate_vendor':
2025-04-21 20:49:32.887 :: (.text+0x18d): undefined reference to `gzopen'
2025-04-21 20:49:32.887 :: /snap/gnome-46-2404-sdk/current/usr/bin/ld: (.text+0x1bc): undefined reference to `gzgets'
2025-04-21 20:49:32.887 :: /snap/gnome-46-2404-sdk/current/usr/bin/ld: (.text+0x394): undefined reference to `gzclose'
2025-04-21 20:49:32.888 :: /snap/gnome-46-2404-sdk/current/usr/bin/ld: (.text+0x420): undefined reference to `gzopen'
2025-04-21 20:49:32.888 :: /snap/gnome-46-2404-sdk/current/usr/bin/ld: /snap/gnome-46-2404-sdk/current/usr/lib/x86_64-linux-gnu/libpciaccess.a(linux_sysfs.o): relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC

This fixes also these other cases:

2025-04-21T19:14:27.7652675Z :: ++ readlink /root/prime/usr/lib/x86_64-linux-gnu/libBrokenLocale.so
2025-04-21T19:14:27.7655234Z :: + core_lib=/snap/core24/current/usr/lib/x86_64-linux-gnu/libBrokenLocale.so.1
2025-04-21T19:14:27.7657027Z :: + realpath --canonicalize-existing /snap/core24/current/usr/lib/x86_64-linux-gnu/libBrokenLocale.so.1
2025-04-21T19:14:27.7668303Z :: /snap/core24/888/usr/lib/x86_64-linux-gnu/libBrokenLocale.so.1
2025-04-21T19:14:27.7670954Z :: + ln -svf /usr/lib/x86_64-linux-gnu/libBrokenLocale.so.1 /root/prime/usr/lib/x86_64-linux-gnu/libBrokenLocale.so
2025-04-21T19:14:27.7682861Z :: '/root/prime/usr/lib/x86_64-linux-gnu/libBrokenLocale.so' -> '/usr/lib/x86_64-linux-gnu/libBrokenLocale.so.1'
2025-04-21T19:14:27.7685855Z :: + 
2025-04-21T19:14:27.8632229Z :: ++ readlink /root/prime/usr/lib/x86_64-linux-gnu/libanl.so
2025-04-21T19:14:27.8645632Z :: + core_lib=/snap/core24/current/usr/lib/x86_64-linux-gnu/libanl.so.1
2025-04-21T19:14:27.8648639Z :: + realpath --canonicalize-existing /snap/core24/current/usr/lib/x86_64-linux-gnu/libanl.so.1
2025-04-21T19:14:27.8658523Z :: /snap/core24/888/usr/lib/x86_64-linux-gnu/libanl.so.1
2025-04-21T19:14:27.8676057Z :: + ln -svf /usr/lib/x86_64-linux-gnu/libanl.so.1 /root/prime/usr/lib/x86_64-linux-gnu/libanl.so
2025-04-21T19:14:27.8676810Z :: '/root/prime/usr/lib/x86_64-linux-gnu/libanl.so' -> '/usr/lib/x86_64-linux-gnu/libanl.so.1'
2025-04-21T19:14:27.8679512Z :: + 
2025-04-21T19:14:27.9091535Z :: ++ readlink /root/prime/usr/lib/x86_64-linux-gnu/libc_malloc_debug.so
2025-04-21T19:14:27.9097459Z :: + core_lib=/snap/core24/current/usr/lib/x86_64-linux-gnu/libc_malloc_debug.so.0
2025-04-21T19:14:27.9098504Z :: + realpath --canonicalize-existing /snap/core24/current/usr/lib/x86_64-linux-gnu/libc_malloc_debug.so.0
2025-04-21T19:14:27.9107874Z :: /snap/core24/888/usr/lib/x86_64-linux-gnu/libc_malloc_debug.so.0
2025-04-21T19:14:27.9111709Z :: + ln -svf /usr/lib/x86_64-linux-gnu/libc_malloc_debug.so.0 /root/prime/usr/lib/x86_64-linux-gnu/libc_malloc_debug.so
2025-04-21T19:14:27.9126662Z :: '/root/prime/usr/lib/x86_64-linux-gnu/libc_malloc_debug.so' -> '/usr/lib/x86_64-linux-gnu/libc_malloc_debug.so.0'
2025-04-21T19:14:27.9128331Z :: + 
2025-04-21T19:14:27.9381751Z :: ++ readlink /root/prime/usr/lib/x86_64-linux-gnu/libcrypt.so
2025-04-21T19:14:27.9405472Z :: + core_lib=/snap/core24/current/usr/lib/x86_64-linux-gnu/libcrypt.so.1.1.0
2025-04-21T19:14:27.9406127Z :: + realpath --canonicalize-existing /snap/core24/current/usr/lib/x86_64-linux-gnu/libcrypt.so.1.1.0
2025-04-21T19:14:27.9407716Z :: /snap/core24/888/usr/lib/x86_64-linux-gnu/libcrypt.so.1.1.0
2025-04-21T19:14:27.9413478Z :: + ln -svf /usr/lib/x86_64-linux-gnu/libcrypt.so.1.1.0 /root/prime/usr/lib/x86_64-linux-gnu/libcrypt.so
2025-04-21T19:14:27.9427626Z :: '/root/prime/usr/lib/x86_64-linux-gnu/libcrypt.so' -> '/usr/lib/x86_64-linux-gnu/libcrypt.so.1.1.0'
2025-04-21T19:14:27.9428341Z :: + 
2025-04-21T19:14:28.2410903Z :: ++ readlink /root/prime/usr/lib/x86_64-linux-gnu/libmvec.so
2025-04-21T19:14:28.2424731Z :: + core_lib=/snap/core24/current/usr/lib/x86_64-linux-gnu/libmvec.so.1
2025-04-21T19:14:28.2425665Z :: + realpath --canonicalize-existing /snap/core24/current/usr/lib/x86_64-linux-gnu/libmvec.so.1
2025-04-21T19:14:28.2433988Z :: /snap/core24/888/usr/lib/x86_64-linux-gnu/libmvec.so.1
2025-04-21T19:14:28.2437987Z :: + ln -svf /usr/lib/x86_64-linux-gnu/libmvec.so.1 /root/prime/usr/lib/x86_64-linux-gnu/libmvec.so
2025-04-21T19:14:28.2448685Z :: '/root/prime/usr/lib/x86_64-linux-gnu/libmvec.so' -> '/usr/lib/x86_64-linux-gnu/libmvec.so.1'
2025-04-21T19:14:28.2451476Z :: + 
2025-04-21T19:14:28.2571158Z :: ++ readlink /root/prime/usr/lib/x86_64-linux-gnu/libnss_compat.so
2025-04-21T19:14:28.2575968Z :: + core_lib=/snap/core24/current/usr/lib/x86_64-linux-gnu/libnss_compat.so.2
2025-04-21T19:14:28.2576937Z :: + realpath --canonicalize-existing /snap/core24/current/usr/lib/x86_64-linux-gnu/libnss_compat.so.2
2025-04-21T19:14:28.2590023Z :: /snap/core24/888/usr/lib/x86_64-linux-gnu/libnss_compat.so.2
2025-04-21T19:14:28.2591451Z :: + ln -svf /usr/lib/x86_64-linux-gnu/libnss_compat.so.2 /root/prime/usr/lib/x86_64-linux-gnu/libnss_compat.so
2025-04-21T19:14:28.2603414Z :: '/root/prime/usr/lib/x86_64-linux-gnu/libnss_compat.so' -> '/usr/lib/x86_64-linux-gnu/libnss_compat.so.2'
2025-04-21T19:14:28.2617420Z :: + 
2025-04-21T19:14:28.2633341Z :: ++ readlink /root/prime/usr/lib/x86_64-linux-gnu/libnss_hesiod.so
2025-04-21T19:14:28.2638364Z :: + core_lib=/snap/core24/current/usr/lib/x86_64-linux-gnu/libnss_hesiod.so.2
2025-04-21T19:14:28.2647972Z :: + realpath --canonicalize-existing /snap/core24/current/usr/lib/x86_64-linux-gnu/libnss_hesiod.so.2
2025-04-21T19:14:28.2651783Z :: /snap/core24/888/usr/lib/x86_64-linux-gnu/libnss_hesiod.so.2
2025-04-21T19:14:28.2654605Z :: + ln -svf /usr/lib/x86_64-linux-gnu/libnss_hesiod.so.2 /root/prime/usr/lib/x86_64-linux-gnu/libnss_hesiod.so
2025-04-21T19:14:28.2672222Z :: '/root/prime/usr/lib/x86_64-linux-gnu/libnss_hesiod.so' -> '/usr/lib/x86_64-linux-gnu/libnss_hesiod.so.2'
2025-04-21T19:14:28.2674379Z :: + 
2025-04-21T19:14:28.2958314Z :: ++ readlink /root/prime/usr/lib/x86_64-linux-gnu/libpciaccess.so
2025-04-21T19:14:28.2972622Z :: + core_lib=/snap/core24/current/usr/lib/x86_64-linux-gnu/libpciaccess.so.0.11.1
2025-04-21T19:14:28.2973906Z :: + realpath --canonicalize-existing /snap/core24/current/usr/lib/x86_64-linux-gnu/libpciaccess.so.0.11.1
2025-04-21T19:14:28.2983570Z :: /snap/core24/888/usr/lib/x86_64-linux-gnu/libpciaccess.so.0.11.1
2025-04-21T19:14:28.2990439Z :: + ln -svf /usr/lib/x86_64-linux-gnu/libpciaccess.so.0.11.1 /root/prime/usr/lib/x86_64-linux-gnu/libpciaccess.so
2025-04-21T19:14:28.3002763Z :: '/root/prime/usr/lib/x86_64-linux-gnu/libpciaccess.so' -> '/usr/lib/x86_64-linux-gnu/libpciaccess.so.0.11.1'
2025-04-21T19:14:28.3006533Z :: + 
2025-04-21T19:14:28.3782845Z :: ++ readlink /root/prime/usr/lib/x86_64-linux-gnu/libresolv.so
2025-04-21T19:14:28.3797871Z :: + core_lib=/snap/core24/current/usr/lib/x86_64-linux-gnu/libresolv.so.2
2025-04-21T19:14:28.3799269Z :: + realpath --canonicalize-existing /snap/core24/current/usr/lib/x86_64-linux-gnu/libresolv.so.2
2025-04-21T19:14:28.3808636Z :: /snap/core24/888/usr/lib/x86_64-linux-gnu/libresolv.so.2
2025-04-21T19:14:28.3822038Z :: + ln -svf /usr/lib/x86_64-linux-gnu/libresolv.so.2 /root/prime/usr/lib/x86_64-linux-gnu/libresolv.so
2025-04-21T19:14:28.3826156Z :: '/root/prime/usr/lib/x86_64-linux-gnu/libresolv.so' -> '/usr/lib/x86_64-linux-gnu/libresolv.so.2'
2025-04-21T19:14:28.3827052Z :: + 
2025-04-21T19:14:28.4324023Z :: ++ readlink /root/prime/usr/lib/x86_64-linux-gnu/libthread_db.so
2025-04-21T19:14:28.4338047Z :: + core_lib=/snap/core24/current/usr/lib/x86_64-linux-gnu/libthread_db.so.1
2025-04-21T19:14:28.4339762Z :: + realpath --canonicalize-existing /snap/core24/current/usr/lib/x86_64-linux-gnu/libthread_db.so.1
2025-04-21T19:14:28.4351158Z :: /snap/core24/888/usr/lib/x86_64-linux-gnu/libthread_db.so.1
2025-04-21T19:14:28.4355710Z :: + ln -svf /usr/lib/x86_64-linux-gnu/libthread_db.so.1 /root/prime/usr/lib/x86_64-linux-gnu/libthread_db.so
2025-04-21T19:14:28.4368474Z :: '/root/prime/usr/lib/x86_64-linux-gnu/libthread_db.so' -> '/usr/lib/x86_64-linux-gnu/libthread_db.so.1'
2025-04-21T19:14:28.4381415Z :: + 

UDENG-6680

@3v1n0 3v1n0 requested a review from sergio-costas April 21, 2025 18:24
@3v1n0 3v1n0 force-pushed the sdk-fix-dangling-symlinks branch 2 times, most recently from 98b91e4 to 772fcd6 Compare April 21, 2025 23:00
Copy link
Contributor

@sergio-costas sergio-costas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A little nitpick

Copy link
Contributor

@sergio-costas sergio-costas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks fine, and even has a check to notify for any left dangling symlink.

@sergio-costas sergio-costas self-requested a review April 23, 2025 12:39
@sergio-costas
Copy link
Contributor

Before merging this... what happens with the review tools? It seems that they do ensure that no soft link points outside the snap...

@sergio-costas
Copy link
Contributor

So maybe the solution is to add all those links in Core24...

@3v1n0
Copy link
Contributor Author

3v1n0 commented Apr 24, 2025

So maybe the solution is to add all those links in Core24...

Oh I didn't check review tools output... But if they don't work with this, then... The only option would be to copy the actual libraries in the sdk too and ensure that they don't get removed as duplicate...

@sergio-costas
Copy link
Contributor

Oh I didn't check review tools output... But if they don't work with this, then... The only option would be to copy the actual libraries in the sdk too and ensure that they don't get removed as duplicate...

I still think that they should go in Core24: if you think about it, it IS being used to compile, when you build any snap...

@sergio-costas
Copy link
Contributor

I really dislike having duplicated libraries.

@3v1n0
Copy link
Contributor Author

3v1n0 commented Apr 24, 2025

I really dislike having duplicated libraries.

Yeah, but I feel that's the way... Since I'm pretty sure that core doesn't want to include dev packages contents.

While us being a dev sdk we need to provide everything required to build.

So if core is missing something, we have to.

Implies more maintenance though, I agree.

@sergio-costas
Copy link
Contributor

So... do we copy the required files from CoreXX into the right folder wherever there is a dangling pointer...?

@3v1n0
Copy link
Contributor Author

3v1n0 commented Apr 24, 2025

AFAIK is the only way we can... And ensure they get not deleted by duplicates checking tool

@nteodosio
Copy link
Contributor

Moving from #296:

The point is that if the SDK requires something in the CoreXX to be built, it must add the corresponding -dev package in build-packages too, not build itself from scratch, and those soft links will not be in stage but in the build system. In stage will be only pieces installed due to dependencies, and those must be removed.

What do you mean with "build itself from scratch", what is "itself"? In Libtool's case the -dev package (libc6-dev) was added to build-packages.

@sergio-costas
Copy link
Contributor

sergio-costas commented Apr 25, 2025

What do you mean with "build itself from scratch", what is "itself"? In Libtool's case the -dev package (libc6-dev) was added to build-packages.

Exactly: since Core24 doesn't have the soft link libBrokenLocale.so pointing to libBrokenLocale.so.1, then the SDK snap has to install libc6-dev, which is the one that creates it, instead of building libc6 itself from sources to have that link.

@sergio-costas
Copy link
Contributor

In fact... why is libpciaccess in gnome-46-2404-sdk if it is already in Core24?

@sergio-costas
Copy link
Contributor

Ok, confirmed my suspicions: just by removing the broken soft link, the libpciaccess.a file, and (this is the key point) the pciaccess.pc file, all from the `gnome-46-2404-sdk' snap, building gnome-boxes works as expected.

The problem is that the pciaccess.pc file in the gnome-46-2404-sdk snap takes precedence over the one installed from the build-packages, and they try to compile against a library in the snap. We removed the duplicated libraries (because they are already in Core24), but didn't remove the .pc file, and that is what is breaking everything.

So if we remove a library in the gnome SDK because it is already in Core24, we must also remove the corresponding .pc file to avoid this.

@nteodosio
Copy link
Contributor

Exactly: since Core24 doesn't have the soft link libBrokenLocale.so pointing to libBrokenLocale.so.1, then the SDK snap has to install libc6-dev, which is the one that creates it, instead of building libc6 itself from sources to have that link.

That makes sense. We never built libc6 though.

@sergio-costas
Copy link
Contributor

sergio-costas commented Apr 28, 2025

@3v1n0 So, in my opinion, the true solution is to find which .pc file correspond to each duplicated library in Core24 and remove it. It's not easy, I now, but with some python magic... ;-)

@sergio-costas
Copy link
Contributor

In fact... just checking the "Libs" and "Libs.private" parts should be enough to know which libraries are affected by a .pc file, so if they aren't available in gnome-XX-YY-sdk, then that .pc file can be removed.

@3v1n0
Copy link
Contributor Author

3v1n0 commented Apr 28, 2025

@3v1n0 So, in my opinion, the true solution is to find which .pc file correspond to each duplicated library in Core24 and remove it. It's not easy, I now, but with some python magic... ;-)

Well, I'm unsure either... These are build dependencies of dependencies we have in the SDK IIRC, I mean if any of these libraries headers/pc files are part of the gnome-sdk, then we should provide them too.

For example for the pciaccess one:

❯ apt-cache rdepends libpciaccess-dev
libpciaccess-dev
Reverse Depends:
  libdrm-dev
  xserver-xorg-dev
  xserver-xorg-dev
  xserver-xorg-dev
  libdrm-dev
  xserver-xorg-dev
  xserver-xorg-dev
  libdrm-dev
  xserver-xorg-dev

Since we have stage packages such as libdrm-dev, then we need to also fully stage their dependencies. And we were kinda doing it, but then we end up removing the duplicates that are part of core wrongly.

It's fine to remove them from the runtime snap, but not from the sdk.

@sergio-costas
Copy link
Contributor

But then, what we have to do is to ensure that using the gnome SDK requires to install the corresponding stage-packages that are provided by CoreXX.

@sergio-costas
Copy link
Contributor

Anyway... you don't necessarily need those dependencies to build something with those libraries... and if you need them for whatever reason, the build error will tell you what you have to add to the build-packages. And removing the pkgconfig files in the SDK will make that work.

@sergio-costas
Copy link
Contributor

Ok, let's take a step back and see the whole thing... Core24 (and other Cores) are built just by "dumping" an Ubuntu base system, as seen here: https://github.com/canonical/core-base/blob/277049e8bf67fdeadb9afe92428220e02cf95142/snapcraft.yaml#L13

The point is that, when building new snaps against CoreXX, the development files aren't there. Where are they get? And the answer is that snapcraft must automagically download them from .deb packages, things like libc6-dev, build-essential, make, pkg-config...

Also, there is a list of packages that must not be staged, because they are known to be included from Core... https://github.com/canonical/snapcraft/blob/0157e5b15e66af34a4b12d397e5f56a30eebb13d/snapcraft_legacy/internal/repo/_deb.py#L51

But all that I found at this point is only available in legacy, so for new snaps it must be done somewhere else.

So the point, in my opinion, is to find where those required -dev files are defined, and send a patch for snapcraft to add libpciaccess0 and libcrypt1 to the list of exceptions, and to include libpciaccess-dev and libcrypt-dev, because those two are already in Core24.

@sergio-costas
Copy link
Contributor

Ok, it seems that the list of blocked packages is in craft-parts: https://github.com/canonical/craft-parts/blob/1f163c0ec0691182cf08da52cc1cfc7160618241/craft_parts/packages/deb.py#L57-L283 So... Should we add there libpciaccess0 and libcrytp1?

3v1n0 added 4 commits August 8, 2025 19:13
The GNOME SDK should contain all the required dev-dependencies of the
libraries we ship, including the core files dependencies.

Now, even though core includes already some of the runtime libraries it
does not include their *.so counterparts, and then that's now our duty
to provide them all and in a working state.

Since we can't really symlink to external paths in a snap, we should
provide all the libraries here, since there's no way to fix the *.so files
that are used at link time.

Dropping them would be wrong though, since there may be libraries in the
SDK that requires them at link time only, and it's not up to final
applications to manage that.
If a dangling *.so file is found, it means that a package it links has
not been staged, so fail in such case
We already have code to remove duplicates and these libraries are already
dropped as part of the previous lines
@3v1n0 3v1n0 force-pushed the sdk-fix-dangling-symlinks branch from 8baa7ce to c39eb7b Compare August 8, 2025 17:13
@3v1n0 3v1n0 requested a review from sergio-costas August 11, 2025 14:32
Copy link
Contributor

@sergio-costas sergio-costas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@sergio-costas
Copy link
Contributor

It seems that krb5-multidev is either required, o removing the dangling pointer /usr/lib/x86_64-linux-gnu/mit-krb5/libgssapi_krb5.so is needed...

@3v1n0
Copy link
Contributor Author

3v1n0 commented Aug 27, 2025

It seems that krb5-multidev is either required, o removing the dangling pointer /usr/lib/x86_64-linux-gnu/mit-krb5/libgssapi_krb5.so is needed...

It looks a bit out of place here TBH. @nteodosio do you know what could have pulled it in?

@nteodosio
Copy link
Contributor

nteodosio commented Aug 28, 2025 via email

@sergio-costas
Copy link
Contributor

@nteodosio It fails to build...

@nteodosio nteodosio force-pushed the sdk-fix-dangling-symlinks branch from ebc13af to 5328b70 Compare August 29, 2025 11:49
@nteodosio
Copy link
Contributor

Thanks, with the last commit we went from

/root/prime/usr/lib/x86_64-linux-gnu/libcom_err.so: dangling symlink!
/root/prime/usr/lib/x86_64-linux-gnu/libcrypt.so: dangling symlink!
/root/prime/usr/lib/x86_64-linux-gnu/libelf.so: dangling symlink!
/root/prime/usr/lib/x86_64-linux-gnu/libffi.so: dangling symlink!
/root/prime/usr/lib/x86_64-linux-gnu/libgssapi_krb5.so: dangling symlink!
/root/prime/usr/lib/x86_64-linux-gnu/libk5crypto.so: dangling symlink!
/root/prime/usr/lib/x86_64-linux-gnu/libkrb5support.so: dangling symlink!
/root/prime/usr/lib/x86_64-linux-gnu/libtirpc.so: dangling symlink!
/root/prime/usr/lib/x86_64-linux-gnu/mit-krb5/libgssapi_krb5.so: dangling symlink!
/root/prime/usr/lib/x86_64-linux-gnu/mit-krb5/libk5crypto.so: dangling symlink!
/root/prime/usr/lib/x86_64-linux-gnu/mit-krb5/libkrb5support.so: dangling symlink!

down to

/root/prime/usr/lib/x86_64-linux-gnu/libk5crypto.so: dangling symlink!
/root/prime/usr/lib/x86_64-linux-gnu/libffi.so: dangling symlink!
/root/prime/usr/lib/x86_64-linux-gnu/libelf.so: dangling symlink!
/root/prime/usr/lib/x86_64-linux-gnu/libkrb5support.so: dangling symlink!

So still needing libffi8, libelf1t64, libk5crypto3 and libkrb5support0.

…krb5support0.

They provide the targets of the -dev's symlinks.
@nteodosio nteodosio force-pushed the sdk-fix-dangling-symlinks branch from 5328b70 to 75c8986 Compare August 29, 2025 12:53
@nteodosio
Copy link
Contributor

Those are now gone but eventually more popped up.

:: /root/prime/usr/lib/x86_64-linux-gnu/libcrypt.so: dangling symlink!
:: /root/prime/usr/lib/x86_64-linux-gnu/libcom_err.so: dangling symlink!
:: /root/prime/usr/lib/x86_64-linux-gnu/libtirpc.so: dangling symlink!

Probably something needs to be re-worked, we can't go whack-a-moling ad infinitum.

@3v1n0
Copy link
Contributor Author

3v1n0 commented Sep 1, 2025

Probably something needs to be re-worked, we can't go whack-a-moling ad infinitum.

Well, pkg-config can help us with that... We should just follow the whole dependency chain.

@nteodosio
Copy link
Contributor

All green, can we merge now?

@sergio-costas
Copy link
Contributor

All green, can we merge now?

Did you build the RUNTIME from this, and tested it to ensure that everything works as expected?

@nteodosio
Copy link
Contributor

No, but I can. Is this requirement and the corresponding process documented somewhere?

@sergio-costas
Copy link
Contributor

It should be a requirement :-D I use lxcraft to build it, with these changes in the snapcraft.yaml:

@@ -35,14 +35,19 @@ slots:
 parts:
   gnome-sdk:
     plugin: nil
-    stage-snaps: [ gnome-46-2404-sdk/latest/candidate ]
+#    stage-snaps: [ gnome-46-2404-sdk/latest/candidate ]
     build-packages:
       - yq
     override-build: |
       set -eu
       craftctl default
-      sdk_version=$(cat ${CRAFT_PART_INSTALL}/snap.gnome-46-2404-sdk/manifest.yaml \
-        | yq -r '.version')
+      cp -a /snap/gnome-46-2404-sdk/current/usr $CRAFT_PART_INSTALL/
+      cp -a /snap/gnome-46-2404-sdk/current/etc $CRAFT_PART_INSTALL/
+      cp -a /snap/gnome-46-2404-sdk/current/var $CRAFT_PART_INSTALL/
+      cp -a /snap/gnome-46-2404-sdk/current/lib $CRAFT_PART_INSTALL/
+      #sdk_version=$(cat ${CRAFT_PART_INSTALL}/snap.gnome-46-2404-sdk/manifest.yaml \
+      #  | yq -r '.version')
+      sdk_version=46
 
       # Use the same logic of snapcraft
       project_version=$(git -C "${CRAFT_PROJECT_DIR}" describe --dirty 2>/dev/null || true)

and this lxcraft.yaml configuration file:

image: ubuntu:noble

force_debug: True

snaps:
  snapcraft:
    - classic
    - stable
    - store
  core24:
    - store
  gtk-common-themes:
    - store
  ../gnome-sdk/gnome-46*.snap:
    - local

(of course, I built the SDK snap at ../gnome-sdk folder

@sergio-costas
Copy link
Contributor

Here you can see the list of snaps that I use to test each new SDK: #315

@nteodosio
Copy link
Contributor

nteodosio commented Sep 1, 2025 via email

@sergio-costas
Copy link
Contributor

I'll do it.

@3v1n0
Copy link
Contributor Author

3v1n0 commented Sep 1, 2025

It should be a requirement :-D I use lxcraft to build it, with these changes in the snapcraft.yaml:

Can we make a CI job that handles this a bit like autopkgtests?

So whenever we push to main (at least) or a PR is approved, we check if some snaps are building fine.

@sergio-costas
Copy link
Contributor

I'm preparing a patch for the runtime that allows to easily build it from a local SDK snap.

@3v1n0
Copy link
Contributor Author

3v1n0 commented Sep 2, 2025

Good, then can we also use it in CI?

@sergio-costas
Copy link
Contributor

Yes, that's my idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants