build: add data.h dependency to raw files #18265

pull kallewoof wants to merge 1 commits into bitcoin:master from kallewoof:2003-makefile-bench-data changing 1 files +1 −1
  1. kallewoof commented at 5:57 am on March 5, 2020: member

    In the (admittedly rare) cases where the bench data files (.raw) are generated differently e.g. through modifying the bench/data.h file, automake will fail to pick up on the fact the raw.h file(s) need to be regenerated, and the build will error, with something like this:

    0In file included from bench/data.cpp:10:0:
    1./bench/data/block413567.raw.h:1:40: error: conflicting declaration const unsigned char benchmark::data::block413567 []
    2 static unsigned const char block413567[] = {
    3                                        ^
    4In file included from bench/data.cpp:5:0:
    5./bench/data.h:14:35: note: previous declaration as const std::vector<unsigned char> benchmark::data::block413567
    6 extern const std::vector<uint8_t> block413567;
    7                                   ^~~~~~~~~~~
    
  2. build: add data.h dependency to raw files
    In the (admittedly rare) cases where the bench data files (.raw) are generated differently e.g. through modifying the bench/data.h file, automake will fail to pick up on the fact the raw.h file(s) need to be regenerated, and the build will error.
    c3157a2119
  3. fanquake added the label Build system on Mar 5, 2020
  4. laanwj commented at 10:17 pm on March 6, 2020: member

    I don’t think this dependency is correct—this would imply that generating the .raw.h depends on data.h, or that at least the generated files depend on it. That doesn’t seem to be the case.

    Can you give a more detailed example when this would be appropriate?

  5. kallewoof commented at 1:51 am on March 7, 2020: member

    That is exactly the thing, actually. The format of the outputted .raw.h file depends on the data.h file. Someone modified the type from a const char* to a std::vector and automake started spitting errors until you manually deleted the .raw.h file.

    You can see this by checking out and trying to compile 4db2f8cf0f63cf2a130e238d59f5b6032420f83d – and then switch back to master and try to compile again.

  6. laanwj commented at 3:13 pm on March 19, 2020: member
    Oh right, I get it then. Ideally the dependency would be on the script that generates the file, so that if the script changes, it is regenerated. But as it is inline, I guess a dependency on data.h is all you can do.
  7. kallewoof commented at 11:09 pm on July 13, 2020: member
    Don’t think anyone cares about this enough to keep it up.
  8. kallewoof closed this on Jul 13, 2020

  9. kallewoof deleted the branch on Jul 13, 2020
  10. jonatack commented at 5:11 am on July 14, 2020: member
    Hadn’t seen this. Code review ACK.
  11. adamjonas added the label Up for grabs on Mar 3, 2021
  12. DrahtBot locked this on Aug 16, 2022

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: 2024-12-21 15:12 UTC

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