6 ms·
I really really want to like Bazel but I’m having issues with having the amount of bookkeeping I need to do in Bazel build files. And then someone comes along s
by spockz 4y ago
I really really want to like Bazel but I’m having issues with having the amount of bookkeeping I need to do in Bazel build files. And then someone comes along saying something along the lines of “oh but we just use <somecli>” to do the updating of Bazel for us… sometimes that is even internal tooling.
Something else is that most projects tend to build everything from source, even protobuf dependencies, so it takes me an hour to get the initial build of envoy done.
- withinboredom 4y agoI don’t know what it is these days, but I can remember waiting 12 hours to compile Chromium from scratch while the entire x-windows + KDE and friends taking only 4-5 hours to compile from scratch. This was back in 2014 on a little two core laptop.
- Cloudef 4y agoThe joys of c++
- FpUser 4y agoYou saying that if rewritten in Rust Chromium will compile much faster?
- Cloudef 4y agoNo, rust is another slow language to compile. But there are faster ones such as C and zig. You can reduce C++ compilation times by following certain strict coding conventions, but it only gets you so far.
- lloeki 4y agoin such large projects linking is also a severe bottleneck, which I hear has been repeatedly tried to be addressed with alternative linkers
- FpUser 4y agoI actually use C++ to write business backends. They're of decent size but nothing monstrous. Compile is almost always nearly instant for me. Full rebuild is still under a minute. Sure I use multithreaded build and am trying not to expose unneeded stuff in headers.
- est31 4y agoYou likely use "C with classes" C++, so C++03 for the most part, not the generics heavy C++ where you put everything into the header because it needs to be generic. This has massive advantages for compile time. Also "decent size" is a term with many definitions. E.g. Chromium has 12 million lines of C++.
- FpUser 4y ago>"You likely use "C with classes" I do write templates but not very often. Also when I do I try to consume those in a single file so that they could be declared there as well without propagating into a header. Not a good idea for writing libraries but works for applications. >"Chromium has 12 million lines of C++." I am far short of that of course.
- int_19h 4y agoBack in Gentoo days, I remember that the largest behemoth when it came to compile times was OpenOffice.
- boondaburrah 4y agoIn my gentoo days, chromium would take longer to compile then the rest of @world combined.
- _0w8t 4y agoOn ThinkPad X1 laptop with 8 hyperthreads it takes 6-7 hours to compile Chromium from sources these days.
- lloeki 4y agoparallelising the build helps, but RAM is also a big factor here since if you come short (which is more likely to happen when parallelising) swapping will make things grind. if you're lucky enough to have enough RAM to spare (which would be, like, a lot!) you can also build in a tmpfs ramdisk!
- _0w8t 4y agoThe laptop has 32 GB and the amount of RAM is not a limit here. With sufficiently fast SSD the storage is not a limiting factor either. Even RAM speed is not a big factor, it is still single thread performance that affects compilation speed for C++ most. Well, at least for the type of C++ that Chromium uses.
- ajconway 4y agoCould it be that the majority of those 12 hours were taken by running tests?
- withinboredom 4y agoNope. This was with Gentoo, no tests were run.
- antoinealb 4y agoChromium does not use Bazel, but GN. I would assume they still build most of their dependencies from source, as this is the way Google tends to setup build systems.
- lloeki 4y agoone of these being libv8, which can take quite some time itself. it can also be very memory consuming so as soon as you hit swap things slow down a lot.
- yodsanklai 4y ago> the amount of bookkeeping Any example?