It takes so long to compile Bitcoin Core on my machine... I can't imagine trying to fix bugs like a missed semicolon and having to wait an hour for the compiler to finish before testing. Is this really what devs have to deal with? Or is there a way to just compile smaller units of the code and run it quickly over and over again until all the semi colons are fixed?
1 Answer
Initial compiling of bitcoin-core can take a couple of minutes. If you have a multicore processor, you can use make -j<cores+1>
to speed up compiling (parallel compiling).
Once bitcoin-core is compiled, a single semicolon change does (mostly) not require to recompile everything. You only compile the affected files (.cpp) again and do do the linking.
On most machines, compiling a simple change requires mostly less then 10 seconds.
-
4In addition, if you install ccache, Bitcoin Core's build process will make use of it, preventing recompilation even when going back to an earlier version of the file you've already compiled before. May 25, 2016 at 10:57
-
@PieterWuille and then you wait for the client to verify chain and sync before trying out your new expirimental OP code, etc.?– pinheadMay 25, 2016 at 15:54
-
Verifying the chain is not nearly sufficient for a proposed consensus rule change (which a new opcode is). We usually demand extensive use cases, unit/RPC tests, many reviews, and IRC meeting/mailinglist discussion for something like that. For non-consensus changes, things are simpler. May 25, 2016 at 16:16
make
, it only compiles the section you touched. Also, you can run it asmake -j 2
to get it to run on two cores at once.