build: make translate not working correctly on macOS #16891

issue fanquake opened this issue on September 17, 2019
  1. fanquake commented at 4:12 AM on September 17, 2019: member

    While reviewing #16882 I noticed that make translate doesn't seem to be working completely correctly on macOS. It doesn't generate the changes to src/qt/bitcoinstrings.cpp. xgettext is available and picked up by ./configure.

    I tested on a Debian system instead, and everything work fine there (reproduces the changes in #16882), so I assume it's some macOS quirk.

  2. fanquake added the label Build system on Sep 17, 2019
  3. fanquake added the label good first issue on Sep 17, 2019
  4. D4nte commented at 11:16 AM on October 6, 2019: none

    My findings so far: gettext is not invoked when doing make translate on Mac os. This is because this task is not being triggered.

    On Ubuntu:

    $ make translate
      GEN      qt/bitcoinstrings.cpp
      GEN      translate
    [...]
    

    On Mac:

    $ make translate
      GEN      translate
    
  5. D4nte commented at 11:49 AM on October 6, 2019: none

    I was able to reproduce on ubuntu too:

    Running make -d:

       Finished prerequisites of target file `qt/bitcoinstrings.cpp'.
       Prerequisite `addrdb.cpp' is older than target `qt/bitcoinstrings.cpp'.
    ...
       Prerequisite `wallet/wallet.cpp' is older than target `qt/bitcoinstrings.cpp'.
    ...
      No need to remake target `qt/bitcoinstrings.cpp'.
    

    wallet/wallet.cpp is correctly checked.

    I was able to reproduce because I ran the command a first time, then reverted the changes with git checkout and reverted again.

    At this stage, I believe the issue may be related to the order on which the files are written when cloning or checking out the repository locally. I will need to spend more time looking at the filesystem stats for the files and understand how make decides what file is older than a target (mtime?) and whether this information is suppose to be preserved in git.

    In any case, as qt/bitcoinstrings.cpp is a generated file AND being checked in, I believe the best practice is to include it in .PHONY.

  6. D4nte commented at 8:17 PM on October 6, 2019: none

    Git is not supposed to preserve mtime https://git.wiki.kernel.org/index.php/ContentLimitations

  7. MarcoFalke commented at 8:41 PM on October 6, 2019: member

    Are the maintainer scripts supposed to be working on non-ubuntu? I think it is fine to not support macOS

  8. D4nte commented at 5:07 AM on October 7, 2019: none

    Are the maintainer scripts supposed to be working on non-ubuntu? I think it is fine to not support macOS

    According to my investigation this is not mac specific but due to the fact that a generated file is checked in yet not to be generated everytime a pre-requisite file is changed.

  9. laanwj closed this on Oct 8, 2019

  10. sidhujag referenced this in commit d5dfe39b08 on Oct 8, 2019
  11. DrahtBot locked this on Dec 16, 2021

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: 2026-04-14 18:14 UTC

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