New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: regenerate bitcoin-config.h as necessary #10228
Conversation
These were meant to help build subdir targets from the top builddir, but cause infinite recursion when going the other way. If anyone actually uses these, we can add back specific targets.
This was a long-standing and annoying problem. If autogen.sh was not manually run after touching configure.ac, bitcoin-config.h would not be properly regenerated. This causes very subtle problems when configure appears to enable a new value, but it does not end up reflected in the build.
Which ones does this prevent use of? I use |
@laanwj Only obscure targets. The bins are still listed there explicitly: https://github.com/bitcoin/bitcoin/blob/master/Makefile.am#L165, so |
Sounds good to me then. |
Something that makes me wonder: shouldn't the entire process re-run when configure.ac is touched? Or is that the effect of this - was autoheader the only step missing for that? |
Yes, that should be the case now. For some reason automake doesn't push the autoheader rules down to subdirs, so it was never re-triggered if you build from src/. Thinking about it now, we should probably backport this for 0.14.2 as well, since switching branches is one of the most common ways this problem can show up. |
Good point - I don't switch branches anymore for this reason (among others). I just have a git-worktree checkout per branch. |
utACK 91ab8f5 |
Any idea why we need to explicitly do this? Normally autotools takes care of it automagically... |
Concept ACK |
@luke-jr I'm not sure. I suppose it's just an autotools bug that they don't generate the rules for subdirs. |
91ab8f5 build: fix bitcoin-config.h regeneration after touching build files (Cory Fields) 3577603 build: remove wonky auto top-level convenience targets (Cory Fields) Tree-SHA512: 2e68634439eeb7eca43cd2858135a583bfe0cf146e021a8384a24f7267aacc6f99bdc7a6d497a04d32e6a03e9446f0f599afb5bd53346dadf19f47d5fb2ea9f9
91ab8f5 build: fix bitcoin-config.h regeneration after touching build files (Cory Fields) 3577603 build: remove wonky auto top-level convenience targets (Cory Fields) Tree-SHA512: 2e68634439eeb7eca43cd2858135a583bfe0cf146e021a8384a24f7267aacc6f99bdc7a6d497a04d32e6a03e9446f0f599afb5bd53346dadf19f47d5fb2ea9f9
91ab8f5 build: fix bitcoin-config.h regeneration after touching build files (Cory Fields) 3577603 build: remove wonky auto top-level convenience targets (Cory Fields) Tree-SHA512: 2e68634439eeb7eca43cd2858135a583bfe0cf146e021a8384a24f7267aacc6f99bdc7a6d497a04d32e6a03e9446f0f599afb5bd53346dadf19f47d5fb2ea9f9
91ab8f5 build: fix bitcoin-config.h regeneration after touching build files (Cory Fields) 3577603 build: remove wonky auto top-level convenience targets (Cory Fields) Tree-SHA512: 2e68634439eeb7eca43cd2858135a583bfe0cf146e021a8384a24f7267aacc6f99bdc7a6d497a04d32e6a03e9446f0f599afb5bd53346dadf19f47d5fb2ea9f9
91ab8f5 build: fix bitcoin-config.h regeneration after touching build files (Cory Fields) 3577603 build: remove wonky auto top-level convenience targets (Cory Fields) Tree-SHA512: 2e68634439eeb7eca43cd2858135a583bfe0cf146e021a8384a24f7267aacc6f99bdc7a6d497a04d32e6a03e9446f0f599afb5bd53346dadf19f47d5fb2ea9f9
91ab8f5 build: fix bitcoin-config.h regeneration after touching build files (Cory Fields) 3577603 build: remove wonky auto top-level convenience targets (Cory Fields) Tree-SHA512: 2e68634439eeb7eca43cd2858135a583bfe0cf146e021a8384a24f7267aacc6f99bdc7a6d497a04d32e6a03e9446f0f599afb5bd53346dadf19f47d5fb2ea9f9
91ab8f5 build: fix bitcoin-config.h regeneration after touching build files (Cory Fields) 3577603 build: remove wonky auto top-level convenience targets (Cory Fields) Tree-SHA512: 2e68634439eeb7eca43cd2858135a583bfe0cf146e021a8384a24f7267aacc6f99bdc7a6d497a04d32e6a03e9446f0f599afb5bd53346dadf19f47d5fb2ea9f9
91ab8f5 build: fix bitcoin-config.h regeneration after touching build files (Cory Fields) 3577603 build: remove wonky auto top-level convenience targets (Cory Fields) Tree-SHA512: 2e68634439eeb7eca43cd2858135a583bfe0cf146e021a8384a24f7267aacc6f99bdc7a6d497a04d32e6a03e9446f0f599afb5bd53346dadf19f47d5fb2ea9f9
Summary: 91ab8f5 build: fix bitcoin-config.h regeneration after touching build files (Cory Fields) 3577603 build: remove wonky auto top-level convenience targets (Cory Fields) Tree-SHA512: 2e68634439eeb7eca43cd2858135a583bfe0cf146e021a8384a24f7267aacc6f99bdc7a6d497a04d32e6a03e9446f0f599afb5bd53346dadf19f47d5fb2ea9f9 Backport of Core PR10228 bitcoin/bitcoin#10228 Test Plan: cd build/ make clean rm src/config/stamp-h1 rm src/config/bitcoin-config.h make check ls src/config/ `make check` should build successfully and `bitcoin-config.h` and `stamp-h1` files should be present in `build/src/config/`. Reviewers: deadalnix, Fabien, jasonbcox, markblundeberg, O1 Bitcoin ABC, #bitcoin_abc Reviewed By: deadalnix, O1 Bitcoin ABC, #bitcoin_abc Differential Revision: https://reviews.bitcoinabc.org/D3384
Summary: 91ab8f5 build: fix bitcoin-config.h regeneration after touching build files (Cory Fields) 3577603 build: remove wonky auto top-level convenience targets (Cory Fields) Tree-SHA512: 2e68634439eeb7eca43cd2858135a583bfe0cf146e021a8384a24f7267aacc6f99bdc7a6d497a04d32e6a03e9446f0f599afb5bd53346dadf19f47d5fb2ea9f9 Backport of Core PR10228 bitcoin/bitcoin#10228 Test Plan: cd build/ make clean rm src/config/stamp-h1 rm src/config/bitcoin-config.h make check ls src/config/ `make check` should build successfully and `bitcoin-config.h` and `stamp-h1` files should be present in `build/src/config/`. Reviewers: deadalnix, Fabien, jasonbcox, markblundeberg, O1 Bitcoin ABC, #bitcoin_abc Reviewed By: deadalnix, O1 Bitcoin ABC, #bitcoin_abc Differential Revision: https://reviews.bitcoinabc.org/D3384
Summary: 91ab8f5 build: fix bitcoin-config.h regeneration after touching build files (Cory Fields) 3577603 build: remove wonky auto top-level convenience targets (Cory Fields) Tree-SHA512: 2e68634439eeb7eca43cd2858135a583bfe0cf146e021a8384a24f7267aacc6f99bdc7a6d497a04d32e6a03e9446f0f599afb5bd53346dadf19f47d5fb2ea9f9 Backport of Core PR10228 bitcoin/bitcoin#10228 Test Plan: cd build/ make clean rm src/config/stamp-h1 rm src/config/bitcoin-config.h make check ls src/config/ `make check` should build successfully and `bitcoin-config.h` and `stamp-h1` files should be present in `build/src/config/`. Reviewers: deadalnix, Fabien, jasonbcox, markblundeberg, O1 Bitcoin ABC, #bitcoin_abc Reviewed By: deadalnix, O1 Bitcoin ABC, #bitcoin_abc Differential Revision: https://reviews.bitcoinabc.org/D3384
Summary: 91ab8f5 build: fix bitcoin-config.h regeneration after touching build files (Cory Fields) 3577603 build: remove wonky auto top-level convenience targets (Cory Fields) Tree-SHA512: 2e68634439eeb7eca43cd2858135a583bfe0cf146e021a8384a24f7267aacc6f99bdc7a6d497a04d32e6a03e9446f0f599afb5bd53346dadf19f47d5fb2ea9f9 Backport of Core PR10228 bitcoin/bitcoin#10228 Test Plan: cd build/ make clean rm src/config/stamp-h1 rm src/config/bitcoin-config.h make check ls src/config/ `make check` should build successfully and `bitcoin-config.h` and `stamp-h1` files should be present in `build/src/config/`. Reviewers: deadalnix, Fabien, jasonbcox, markblundeberg, O1 Bitcoin ABC, #bitcoin_abc Reviewed By: deadalnix, O1 Bitcoin ABC, #bitcoin_abc Differential Revision: https://reviews.bitcoinabc.org/D3384
91ab8f5 build: fix bitcoin-config.h regeneration after touching build files (Cory Fields) 3577603 build: remove wonky auto top-level convenience targets (Cory Fields) Tree-SHA512: 2e68634439eeb7eca43cd2858135a583bfe0cf146e021a8384a24f7267aacc6f99bdc7a6d497a04d32e6a03e9446f0f599afb5bd53346dadf19f47d5fb2ea9f9
This fixes issues like #10140 and #10209.
The cause is that #9921 introduced new defines, but without re-running autogen.sh, they wouldn't be found. This change makes sure that autoheader is re-run (as it's supposed to be) any time configure.ac is touched.
Also, this undoes #4322, as it would introduce an infinite loop otherwise. I suspect that these convenience targets get very little use anymore, but we can always add back hard-coded ones if necessary.