basically the idea is that i'm going to turn every process spawn of clang (within this build tree) into an HTTP request to a predefined endpoint, which then gets submitted to an auto-scaling HTTP service. which makes LLVM builds faster
turns out, and this isn't a massive surprise, that my naive i-scribbled-it-in-an-evening solution is _hopelessly_ bottlenecked by the network. like, "average of 20 Mbps * N per -jN" level of bottlenecked
we aren't about to launch 50 concurrent builds when 5 saturate my uplink haha
@whitequark are there common things you're uploading for each build? A lot of distributed compilation systems wind up benefiting from an artifact cache where you upload things keyed by a content hash, and then just give the remote build process a list of hashes for it to fetch from the cache.
@malwareminigun classic "the proper way to build this software is to get a job at google but some alternative workarounds are available if that's not feasible" notice in this repo
the other reason not to reuse what bazel does is because i want the things i'm doing to not be like "only the exclusive club of software that someone applied the google build system to gets to enjoy the benefit"
architecturally, it is not necessary to envelope everything in an all-consuming blaze. you can just use cmake (if you are able to parse a compiler cmdline, or approximate it). and most people do not use, or want to use, or benefit from, the google build system
plus if it uses wasm for isolation then suddenly running a public instance becomes a viable and reasonable thing to do, which nobody in their right mind will do with bazel/goma/whatever
(i could, technically, conceivably reuse the _protocol_ while bolting my own software on both the sending and the receiving side. the protocol is basically good. however, it's large and complex, and like i mentioned, no part of bazel sparks joy. so why would i do this to myself)
@RoganDawes ccache doesn't help when i actually need to rebuild stuff. i already use it and all it does is make me neurotic about touching anything that triggers a full rebuild, like an otherwise irrelevant cflags change...
@mhoye so basically the architecture i have [partly impl'd, partly in mind] right now speculatively looks at everything path-like in the command line, then uploads all of it, runs the command on the server, then downloads all of it back (sped up by caching/dedup)
naturally if you have `-o foo.o` its hash will get uploaded, and then the server can return 304
@whitequark If you preload the remote with an rsync-type process, maybe you skip the "send everything over" part, or at least do it a bit at a time as you work?
@mhoye I think you have to send All Of The Headers at least once, but then you can shove them into S3 or something and basically never have to send them again ever (because the checksums match)
@mhoye (you have to do it At Least Once because i do not know upfront which files will be accessed by the compiler, and i'm consciously choosing to use an architecture which does not easily allow me to do so)
@whitequark Someone did this a few years back. They wrote an AWS Lambda that was clang. You needed to do the preprocessing locally, which limited the scaling.
The thing I pondered after seeing it was to make the local clone a file share that I could mount over CIFS and also mount in the function and make the build directory a similar share where only the final build products needed to be exported, so I could run the compiler and linker steps entirely as cloud functions. I didn’t every get around to implementing it, so I didn’t have a solution to things like TableGen.
@alwayscurious no software is completely bug-free but this particular risk becomes negligible compared to the more general issue of "do i trust someone else to compile things for me?"
@whitequark Using a compiler compiled to WebAssembly? WebAssembly runtimes do have vulnerabilities some of the time. Microsoft wrote a research paper about running WebAssembly modules in VMs.
@whitequark I'm clearly biased here, but the protocol is already used by other clients, like rec, BuildStream, Buck2. There's also a diverse ecosystem of backends, like BuildBuddy, Buildbarn, NativeLink, Buildfarm. I understand why people don't like Bazel, but the protocol is solid.