Page MenuHomePhabricator

[CMAKE] Build a stripped version of the application bundle and use it

Authored by Fabien on Nov 7 2019, 15:12.


Group Reviewers
Restricted Project

This adds a variant target to build a stripped application bundle. This
stripped version will be used for building the DMG image.
This is necessary because the macdeployqt tools will strip everything
but the input application.

Depends on D4384.

Test Plan
ninja BitcoinABC-Qt
ls -l src/qt/

Note the size of the binary.

ninja BitcoinABC-Qt-strip
ls -l src/qt/

Check the binary size decreased.

ninja osx-dmg # Sanity check

Diff Detail

rABC Bitcoin ABC
Lint OK
No Unit Test Coverage
Build Status
Buildable 8023
Build 14043: Bitcoin ABC Buildbot (legacy)
Build 14042: arc lint + arc unit

Event Timeline

Fabien created this revision.Nov 7 2019, 15:12
Herald added a reviewer: Restricted Project. · View Herald TranscriptNov 7 2019, 15:12
deadalnix requested changes to this revision.Nov 10 2019, 13:05
deadalnix added inline comments.

Considering this is something that is OSX specific, the names chosen are very confusing. It seems that this an OSX duplication of the bitcoin-qt target. You need to fix this before proceeding.

This revision now requires changes to proceed.Nov 10 2019, 13:05
deadalnix added inline comments.Nov 10 2019, 13:27

This doesn't looks like the original command. Can you explain what's up?

It looks like it is modifying the file in place, which is usually a bad idea for dependency management reasons.

Fabien requested review of this revision.Nov 10 2019, 15:42
Fabien added inline comments.

I should have put a comment regarding the name: this is for compatibility with what autotools produce (and what the content from the metadata file expects). This does not apply to the stripped target though, but it keeps the name consistent with the non stripped target.

The strip parameters are specific to the OSX strip tool, which differ from the gnu strip. Unfortunately I have been unable to find a man page online, I had to run the man from an OSX machine. The parameters are the same that recent CMake versions use for executables, you can find some infos here:

Yes it is modifying the file in place and is then exclusive with the non stripped version.
The same principle applies when installing the files with CMake, you can have the binaries stripped or not, but not both at a time.
The only dependencies are the files for building an installer, which will always require a stripped binary. I could have copied the bundle structure and stripped the duplicated binary to avoid this, but I don't see a use case for having both. Let me know if you think this is an issue, and I'll update.

Fabien planned changes to this revision.Nov 11 2019, 09:33

I have another solution which can be more elegant to this problem, so moving this diff out of the review queue for now.

Fabien abandoned this revision.Nov 18 2019, 12:23

Superseded by D4438.