-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add basic distcc and ccache support to haikuporter #185
base: master
Are you sure you want to change the base?
Conversation
Yeah, that won't be possible, we need to run Haiku-native binaries inside the chroot. |
resolver.injectDependency('Required by configuration', 'cmd:ccache') | ||
if Configuration.shallUseDistcc(): | ||
# pump needs its own switch and is out of my scope. | ||
# see https://preview.tinyurl.com/y32dmfrv -- possible breakage! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We really can't guarantee that sources/headers don't change during the build like that apparently requires, as there are lots of packages which do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. cmd:pump is the thing that really needs that to be true, so I didn't hook that up (and isn't functional without python3). There is still a chance that an overly-clever build script might try to invoke pump on its own volition, though, which is the scary part of that. I don't have an example of this happening, but compare to WebKit, which will detect and automatically use ld.gold if it is available (which would make linking fail on haikuwebkit, but doesn't exist right now so isn't specifically an issue)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see how the distcc stuff won't interfere with the chroot, i.e, the entire reason we use one is to mount packages into it that may not be on the host system.
The ccache stuff will almost certainly break under GCC2, and probably under more esoteric configurations with Clang or the like; it appears to be pretty fragile. So, this definitely can't be merged without substantial changes at the very least.
distcc preprocesses sources locally and sends the preprocessed header to the remote. So that's fine for header files, however you have to be really sure the compiler on the linux machines is the one you expect. I definitely would not use this in production (for our buildslaves) and clearly tag it as unsupported/"here be dragons"/"don't blame us if it breaks", but it seems ok for local builds, possibly |
I seem to recall that the Haiku target in GCC has some special sauce for object creation. So indeed this may produce subtly broken binaries... |
Right. BuildPlatform.py injects either or both commands as requirements for building, so it should suck them into the chroot and run them from there along with their dependencies. It (well, distcc) does require having an existing configuration, no way around that, although it gets copied into the chroot.
This bit's tricky. I haven't done any testing with gcc2 at all. In theory ccache likes gcc2 just fine, (it basically hashes input files and data about the environment, and stores the completed compilation for subsequent runs) but being ignorant of how it all fits together on 32bit systems I've just handed over what works on my box to see how it fares.
True. In the basic case, for example, if distcc is invoked as "gcc" and targets haiku, the volunteer system would call "gcc" and potentially target linux, and the build would fail. That bullet I believe I've dodged by specfiying the triplets, but there is the more horrible case of breaking differences in compiler versions, eg some potential incompatibility between gcc4 and gcc8, which I haven't accounted for. And on that note yeah that "being really sure" part makes it fragile like waddlespash was thinking, right.
And this is the thing that keeps me awake at night. That's magic to me and if you said that once a month it would require some kind of sacrifice or tribute I would take your word for it. Well, I hope that all makes sense. I really don't expect it to make it anywhere near big important production build systems or anything. It's scratched my itch for stuff at home and done something slightly unsual, so even if you hate it I hope you like it :-). I could make "Haikuporter - Roulette Edition" (this is a joke). Thanks for having a look, guys! I didn't think anyone had, and just checked on a whim. But, cheers! |
In any case, let us know what happens and if you encounter any issues with it! |
So, I don't know if you want this, but it works for me and if you have any feedback I am happy to clean it up further :-)