Why is only the chrome binary stripped?

Asked by Maksim Ivanov

snapcraft.yaml runs eu-strip only for the chrome binary. Perhaps it'd make sense to apply it to other executables and also to shared libraries, to reduce the resulting artifact size?

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu chromium-browser Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
mickolo (project-helper-123) said (last edit ):
#2
Revision history for this message
mickolo (project-helper-123) said :
#3

Yes, it can be beneficial to apply `eu-strip` not only to the Chrome binary but also to other executables and shared libraries in your Snapcraft.yaml file. `eu-strip` (or `strip`) removes unnecessary debugging symbols and reduces the size of executables and libraries, which can improve the overall size and efficiency of your Snap package.

Here’s how you can apply `eu-strip` to other binaries and shared libraries in your Snapcraft.yaml:

1. **For Executables**:
   ```yaml
   parts:
     my-part:
       plugin: nil
       build-snaps: [your-build-snap]
       override-build: |
         snapcraftctl build
         find $SNAPCRAFT_PART_INSTALL -type f -executable -exec eu-strip {} +
   ```

2. **For Shared Libraries**:
   ```yaml
   parts:
     my-part:
       plugin: nil
       build-snaps: [your-build-snap]
       override-build: |
         snapcraftctl build
         find $SNAPCRAFT_PART_INSTALL -type f \( -executable -o -name "*.so*" \) -exec eu-strip {} +
   ```

In these examples:
- Replace `my-part` with the actual name of your part.
- `your-build-snap` should be replaced with the name of the Snapcraft plugin or Snap you are using.
- `eu-strip` is applied using `find` command to locate all executables https://worldanimalsfoundation.org/

 (`-type f -executable`) and optionally shared libraries (`-name "*.so*"`).

This approach ensures that `eu-strip` is applied broadly across your Snap package, optimizing the size of both binaries and shared libraries, thereby improving the overall efficiency and performance of your application.

Revision history for this message
Launchpad Janitor (janitor) said :
#4

This question was expired because it remained in the 'Open' state without activity for the last 15 days.