Hello all,
My latest announcement on the project status was on the 17th august - cf. https://www.pmbaty.com/iosbuildenv/help/thread.php?path=Problem%20solving/&file=announcement-support-and-updates-will-be-delayed
November is here, and here is a long-awaited status update :-)
I have finished delivering a most critical contract (mostly unrelated, something around the QNX8 ecosystem) and now have some time to work on this project again.
Alright. I am assessing the situation like this :
- This toolchain need a major upgrade/rewrite that requires months of fulltime work, and it needs to happen quickly before Apple moves too far away,
- There are users of the current version of the tools who patiently await my support for weeks if not months.
Unfortunately I came to the conclusion that I won't be able to do both. I have to focus on what is the most important.
If I start reading all the support threads that require my attention (some for months) and invest my time trying to reproduce the problems (which involves downloading user-supplied Xcode projects, setting them up for building, build them in verbose/debug mode and scour the logs, try something, rebuild, try the next thing, rebuild, etc.) to provide a solution to each of them using the currently available tools, although I understand that would be the most desirable option for those who rely on this toolchain to get something done quickly, I will not have enough time to advance on rewriting the toolchain. For certain.
On the other hand, if I dedicate all my time to the much needed rewrite that I have planned, I leave my users down. This is not right, so if I choose to do this, then I should put all the sources and docs on a public repository so as to let a chance for the community to investigate the most important problems and provide patches and solutions. But if I release all my source codes to the wild wild web, the question of how to compensate (I'm not even talking about "funding") the development for the next version of this toolchain will immediately rise.
I am happy to witness that people are starting to help each other on this forum. It's a huge relief for me.
So, I am very attracted by the idea of open sourcing the whole thing and dedicating my time to proceed to the the necessary rewrite.
Yet, even if solving technical challenges that involve programming is my passion, the time I'm about to invest here will require some form of compensation to sustain the momentum. Else why not just accept other interesting programming contracts when I am offered some - considering that times are getting more and more challenging. So, before I go too far there I would like to know if it's going to be worth it: I don't want to chomp on my personal and social life for something that would prove useless or unsustainable.
Here is my (100% technical) vision for the future :
- The Apple build environment should be able to build *any* Xcode project and target *any* Apple ecosystem, not just iOS, from *any* OS (not just Windows) as long as the host sytem has virtualization support. People should be able to build Xcode projects for macOS, tvOS, visionOS, watchOS, etc., like if they were using xcodebuild on a Mac, but in a virtualized POSIX platform with these open source tools.
- For convenience, the toolchain would be distributed as a WSL2 (Windows Subsystem for Linux) transparent virtual machine, using the stock WSL2 Linux kernel supplied by Microsoft to optimize compatibility with the other WSL2 distributions already installed by the user, but this special distro would run a Darwin-compatible BSD userland (e.g. Chimera Linux, which uses the FreeBSD userland, much closer to macOS than the GNU tools are), and using a case-insensitive filesystem like macOS filesystems are.
- That system would be transformed in such a way that from a Xcode project's point of view, the typical folder hierarchy of a Mac (/Applications/Xcode.app/Contents/Developer, /Users/username, ~/Library, etc) would be present, and all the build tools that can be found on a Mac where Xcode is installed would be at identical locations (clang, plutil, ld64, codesign, etc).
- That system would provide the Apple branch of the open source LLVM compiler suite, built for this platform with all options enabled, and target an Apple system by default (just like the current toolchain does, but without the hinderances imposed by a Microsoft OS).
- All the current toolchain tools should be syntactically aligned with the Apple ones, so that they can be used as drop-in replacements in build scripts.
- The build process should take the Xcode project as input and output a codesigned, notarized, entitled deployable package (.ipa, .dmg, .app) and make it available on the user's host system (i.e. Windows). All the operations should be straightforward to perform, easier than with Xcode if possible.
- A master build script reproducing all the Xcode build steps, and able to interpret and run all the Mac tools that are present on macOS, but this time in the Chimera virtual machine, would be written in a standard scripting language that everybody can understand.
- Optional: it should be possible to upload a signed development version of a compiled app to an Apple target device for a debug session that would fire up a remote debug server with the appropriate credentials, expose a LLDB interface, and use the user's favourite IDE (as long as it can talk to a remote GDB/LLDB server, e.g. VSCode does that) to drop breakpoints and step-debug in the application source code.
- Things should be made properly and cleanly as much as possible, with diligence but without haste, to extend this project's life expectancy as far as possible. Every code block should be commented, every design choice should be justified.
It is straightforward. Really. I _already know exactly_ how to solve each and every one of the technical challenges that can be encountered in this roadmap. I already did proof of concepts for most of them.
Currently, I already have a custom Chimera Linux distribution in WSL2 which I am modifying to make it look like a macOS filesystem layout, and I am porting the build tools in it. There is work to do to align the tools names and syntaxes to the macOS ones, but it's going well. As for the case-insensitive filesystem problem, since the Linux kernel supplied by Microsoft for WSL2 doesn't support neither the ZFS filesystem nor Unicode-enabled ext4 (both would have been able to provide a "case insensitive" option), I took a few days to made a hook library that interfaces between the shell and the system's libc (using the well-known LD_PRELOAD trick), that remaps all pathnames that are passed through it by looking whether a corresponding case-insensitive equivalent exists first, and use that pathname instead when calling the real libc function. Roughly one hundred functions have been hooked this way. It works well, I am able to type things such as "cat /ETC/PASSWD" and it yields the contents of /etc/passwd for example. The advantage of such a hook library is that it has the potential to make *any* filesystem case-insensitive.
End of the technical part. Now comes the question of sustainability, because it's quite some work.
I am wondering whether a donation-based, crowdfunding-style contribution system could yield enough to compensate for the time, effort and resources I'd make into this. I am a passionate at work, but I have _zero_ experience with fundraising. This has never been an area of interest for me. And because I willingl<ctrl-left, delete> stupidly never put usage trackers nor telemetry stuff in my products (as astounding as it can sound these days), I am totally unable to assess the popularity of this toolchain _objectively_, i.e. with numbers, and thus unable to infer anything from unexistent statistics. Mind that I _do not even know_ how many people downloaded the Unity asset !
So, *I would like to call all of you who read this far and ask you, if you have some backed experience in fundraising for open source projects, or if you know some entity who's willing to sponsor that one, to contact me at my email address.* (pm at this domain). On anything technical, I think I'm good enough. On this, I don't even know where to start.
I hope I made an intelligible point here. Thank you for reading. Please spread the word where you think it could help. It's up to you :-)