Bug 505246 - [snapcraft] libtoolize shipped in kde-qt6-core-sdk is unusable
Summary: [snapcraft] libtoolize shipped in kde-qt6-core-sdk is unusable
Status: RESOLVED FIXED
Alias: None
Product: neon
Classification: KDE Neon
Component: Snaps (other bugs)
Version First Reported In: unspecified
Platform: Snap Linux
: NOR normal
Target Milestone: ---
Assignee: Scarlett Moore
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-05 17:05 UTC by Pierre Lamot
Modified: 2025-06-22 09:23 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
minimal sample code to reproduce the issue (1.01 KB, application/x-bzip)
2025-06-05 17:05 UTC, Pierre Lamot
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre Lamot 2025-06-05 17:05:36 UTC
Created attachment 182052 [details]
minimal sample code to reproduce the issue

SUMMARY

trying to use autotools to build a project using `kde-neon-6` plugin / `kf6-core24-sdk`  as libtoolize is not located properly.

STEPS TO REPRODUCE

try to use use `kde-neon-6` with in an autotools project. a minimal sample code is provided in attachment 

OBSERVED RESULT

logs from the command `snapcraft --verbosity verbose build`

```
Starting snapcraft, version 8.9.2
Logging execution to '/home/pierre/.local/state/snapcraft/log/snapcraft-20250605-184715.448675.log'
Launching managed ubuntu 24.04 instance... 
Starting snapcraft, version 8.9.2
Logging execution to '/tmp/snapcraft.log'
Initialising lifecycle
Installing build-packages
Installing build-snaps
Repulling myapp ('source-type' property changed)
Skipping pull for cleanup (already ran)
Skipping pull for kde-neon-6/sdk (already ran)
Building myapp
:: + '[' '!' -f ./configure ']'
:: + '[' -f ./autogen.sh ']'
:: + '[' '!' -f ./configure ']'
:: + '[' -f ./bootstrap ']'
:: + '[' '!' -f ./configure ']'
:: + autoreconf --install
:: libtoolize:   error: $pkgauxdir is not a directory: '/root/stage/usr/share/libtool/build-aux'
:: autoreconf: error: libtoolize failed with exit status: 1
Failed to run the build script for part 'myapp'.
Detailed information: 
:: + '[' -f ./bootstrap ']'
:: + '[' '!' -f ./configure ']'
:: + autoreconf --install
:: libtoolize:   error: $pkgauxdir is not a directory: '/root/stage/usr/share/libtool/build-aux'
:: autoreconf: error: libtoolize failed with exit status: 1
Recommended resolution: Check the build output and verify the project can work with the 'autotools' plugin.
For more information, check out: https://documentation.ubuntu.com/snapcraft/8.9.2/reference/plugins/
Failed to run snapcraft in instance
```

EXPECTED RESULT

either libtoolize should execute properly or kf6-core24-sdk shouldn't ship libtoolize (snapcraft documentation suggest to install the corresponding packages [1])

SOFTWARE/OS VERSIONS

kf6-core24-sdk: 6.11.0-6.2.5-24.12.3
kde-qt6-core24-sdk: 6.8.3
Qt Version: 6.8.3

ADDITIONAL INFORMATION

* overriding the PATH in the build-environment has no effect as the kde-neon-6 extension prepend kf6 paths to the user defined paths

* this can be worked around  by patching libtoolize like it's done for pkg-config files (see [2])

   ` sed -i -e "s#/root/stage#/snap/kf6-core24-sdk/current#" /snap/kf6-core24-sdk/current/usr/bin/libtoolize`

   but this hack can't be done in snapcraft.yaml side as snap/kf6-core24-sdk is readonly. maybe there are some proper way to relocate libtoolize,
  
[1] https://documentation.ubuntu.com/snapcraft/stable/common/craft-parts/reference/plugins/autotools_plugin/
[2] https://invent.kde.org/neon/snap-packaging/kf6-core-sdk/-/blob/b8b6c2f339e0d4d80e68d8fbb8f9abdac1a2f29c/snapcraft.yaml?page=3#L2488
Comment 1 Scarlett Moore 2025-06-07 06:04:18 UTC
I removed libtoolize from kf6-core24 please let me know if this solves the problem
Comment 2 Scarlett Moore 2025-06-17 12:45:11 UTC
It didn't fix it, I am putting your sed line into the sdk snapcraft file. Thanks!
Comment 3 Pierre Lamot 2025-06-17 12:48:48 UTC
In my tests it was mostly working (configure generates properly) but I still had issues with libstdc++ which wasn't found when required from a pkg-config .pc file. But I haven't been able to figure out whether is was an issue fixable on my side or not.

with the sed hack,  it works correctly for my scenario
Comment 4 Scarlett Moore 2025-06-22 09:23:56 UTC
In the end I was able to remove the modified libtoolize and my autotools parts seem to be working again. Let me know if this fixes it for you. thanks for your patience.