|
| 1 | +# AppImage Build Fix Documentation |
| 2 | + |
| 3 | +## Issue Summary |
| 4 | + |
| 5 | +The Linux GLIBC 2.35 AppImage build was failing with the following error: |
| 6 | + |
| 7 | +``` |
| 8 | +cp: cannot stat '../../../../app_icon_256.png': No such file or directory |
| 9 | +``` |
| 10 | + |
| 11 | +## Root Cause |
| 12 | + |
| 13 | +The AppImage creation step in the GitHub Actions workflow had an incorrect relative path to the icon file. The script was running from `build/linux/x64/release/bundle` and trying to access `../../../../app_icon_256.png`, but the correct path requires going up 5 directory levels, not 4. |
| 14 | + |
| 15 | +### Path Analysis |
| 16 | + |
| 17 | +- **Working Directory**: `build/linux/x64/release/bundle` |
| 18 | +- **Target File**: `app_icon_256.png` (at project root) |
| 19 | +- **Incorrect Path**: `../../../../app_icon_256.png` (4 levels up) |
| 20 | +- **Correct Path**: `../../../../../app_icon_256.png` (5 levels up) |
| 21 | + |
| 22 | +### Directory Structure |
| 23 | + |
| 24 | +``` |
| 25 | +firefly-wallet-official/ ← Project root (where app_icon_256.png is) |
| 26 | +├── app_icon_256.png ← Target file |
| 27 | +├── build/ |
| 28 | +│ └── linux/ |
| 29 | +│ └── x64/ |
| 30 | +│ └── release/ |
| 31 | +│ └── bundle/ ← Current working directory |
| 32 | +``` |
| 33 | + |
| 34 | +## Changes Made |
| 35 | + |
| 36 | +### 1. Fixed Icon Path (`.github/workflows/xfg-wallet-desktop.yml`) |
| 37 | + |
| 38 | +**Before:** |
| 39 | +```yaml |
| 40 | +cp ../../../../app_icon_256.png fuego_wallet.png |
| 41 | +``` |
| 42 | + |
| 43 | +**After:** |
| 44 | +```yaml |
| 45 | +cp ../../../../../app_icon_256.png fuego_wallet.png |
| 46 | +``` |
| 47 | + |
| 48 | +### 2. Added Error Handling and Fallback |
| 49 | + |
| 50 | +The updated workflow now includes: |
| 51 | + |
| 52 | +- **File existence check** before copying |
| 53 | +- **Fallback location** check (assets/icons/) |
| 54 | +- **Error message** if icon not found |
| 55 | +- **Exit with error** if all locations fail |
| 56 | + |
| 57 | +```bash |
| 58 | +if [ -f ../../../../../app_icon_256.png ]; then |
| 59 | + cp ../../../../../app_icon_256.png fuego_wallet.png |
| 60 | +else |
| 61 | + echo "Warning: app_icon_256.png not found, checking alternate locations..." |
| 62 | + if [ -f ../../../../../assets/icons/app_icon_256.png ]; then |
| 63 | + cp ../../../../../assets/icons/app_icon_256.png fuego_wallet.png |
| 64 | + else |
| 65 | + echo "Error: Icon file not found!" |
| 66 | + exit 1 |
| 67 | + fi |
| 68 | +fi |
| 69 | +``` |
| 70 | + |
| 71 | +### 3. Created Dedicated Desktop File |
| 72 | + |
| 73 | +Created `linux/xfg-wallet.desktop` with proper formatting: |
| 74 | + |
| 75 | +```desktop |
| 76 | +[Desktop Entry] |
| 77 | +Version=1.0 |
| 78 | +Type=Application |
| 79 | +Name=XF₲ Wallet |
| 80 | +GenericName=Cryptocurrency Wallet |
| 81 | +Comment=Privacy-focused cryptocurrency wallet for XF₲ |
| 82 | +Exec=fuego_wallet |
| 83 | +Icon=fuego_wallet |
| 84 | +Terminal=false |
| 85 | +Categories=Finance;Network; |
| 86 | +Keywords=cryptocurrency;wallet;privacy;fuego;xfg; |
| 87 | +StartupWMClass=fuego_wallet |
| 88 | +StartupNotify=true |
| 89 | +``` |
| 90 | + |
| 91 | +### 4. Fixed Desktop File Generation |
| 92 | + |
| 93 | +The workflow now: |
| 94 | +1. Attempts to copy the dedicated desktop file from `linux/xfg-wallet.desktop` |
| 95 | +2. Falls back to generating one inline if the file doesn't exist |
| 96 | +3. Properly formats the inline desktop file (previous version had malformed EOF) |
| 97 | + |
| 98 | +## Verification |
| 99 | + |
| 100 | +### Local Testing |
| 101 | + |
| 102 | +To verify the path is correct: |
| 103 | + |
| 104 | +```bash |
| 105 | +cd firefly-wallet-official |
| 106 | +mkdir -p build/linux/x64/release/bundle |
| 107 | +cd build/linux/x64/release/bundle |
| 108 | +ls -la ../../../../../app_icon_256.png |
| 109 | +``` |
| 110 | + |
| 111 | +Expected output: File should be found and displayed. |
| 112 | + |
| 113 | +### CI/CD Testing |
| 114 | + |
| 115 | +The workflow will now: |
| 116 | +1. ✅ Find the icon file at the correct path |
| 117 | +2. ✅ Copy it to the bundle directory as `fuego_wallet.png` |
| 118 | +3. ✅ Create or copy a properly formatted desktop file |
| 119 | +4. ✅ Successfully create the AppImage with icon and metadata |
| 120 | + |
| 121 | +## Additional Improvements |
| 122 | + |
| 123 | +### Desktop File Quality |
| 124 | + |
| 125 | +The new desktop file includes: |
| 126 | +- **Version**: Specifies Desktop Entry version 1.0 |
| 127 | +- **GenericName**: Helps with categorization |
| 128 | +- **Keywords**: Improves searchability |
| 129 | +- **StartupWMClass**: Proper window management |
| 130 | +- **StartupNotify**: Visual feedback on launch |
| 131 | +- **Terminal=false**: GUI application indicator |
| 132 | + |
| 133 | +### Error Handling |
| 134 | + |
| 135 | +The workflow now provides clear error messages: |
| 136 | +- Warns when primary location fails |
| 137 | +- Lists alternate locations checked |
| 138 | +- Exits with error code if all locations fail |
| 139 | +- Makes debugging easier for future issues |
| 140 | + |
| 141 | +## Files Modified |
| 142 | + |
| 143 | +1. **`.github/workflows/xfg-wallet-desktop.yml`** |
| 144 | + - Fixed icon path from 4 to 5 directory levels |
| 145 | + - Added error handling and fallback logic |
| 146 | + - Improved desktop file generation |
| 147 | + - Better inline documentation |
| 148 | + |
| 149 | +2. **`linux/xfg-wallet.desktop`** (New File) |
| 150 | + - Created dedicated desktop entry file |
| 151 | + - Follows FreeDesktop.org standards |
| 152 | + - Includes all recommended fields |
| 153 | + |
| 154 | +## Testing Checklist |
| 155 | + |
| 156 | +Before merging, verify: |
| 157 | + |
| 158 | +- [ ] Icon file exists at project root: `app_icon_256.png` |
| 159 | +- [ ] Desktop file exists at: `linux/xfg-wallet.desktop` |
| 160 | +- [ ] Path calculation is correct (5 levels up from bundle) |
| 161 | +- [ ] CI/CD build completes successfully |
| 162 | +- [ ] AppImage is created with icon |
| 163 | +- [ ] AppImage shows proper metadata when inspected |
| 164 | + |
| 165 | +## Future Recommendations |
| 166 | + |
| 167 | +### Option 1: Use Absolute Path (Safer) |
| 168 | +Instead of relative paths, use `$GITHUB_WORKSPACE`: |
| 169 | + |
| 170 | +```bash |
| 171 | +cp $GITHUB_WORKSPACE/app_icon_256.png fuego_wallet.png |
| 172 | +``` |
| 173 | + |
| 174 | +### Option 2: Copy Icon During Build |
| 175 | +Add icon to bundle during Flutter build: |
| 176 | + |
| 177 | +```yaml |
| 178 | +- name: Copy icon to bundle |
| 179 | + run: | |
| 180 | + cp app_icon_256.png build/linux/x64/release/bundle/fuego_wallet.png |
| 181 | +``` |
| 182 | +
|
| 183 | +### Option 3: Include in Assets |
| 184 | +Add icon to Flutter assets and reference from there: |
| 185 | +
|
| 186 | +```yaml |
| 187 | +flutter: |
| 188 | + assets: |
| 189 | + - app_icon_256.png |
| 190 | +``` |
| 191 | +
|
| 192 | +## Related Issues |
| 193 | +
|
| 194 | +- Previous GLIBC error was unrelated (system library compatibility) |
| 195 | +- This fix addresses only the AppImage icon/desktop file issue |
| 196 | +- GLIBC compatibility is handled by the tar.gz artifacts |
| 197 | +
|
| 198 | +## Status |
| 199 | +
|
| 200 | +- **Fixed**: 2024-11-08 |
| 201 | +- **Tested**: Path verified locally |
| 202 | +- **Ready**: For CI/CD deployment |
| 203 | +- **Workflow**: `xfg-wallet-desktop.yml` |
| 204 | +- **Job**: `build-linux-compat` (GLIBC 2.35) |
| 205 | + |
| 206 | +## Contact |
| 207 | + |
| 208 | +For issues or questions about this fix, refer to: |
| 209 | +- Build logs in GitHub Actions |
| 210 | +- `BUILD_FIX_SUMMARY.md` - Dart compilation fixes |
| 211 | +- `LINUX_BUILD_FIXED.md` - General Linux build reference |
0 commit comments