Problem
I’ve never been able to build Haiku from its Jamfile to completion. Now that I’ve forked WonderBrush v3 in an effort to create a glyph editor, I finally got my Haiku beta 4 32-bit VM set up to slowly build it. Much to my chagrin, Jam got stuck in an infinite loop. The -q option did nothing. There’s the problem: Jam is buggy.
Solutuion 1 Attempted
Last year in a Summer of Code project a student tried to build a Jam replacement called Ham. It was to be a Haiku-specific version of Jam. The project didn’t succeed.
Update Edit
After reading the final report on Ham it seems it was going to target Ninja build after all! I’ll have to give it a look!
My Tentative Proposal
Generate Ninja is used by Fuchsia and Chromium within Google as a frontend for Ninja build. If I understand correctly, it combines thousands of GN meta build files into a single .ninja file in the root directory of the project to allow multiple program builds to compile and link in parallel. It seems their goal is to take full advantage of big data center systems to cross-build and link all at once.
While Haiku’s systems are modest in comparison, old DDR3 based systems like mine are cheap to max out the RAM. Being able to build and link at the same time seems like an advantage. Also, Ninja’s build system is designed to throttle back if RAM starts to run low.
Potential Snags
There are a few ways to do this project:
- Put a Jamfile parser into GN or put GN’s backend into Jam.
- Write a Jamfile to GN converter.
- Find a more compatible system to target instead. (A last resort.)
- Fix Jam.
- Complete Ham.
License Compatibility
GN has 3-clause BSD and I don’t remember what Jam’s license is. For method 1 to work, the license must be legally compatible. If the licenses are incompatible, method 2 or later becomes more attractive.
Repairs
Methods 4 and 5 don’t require external code at all so there are no license incompatibilities at all but they are integrated all-in-one solutions. This makes debugging difficult and has failed before in Ham’s case.
Possible Migrations?
Methods 2 and 3 are only possibilities if there are migration paths available. I’d prefer to avoid migrating fully to GN outright because that puts Google software directly into our dependency chain. Adding to that, both a frontend and backend are necessary in the case of method 2. Method 3 depends on 2 also.
Closing Thoughts
I hope nobody is offended at my attempt to circumvent the shortcomings of Jam in an unconventional way. I just want code to work. Jam is pretty Haiku-specific already and offloading onto many hands seems attractive to me. Let me know your thoughts!
Edit
Ham section updated with link from Summer of Code final report. See above.