Skip to content

Commit

Permalink
multiple deployers: Ignore .debug files
Browse files Browse the repository at this point in the history
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_.
  • Loading branch information
tdewey-rpi committed Jul 29, 2024
1 parent bcd597c commit 29bcebd
Show file tree
Hide file tree
Showing 13 changed files with 87 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/deployers/BearerPluginsDeployer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
5 changes: 5 additions & 0 deletions src/deployers/GamepadPluginsDeployer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
5 changes: 5 additions & 0 deletions src/deployers/LocationPluginsDeployer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
10 changes: 10 additions & 0 deletions src/deployers/Multimedia5PluginsDeployer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,23 @@ 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;
}

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;
}
Expand Down
5 changes: 5 additions & 0 deletions src/deployers/Multimedia6PluginsDeployer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
8 changes: 8 additions & 0 deletions src/deployers/PlatformPluginsDeployer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
5 changes: 5 additions & 0 deletions src/deployers/PositioningPluginsDeployer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
5 changes: 5 additions & 0 deletions src/deployers/PrintSupportPluginsDeployer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
10 changes: 10 additions & 0 deletions src/deployers/Qt3DPluginsDeployer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
5 changes: 5 additions & 0 deletions src/deployers/SqlPluginsDeployer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
5 changes: 5 additions & 0 deletions src/deployers/TlsBackendsDeployer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
15 changes: 15 additions & 0 deletions src/deployers/WaylandcompositorPluginsDeployer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 4 additions & 0 deletions src/deployment.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 29bcebd

Please sign in to comment.