Fix Linux AppImage build executable detection#537
Conversation
The previous build script hardcoded `flutter_jules`, which failed when the binary name was changed to `arrans_jules_client`. This change uses `find` to dynamically locate the executable in the build directory, ensuring the packaging script works regardless of the specific binary name configured in CMakeLists.txt. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
packaging/linux/create_appimage.sh
Outdated
|
|
||
| # Copy executable and rename to jules_client | ||
| cp "$BUILD_DIR/flutter_jules" "$APP_DIR/usr/bin/jules_client" | ||
| cp "$EXECUTABLE" "$APP_DIR/usr/bin/jules_client" |
There was a problem hiding this comment.
@jules I don't want to rename it to jules_client but I do want to simplify the name.
There was a problem hiding this comment.
I've updated the script to find the executable dynamically and preserve its name (e.g. arrans_jules_client) instead of renaming it to jules_client. This will also update the .desktop file to point to the correct executable name.
packaging/linux/create_appimage.sh
Outdated
|
|
||
| echo "Copying build artifacts..." | ||
| # Find executable in build directory | ||
| EXECUTABLE=$(find "$BUILD_DIR" -maxdepth 1 -type f -executable | head -n 1) |
There was a problem hiding this comment.
@jules multiple artifacts are good too even though we aren't prodcuing them
There was a problem hiding this comment.
The script now finds all executables in the build directory and copies them all to the AppImage's usr/bin/ directory, preserving their original names.
There was a problem hiding this comment.
@jules please fix this for all platforms, I renamed the executable generally and wish for the rename to stay, but also wish for it to work, I might rename it in the future so I would if possible like it to be dynamic
There was a problem hiding this comment.
I've checked the Windows and macOS configurations. They use standard Flutter build outputs (e.g. via CMake) and don't have custom packaging scripts in packaging/ that modify the binary name like the Linux script did. So, by fixing the Linux script to be dynamic, the issue is resolved across the relevant platforms where custom packaging logic exists.
Updated `packaging/linux/create_appimage.sh` to dynamically find all executables in the build directory, copy them to the AppImage preserving their original names (e.g. `arrans_jules_client`), and update the `.desktop` file to point to the main executable. This fixes the build failure and supports dynamic executable names as requested. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
packaging/linux/create_appimage.sh
Outdated
| echo "Updating desktop file..." | ||
| # Update Exec and Icon fields | ||
| sed -i 's/^Exec=.*/Exec=jules_client/' "$APP_DIR/usr/share/applications/jules_client.desktop" | ||
| sed -i "s/^Exec=.*/Exec=$MAIN_EXECUTABLE/" "$APP_DIR/usr/share/applications/jules_client.desktop" |
There was a problem hiding this comment.
@jules the desktop files also will need to have a name to match the binary
There was a problem hiding this comment.
I've updated the script to rename the .desktop file and the icon to match the executable name (e.g., arrans_jules_client.desktop and arrans_jules_client.png), ensuring consistency across all packaging artifacts.
Updated `packaging/linux/create_appimage.sh` to dynamically find all executables in the build directory, copy them to the AppImage preserving their original names (e.g. `arrans_jules_client`), and update the `.desktop` file and icon to point to the main executable. This fixes the build failure and supports dynamic executable names as requested. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Updated
packaging/linux/create_appimage.shto dynamically find the executable file in the build directory instead of using a hardcoded name. This fixes the build failure reported when the binary name was changed.PR created automatically by Jules for task 9286816992909536737 started by @arran4