Add advice to productivity.md on:
- Using ccache to optimal effect
- The with-incompatible-bdb configure option
- Building less than the entire set of targets
Add advice to productivity.md on:
63 | @@ -51,6 +64,12 @@ If you have multiple threads on your machine, you can tell `make` to utilize all 64 | make -j"$(($(nproc)+1))" 65 | ``` 66 | 67 | +### Only build what you need 68 | + 69 | +When rebuilding incrementally while developing, be aware that running `make` with no targets will do a _vast_ amount of work, most of which you probably don't care about. In particular, it will build the GUI (unless you've disabled it) and all the tests (which take a significant multiple of the time to build the application itself.) 70 | + 71 | +Obviously it is important to build and run the tests at appropriate times -- but when you just want a quick compile to check your work, consider `make src/bitcoind` or similar.
Could mention that can make multiple targets and/or give more examples:
make -j src/bitcoind src/bitcoin-climake -j src/qt/bitcoin-qtmake -j -C src bitcoin_benchDone!
Nice.
Concept ACK.
I am deeply concerned that it took me three pushes to correctly spell the word "development".
Added some examples of build targets per promag. Reworded some of my prose to make it less wordy, abstruse, verbose, talkative, lengthy, long-winded, loquacious, etc.
ACK c018b918bdd23377bd3aeaa88e09928299a780f0
38 | +``` 39 | +max_size = 50.0G # or whatever cache size you prefer; default is 5G; 0 means unlimited 40 | +base_dir = /home/yourname # or wherever you keep your source files 41 | +``` 42 | + 43 | +Note: base_dir is required for ccache to share cached compiles of the same file across different repositories / paths; it will only do this for paths under base_dir. So this option is required for effective use of ccache with git worktrees (described below.)
nit, here and below should be )., not .)?
Even though the way I did it is clearly grammatically not sensible, for some reason I thought it was normal, so I polled some of my friends on IRC and it turns out I'm the only person I know who does it this way. Personal quirk, I guess? Will fix.
There are more cases below.
Heh, fixed two more instances.
ACK c018b91.
I have no idea what's up with Travis but I'm pretty sure I didn't do it.
I think this should be mergeable.
Add advice to productivity.md on:
- Using ccache to optimal effect
- The with-incompatible-bdb configure option
- Building less than the entire set of targets
utACK 5801dd6.
32 | @@ -32,6 +33,17 @@ Install `ccache` through your distribution's package manager, and run `./configu 33 | 34 | To use ccache for all your C/C++ projects, follow the symlinks method [here](https://ccache.samba.org/manual/latest.html#_run_modes) to set it up. 35 | 36 | +To get the most out of ccache, put something like this in `~/.ccache/ccache.conf`: 37 | + 38 | +``` 39 | +max_size = 50.0G # or whatever cache size you prefer; default is 5G; 0 means unlimited
I'd rather not bikeshed, but is there any reason to increase this over the default? I never touched this and it seems to work fine. Increasing it too much means you'd have files laying around that are outdated at some point anyway, because your distributions compiler got updated in the meantime.
I guess it could be relevant when you compile more than one project regularly?
FWIW I don't compile anything other than different branches of bitcoin core, and I've only been using it a couple months, and my cache is currently 12.5 GB. I increased it because even just testing it on 2-3 branches of core, I was seeing it start to fill significantly. I think 5 GB is just a ludicrously puny size in the modern era of storage. I feel pretty happy about 50 currently, and you're right that there are decreasing marginal benefits at some point (but I think 5 GB is WAY below that point, and doesn't feel like a sensible default for ccache to have.)
utACK 5801dd6