Skip to content

Don't fail on non-existent plugin directory.#212

Merged
TheAssassin merged 1 commit intolinuxdeploy:masterfrom
JulianGro:qt_printsupport
Mar 7, 2026
Merged

Don't fail on non-existent plugin directory.#212
TheAssassin merged 1 commit intolinuxdeploy:masterfrom
JulianGro:qt_printsupport

Conversation

@JulianGro
Copy link
Contributor

When no plugins are available, Qt doesn't create a folder for them. For example, Qt might build with printsupport, but not create the printsupport plugins directory, because CUPS isn't installed and no libcupsprintersupport.so plugin was built.

Without this patch, packaging fails for me when trying to package Qt provided by Conan:

[qt/stdout] -- Deploying module: positioning -- 
[qt/stdout] Deploying Qt position plugins 
[qt/stdout] Deploying shared library /home/juliangro/.conan2/p/b/qtd40e1b81d798c/p/plugins/position/libqtposition_positionpoll.so (destination: /home/juliangro/git/overte/build/_CPack_Packages/Linux/External/Overte-Dev-2026-02-26-0/usr/plugins/position/)
[qt/stdout] WARNING: Could not find copyright files for file /home/juliangro/.conan2/p/b/qtd40e1b81d798c/p/plugins/position/libqtposition_positionpoll.so using dpkg-query 
[qt/stdout] Deploying dependencies for ELF file /home/juliangro/.conan2/p/b/qtd40e1b81d798c/p/plugins/position/libqtposition_positionpoll.so 
[qt/stdout] Deploying shared library /home/juliangro/.conan2/p/b/qtd40e1b81d798c/p/lib/libQt5Positioning.so.5
[qt/stdout] WARNING: Could not find copyright files for file /home/juliangro/.conan2/p/b/qtd40e1b81d798c/p/lib/libQt5Positioning.so.5 using dpkg-query 
[qt/stderr] terminate called after throwing an instance of 'std::filesystem::__cxx11::filesystem_error'
[qt/stderr]   what():  filesystem error: directory iterator cannot open directory: No such file or directory [/home/juliangro/.conan2/p/b/qtd40e1b81d798c/p/plugins/printsupport]
[qt/stdout] 
[qt/stdout] -- Deploying module: printsupport -- 
[qt/stdout] Deploying Qt printsupport plugins 
ERROR: Failed to run plugin: qt (exit code: 6) 

Granted, this is probably an edge case, since system packages would have the plugins and custom built packages would usually find system CUPS and build the plugin.

When no plugins are available, Qt doesn't create a folder for them.
For example, Qt might build with printsupport, but not create the printsupport plugins directory, because CUPS isn't installed and no libcupsprintersupport.so plugin was built.
Copy link
Contributor

@bjorn bjorn left a comment

Choose a reason for hiding this comment

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

Change looks fine to me, it's good to print warnings regarding this because people may not be aware their Qt could be missing some things (though, this will only get caught when all plugins of a certain type are missing), yet it may also be intentional.

I just wonder if it would be better to report the full missing path rather than just the pluginName?

@TheAssassin
Copy link
Member

I like that idea, but then again, I'd rather merge this now. @bjorn maybe you could send a fix or open a PR?

@TheAssassin TheAssassin merged commit 511d51d into linuxdeploy:master Mar 7, 2026
6 checks passed
@TheAssassin
Copy link
Member

Thanks @JulianGro!

@JulianGro JulianGro deleted the qt_printsupport branch March 10, 2026 12:05
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