contrib: fix macOS deployment with no translations #33482

pull amishhaa wants to merge 1 commits into bitcoin:master from amishhaa:macOS-build-fix changing 1 files +8 −8
  1. amishhaa commented at 5:35 am on September 26, 2025: contributor

    Description From what I deciphered reading the line https://github.com/bitcoin/bitcoin/blob/master/contrib/macdeploy/macdeployqtplus#L390 is that qt translations are optional to have hence we should be able to build without it but the case where the flag translations_dir falls back to its default Null value it raises this error.

    The config comments also mentioned that adding translation file is optional.

    0./macdeployqtplus --help
    1usage: macdeployqtplus [-h] [-verbose [VERBOSE]] [-no-plugins] [-no-strip] [-translations-dir path] [-zip zip] app-bundle
    2
    3Improved version of macdeployqt. Outputs a ready-to-deploy app in a folder "dist" and optionally wraps it in a .zip file. Note, that the "dist" folder will be deleted before deploying on each run. Optionally, Qt translation files
    4(.qm) can be added to the bundle.
    

    Steps to reproduce So I was following the general steps to set up app on macos however I didn’t download any qt translations presuming it was optional from the comment linkedin in PR, so to reproduce if you have translation directories in place ull need to delete them and then try to build the file, otherwise don’t download it at all and try to build it. It should fail on that flag as translations dir was never downloaded.

    Approach taken I have moved the code which adds language files under the if statement that first checks if the value of the flag is not Null before referencing it.

  2. contrib: fix using macdploy script without translations.
    QT translations are optional, but the script would error when
    'translations_dir' falls back to its default value NULL.
    
    This PR fixes it by moving the set-up of QT translations under
    the check for 'translations_dir' presence.
    7b5261f7ef
  3. DrahtBot added the label Scripts and tools on Sep 26, 2025
  4. DrahtBot commented at 5:35 am on September 26, 2025: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/33482.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK ismaelsadeeq

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  5. amishhaa commented at 5:36 am on September 26, 2025: contributor
    Refer PR: #33358 for previous discussions.
  6. fanquake renamed this:
    contrib: fix for macOS deployment build failing on Qt translations even though it is optional.
    contrib: fix macOS deployment with no translations
    on Sep 28, 2025
  7. ismaelsadeeq commented at 12:55 pm on October 2, 2025: member

    Thanks for attempting to contribute, welcome ðŸŠī

    The config comments also mentioned that adding translation file is optional.

    0abubakarismail@Abubakars-MacBook-Pro ~/D/W/b/b/c/macdeploy (master) [2]> ./macdeployqtplus --help
    1usage: macdeployqtplus [-h] [-verbose [VERBOSE]] [-no-plugins] [-no-strip] [-translations-dir path] [-zip zip] app-bundle
    2
    3Improved version of macdeployqt. Outputs a ready-to-deploy app in a folder "dist" and optionally wraps it in a .zip file. Note, that the "dist" folder will be deleted before deploying on each run. Optionally, Qt translation files
    4(.qm) can be added to the bundle.
    

    To help in attracting more review to this patch.

    Can you explicitly highlight the issue here, the steps you take to produce the error and whether or not it is reproducible.

    But overall It seems like an issue to me, and the right approach to fix it is taken here which is adding loading the translation file to the if branch that verifies the option has been added.

  8. ismaelsadeeq commented at 12:55 pm on October 2, 2025: member
    Concept ACK
  9. amishhaa commented at 2:30 pm on October 2, 2025: contributor
    hey @ismaelsadeeq ,Thank you for further highlighting that it is optional by the config comment, ill add this to the PR description as well and more details.
  10. ismaelsadeeq commented at 2:31 pm on October 3, 2025: member

    ACK 7b5261f7ef3d88361204c40eb10c0d9dc44f5ed7

    Makes sense to only {execute the translation available instructions} when a translation file is passed.

    On master

    0+ Adding Qt translations +
    1Traceback (most recent call last):
    2  File "/Users/abubakarismail/Desktop/Work/bitcoin-dev/bitcoin/contrib/macdeploy/./macdeployqtplus", line 465, in <module>
    3    translations = Path(config.translations_dir[0])
    4                        ~~~~~~~~~~~~~~~~~~~~~~~^^^
    5TypeError: 'NoneType' object is not subscriptable
    

    After 7b5261f7ef3d88361204c40eb10c0d9dc44f5ed7

    The build succeeds

    0Using install_name_tool:
    1 in dist/Bitcoin-Qt.app/Contents/PlugIns/styles/libqmacstyle.dylib
    2 change reference [@rpath](/bitcoin-bitcoin/contributor/rpath/)/QtCore.framework/Versions/A/QtCore
    3 to [@executable](/bitcoin-bitcoin/contributor/executable/)_path/../Frameworks/QtCore.framework/Versions/A/QtCore
    4+ Installing qt.conf +
    5dist/Bitcoin-Qt.app: replacing existing signature
    6+ Removing existing .zip +
    7+ Done +
    
  11. fanquake merged this on Oct 3, 2025
  12. fanquake closed this on Oct 3, 2025

  13. fanquake referenced this in commit f957c2171d on Oct 3, 2025
  14. fanquake commented at 2:42 pm on October 3, 2025: member
    Backported to 30.x in #33473.
  15. fanquake referenced this in commit 6b3c1dbc5c on Oct 3, 2025
  16. fanquake commented at 3:27 pm on October 3, 2025: member
    Backported to 29.x in #33534.
  17. glozow referenced this in commit 398c176ea8 on Oct 3, 2025
  18. fanquake referenced this in commit d5e0077bef on Oct 6, 2025
  19. fanquake referenced this in commit 78540df4da on Oct 7, 2025
  20. fanquake commented at 10:12 am on October 7, 2025: member
    Backported to 28.x in #33557.

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-10-19 00:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me