News for hackers. Stuff that matters.
Re:Kernel RCE in iOS/macOS with ICMP by derefr on Wednesday October 31, 2018 @08:13PM (#18350378)
Presumably, internally to Apple, XNU is built mostly on build-servers. Maybe even the branches having CI build-on-push, and test machines able to PXE-boot directly to a given branch's tip build. In such a case, you'd never need XCode to successfully build a standalone XNU at all.
Re:Kernel RCE in iOS/macOS with ICMP by throwabayhay on Wednesday October 31, 2018 @09:17PM (#18350699)
Nah. What you say is partly true, but I and others build xnu locally and incrementally all the time. Fast enough.
Re:Kernel RCE in iOS/macOS with ICMP by throwabayhay on Wednesday October 31, 2018 @09:25PM (#18350745)
If you want more details: Lots of parts are obviously pure C, but in my experience the C++ stuff is usually quite incremental as well. Changing a header included in lots of places is the obvious multiplier to build time.

Linking does take some time, but it’s only really noticeable if you do very incremental changes (e.g. change a single value, build, boot, repeat).

Overall, building a whole kernel from scratch even for multiple configurations is not unbearable during normal development.

Re:Kernel RCE in iOS/macOS with ICMP by TheDong on Wednesday October 31, 2018 @08:24PM (#18350445)
Developers of course never wish to compile a 5 line patch locally and launch a kernel in a VM to test it.

That's something practically every linux kernel dev does, but surely every time a XNU dev wants to add a single debug print statement, they'll go through the whole CI system before being able to run it.

Re:Kernel RCE in iOS/macOS with ICMP by derefr on Wednesday October 31, 2018 @08:29PM (#18350463)
If XNU can't be built incrementally (and, not having built it myself, I'm unsure whether it can, since it contains a large amount of C++), then it's going to take just as long, if not longer, to build it on your workstation, compared to going through the CI pipeline (with the beefy build-boxes.) So there's no disadvantage in a CI-only workflow in such a case.

IIRC Chrome has this workflow for this reason.

Re:Kernel RCE in iOS/macOS with ICMP by TheDong on Wednesday October 31, 2018 @09:26PM (#18350751)
Chromium absolutely does not only build that way.

I occasionally build chromium on my machine, and sure it takes two hours the first time, but incremental builds after that are only on the order of minutes.

C++ code can be incrementally compiled... Sure, it's not as good as in many other languages due to headers being so heavy, but it's still a massive reduction in total build time.

Re:Kernel RCE in iOS/macOS with ICMP by vlovich123 on Thursday November 01, 2018 @04:10AM (#18352073)
I promise you incremental builds are extremely important. A completely clean build of iOS/OSX years ago would take multiple days & I'm sure it's only gotten worse. The entire internal CI system relies on incremental builds working properly so that they can generate an internal iOS build every day for testing. It's possible it's disabled for certain projects but I doubt it. C++ in no ways alters the incremental build mechanism; all the problems of incremental builds it inherited from C's preprocessor. Speaking of, that's what C++ modules fixes (clang has support for C & C++ there although when I left only C projects had it on).