From 29bcebdd2d48c162105b293a5b8cc7480c66a568 Mon Sep 17 00:00:00 2001 From: Tom Dewey Date: Thu, 25 Jul 2024 15:27:01 +0100 Subject: [PATCH] multiple deployers: Ignore .debug files This commit replicates a pattern from the TextToSpeechPluginsDeployer across a range of other deployer classes. Essentially - it's extremely unlikely that composing an AppImage with debug symbols is what a user actually wants to do. I'm also not aware of a good story for connecting debug symbols to an AppImage at all. As a result, let's make a sensible choice - and not package them. Trust that developers will use their underlying build system for Debug, and that release tracking will allow developers to tie an AppImage back to a source control revision. Finally, note that this works around an interesting aarch64 bug - where the .debug files that are created are marked as x86_64 ELF binaries - even when you are _building on an aarch64 host_. --- src/deployers/BearerPluginsDeployer.cpp | 5 +++++ src/deployers/GamepadPluginsDeployer.cpp | 5 +++++ src/deployers/LocationPluginsDeployer.cpp | 5 +++++ src/deployers/Multimedia5PluginsDeployer.cpp | 10 ++++++++++ src/deployers/Multimedia6PluginsDeployer.cpp | 5 +++++ src/deployers/PlatformPluginsDeployer.cpp | 8 ++++++++ src/deployers/PositioningPluginsDeployer.cpp | 5 +++++ src/deployers/PrintSupportPluginsDeployer.cpp | 5 +++++ src/deployers/Qt3DPluginsDeployer.cpp | 10 ++++++++++ src/deployers/SqlPluginsDeployer.cpp | 5 +++++ src/deployers/TlsBackendsDeployer.cpp | 5 +++++ .../WaylandcompositorPluginsDeployer.cpp | 15 +++++++++++++++ src/deployment.h | 4 ++++ 13 files changed, 87 insertions(+) diff --git a/src/deployers/BearerPluginsDeployer.cpp b/src/deployers/BearerPluginsDeployer.cpp index 5784060..120a289 100644 --- a/src/deployers/BearerPluginsDeployer.cpp +++ b/src/deployers/BearerPluginsDeployer.cpp @@ -20,6 +20,11 @@ bool BearerPluginsDeployer::deploy() { ldLog() << "Deploying bearer plugins" << std::endl; for (fs::directory_iterator i(qtPluginsPath / "bearer"); i != fs::directory_iterator(); ++i) { + if (i->path().extension() == ".debug") { + ldLog() << LD_DEBUG << "skipping .debug file:" << i->path() << std::endl; + continue; + } + if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/bearer/")) return false; } diff --git a/src/deployers/GamepadPluginsDeployer.cpp b/src/deployers/GamepadPluginsDeployer.cpp index 6ebedb7..ce97fdb 100644 --- a/src/deployers/GamepadPluginsDeployer.cpp +++ b/src/deployers/GamepadPluginsDeployer.cpp @@ -20,6 +20,11 @@ bool GamepadPluginsDeployer::deploy() { ldLog() << "Deploying Gamepad plugins" << std::endl; for (fs::directory_iterator i(qtPluginsPath / "gamepads"); i != fs::directory_iterator(); ++i) { + if (i->path().extension() == ".debug") { + ldLog() << LD_DEBUG << "skipping .debug file:" << i->path() << std::endl; + continue; + } + if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/gamepads/")) return false; } diff --git a/src/deployers/LocationPluginsDeployer.cpp b/src/deployers/LocationPluginsDeployer.cpp index 689f2c8..683cede 100644 --- a/src/deployers/LocationPluginsDeployer.cpp +++ b/src/deployers/LocationPluginsDeployer.cpp @@ -20,6 +20,11 @@ bool LocationPluginsDeployer::deploy() { ldLog() << "Deploying Location plugins" << std::endl; for (fs::directory_iterator i(qtPluginsPath / "geoservices"); i != fs::directory_iterator(); ++i) { + if (i->path().extension() == ".debug") { + ldLog() << LD_DEBUG << "skipping .debug file:" << i->path() << std::endl; + continue; + } + if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/geoservices/")) return false; } diff --git a/src/deployers/Multimedia5PluginsDeployer.cpp b/src/deployers/Multimedia5PluginsDeployer.cpp index 0718328..c0a0d57 100644 --- a/src/deployers/Multimedia5PluginsDeployer.cpp +++ b/src/deployers/Multimedia5PluginsDeployer.cpp @@ -20,6 +20,11 @@ bool Multimedia5PluginsDeployer::deploy() { ldLog() << "Deploying mediaservice plugins" << std::endl; for (fs::directory_iterator i(qtPluginsPath / "mediaservice"); i != fs::directory_iterator(); ++i) { + if (i->path().extension() == ".debug") { + ldLog() << LD_DEBUG << "skipping .debug file:" << i->path() << std::endl; + continue; + } + if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/mediaservice/")) return false; } @@ -27,6 +32,11 @@ bool Multimedia5PluginsDeployer::deploy() { ldLog() << "Deploying audio plugins" << std::endl; for (fs::directory_iterator i(qtPluginsPath / "audio"); i != fs::directory_iterator(); ++i) { + if (i->path().extension() == ".debug") { + ldLog() << LD_DEBUG << "skipping .debug file:" << i->path() << std::endl; + continue; + } + if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/audio/")) return false; } diff --git a/src/deployers/Multimedia6PluginsDeployer.cpp b/src/deployers/Multimedia6PluginsDeployer.cpp index 2ea8fee..cbaba32 100644 --- a/src/deployers/Multimedia6PluginsDeployer.cpp +++ b/src/deployers/Multimedia6PluginsDeployer.cpp @@ -21,6 +21,11 @@ bool Multimedia6PluginsDeployer::deploy() { ldLog() << "Deploying multimedia plugins" << std::endl; for (fs::directory_iterator i(qtPluginsPath / "multimedia"); i != fs::directory_iterator(); ++i) { + if (i->path().extension() == ".debug") { + ldLog() << LD_DEBUG << "skipping .debug file:" << i->path() << std::endl; + continue; + } + if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/multimedia/")) return false; } diff --git a/src/deployers/PlatformPluginsDeployer.cpp b/src/deployers/PlatformPluginsDeployer.cpp index 5d5076b..a60ee8a 100644 --- a/src/deployers/PlatformPluginsDeployer.cpp +++ b/src/deployers/PlatformPluginsDeployer.cpp @@ -35,11 +35,19 @@ bool PlatformPluginsDeployer::deploy() { } for (fs::directory_iterator i(qtPluginsPath / "platforminputcontexts"); i != fs::directory_iterator(); ++i) { + if (i->path().extension() == ".debug") { + ldLog() << LD_DEBUG << "skipping .debug file:" << i->path() << std::endl; + continue; + } if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/platforminputcontexts/")) return false; } for (fs::directory_iterator i(qtPluginsPath / "imageformats"); i != fs::directory_iterator(); ++i) { + if (i->path().extension() == ".debug") { + ldLog() << LD_DEBUG << "skipping .debug file:" << i->path() << std::endl; + continue; + } if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/imageformats/")) return false; } diff --git a/src/deployers/PositioningPluginsDeployer.cpp b/src/deployers/PositioningPluginsDeployer.cpp index 5c95e7f..f9348d9 100644 --- a/src/deployers/PositioningPluginsDeployer.cpp +++ b/src/deployers/PositioningPluginsDeployer.cpp @@ -20,6 +20,11 @@ bool PositioningPluginsDeployer::deploy() { ldLog() << "Deploying positioning plugins" << std::endl; for (fs::directory_iterator i(qtPluginsPath / "position"); i != fs::directory_iterator(); ++i) { + if (i->path().extension() == ".debug") { + ldLog() << LD_DEBUG << "skipping .debug file:" << i->path() << std::endl; + continue; + } + if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/position/")) return false; } diff --git a/src/deployers/PrintSupportPluginsDeployer.cpp b/src/deployers/PrintSupportPluginsDeployer.cpp index 15c1d86..07c94d0 100644 --- a/src/deployers/PrintSupportPluginsDeployer.cpp +++ b/src/deployers/PrintSupportPluginsDeployer.cpp @@ -20,6 +20,11 @@ bool PrintSupportPluginsDeployer::deploy() { ldLog() << "Deploying printsupport plugins" << std::endl; for (fs::directory_iterator i(qtPluginsPath / "printsupport"); i != fs::directory_iterator(); ++i) { + if (i->path().extension() == ".debug") { + ldLog() << LD_DEBUG << "skipping .debug file:" << i->path() << std::endl; + continue; + } + if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/printsupport/")) return false; } diff --git a/src/deployers/Qt3DPluginsDeployer.cpp b/src/deployers/Qt3DPluginsDeployer.cpp index 635ea04..d784977 100644 --- a/src/deployers/Qt3DPluginsDeployer.cpp +++ b/src/deployers/Qt3DPluginsDeployer.cpp @@ -20,11 +20,21 @@ bool Qt3DPluginsDeployer::deploy() { ldLog() << "Deploying Qt 3D plugins" << std::endl; for (fs::directory_iterator i(qtPluginsPath / "geometryloaders"); i != fs::directory_iterator(); ++i) { + if (i->path().extension() == ".debug") { + ldLog() << LD_DEBUG << "skipping .debug file:" << i->path() << std::endl; + continue; + } + if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/geometryloaders/")) return false; } for (fs::directory_iterator i(qtPluginsPath / "sceneparsers"); i != fs::directory_iterator(); ++i) { + if (i->path().extension() == ".debug") { + ldLog() << LD_DEBUG << "skipping .debug file:" << i->path() << std::endl; + continue; + } + if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/sceneparsers/")) return false; } diff --git a/src/deployers/SqlPluginsDeployer.cpp b/src/deployers/SqlPluginsDeployer.cpp index 6d0111b..0926077 100644 --- a/src/deployers/SqlPluginsDeployer.cpp +++ b/src/deployers/SqlPluginsDeployer.cpp @@ -20,6 +20,11 @@ bool SqlPluginsDeployer::deploy() { ldLog() << "Deploying SQL plugins" << std::endl; for (fs::directory_iterator i(qtPluginsPath / "sqldrivers"); i != fs::directory_iterator(); ++i) { + if (i->path().extension() == ".debug") { + ldLog() << LD_DEBUG << "skipping .debug file:" << i->path() << std::endl; + continue; + } + if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/sqldrivers/")) return false; } diff --git a/src/deployers/TlsBackendsDeployer.cpp b/src/deployers/TlsBackendsDeployer.cpp index e6c84b9..68c1762 100644 --- a/src/deployers/TlsBackendsDeployer.cpp +++ b/src/deployers/TlsBackendsDeployer.cpp @@ -20,6 +20,11 @@ bool TlsBackendsDeployer::deploy() { ldLog() << "Deploying TLS backends" << std::endl; for (fs::directory_iterator i(qtPluginsPath / "tls"); i != fs::directory_iterator(); ++i) { + if (i->path().extension() == ".debug") { + ldLog() << LD_DEBUG << "skipping .debug file:" << i->path() << std::endl; + continue; + } + if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/tls/")) return false; } diff --git a/src/deployers/WaylandcompositorPluginsDeployer.cpp b/src/deployers/WaylandcompositorPluginsDeployer.cpp index 3a0e667..bd36364 100644 --- a/src/deployers/WaylandcompositorPluginsDeployer.cpp +++ b/src/deployers/WaylandcompositorPluginsDeployer.cpp @@ -20,16 +20,31 @@ bool WaylandcompositorPluginsDeployer::deploy() { ldLog() << "Deploying waylandcompositor plugin" << std::endl; for (fs::directory_iterator i(qtPluginsPath / "wayland-decoration-client"); i != fs::directory_iterator(); ++i) { + if (i->path().extension() == ".debug") { + ldLog() << LD_DEBUG << "skipping .debug file:" << i->path() << std::endl; + continue; + } + if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/wayland-decoration-client/")) return false; } for (fs::directory_iterator i(qtPluginsPath / "wayland-graphics-integration-client"); i != fs::directory_iterator(); ++i) { + if (i->path().extension() == ".debug") { + ldLog() << LD_DEBUG << "skipping .debug file:" << i->path() << std::endl; + continue; + } + if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/wayland-graphics-integration-client/")) return false; } for (fs::directory_iterator i(qtPluginsPath / "wayland-shell-integration"); i != fs::directory_iterator(); ++i) { + if (i->path().extension() == ".debug") { + ldLog() << LD_DEBUG << "skipping .debug file:" << i->path() << std::endl; + continue; + } + if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/wayland-shell-integration/")) return false; } diff --git a/src/deployment.h b/src/deployment.h index 04df3a1..047941a 100644 --- a/src/deployment.h +++ b/src/deployment.h @@ -37,6 +37,10 @@ inline bool deployIntegrationPlugins(appdir::AppDir& appDir, const fs::path& qtP // otherwise, when the directory doesn't exist, it might just copy all files to files called like // destinationDir auto destinationDir = appDir.path() / "usr/plugins" / subDir / ""; + if (i->path().extension() == ".debug") { + ldLog() << LD_DEBUG << "skipping .debug file:" << i->path() << std::endl; + continue; + } if (!appDir.deployLibrary(*i, destinationDir)) return false;