Skip to content

Conversation

hebasto
Copy link
Member

@hebasto hebasto commented Aug 15, 2025

While updating the translation source file for Transifex after #31296, I noticed that headers are not processed by the extract_strings_qt.py script.

Adding headers to build targets’ sources doesn’t seem like a good solution, because it would be hard to maintain, as CMake does not require the presence of headers in a target’s sources.

Notably, the translate build target differs from others in the following ways:

  1. It is intended to be used only during the release process.
  2. It modifies files in the source tree that are meant to be committed to the repository.
  3. No other build targets depend on it.

Considering the above, we can safely collect input files for processing by extract_strings_qt.py using the file(GLOB_RECURSE ...) command.

Required for #33193.

@hebasto hebasto added this to the 30.0 milestone Aug 15, 2025
@DrahtBot
Copy link
Contributor

DrahtBot commented Aug 15, 2025

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/33194.

Reviews

See the guideline for information on the review process.
A summary of reviews will appear here.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #33200 (cmake: Introduce translate.cmake script for translate target by purpleKarrot)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@purpleKarrot
Copy link
Contributor

There is nothing wrong with globbing per se.

The problem with globbing in the build analysis stage is that it is slows down each individual build.

The problem with globbing in the build system generator is that the result may be out of date when the build runs. This is the reason why globbing is discouraged in CMakeLists.txt files. Since CMake version 3.12, file(GLOB) supports a CONFIGURE_DEPENDS option, which inserts a check in the build analysis phase. This may give some robustness at the expense of performance.

Since the result of the glob is only used inside a single custom target, the best approach would be to actually perform the globbing inside the script that is run as the custom target. That means: either do it in the python script or add a cmake script.

@hebasto
Copy link
Member Author

hebasto commented Aug 16, 2025

Closing in favour of #33200.

@hebasto hebasto closed this Aug 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants