Does anyone know if the source code for Swift CI bot (the one that responds to
@swift-ci please test requests) and general Jenkins configuration available for anyone to deploy locally or within their own organization?
Now before you ask "why would anybody need that?" let me describe the situation that we're in here with the port of Swift for WebAssembly (and I hope that people from the community working on other ports could relate).
Swift toolchain/SDK builds are huge and take a lot of time and disk space and need powerful hardware. It's not something that makes working on it locally a thrilling experience. This is caused by multiple issues that I don't see highlighted frequently (if at all) or actively worked on. I hope many iOS developers are familiar with long build times. Couple of years ago I started working on a huge iOS project in a big team, and cold builds of 3-5 minutes and incremental builds of 30-60 seconds were quite annoying to put it mildly. I now understand, that kind of developer experience was actually good when you compare it to something else here
I wanted to avoid strong words, but I don't know what's the better way to bring people's attention to this. In one of the previous episodes of ATP Marco Arment described working on Apple Watch apps as "moving through maple syrup that occasionally catches fire and burns you as you're in it [...], it's time-consuming and morale-sucking" because of how terrible and flaky the developer experience is. In my experience working on the Swift toolchain and SDK is like moving through a concrete sludge that's constantly on fire. A cold build takes at least half an hour on the top of the line MacBook Pro, and incremental builds frequently fail due to obscure reasons, in those cases it's easier to nuke the build directory and run a cold build again, just to verify if the build failure is an actual failure not caused by incremental builds. Yes, you can use caching, but after spending so much time before I discovered that tip, I think it should be at the top of
README.md, not hidden in the documentation file. A cold Linux build in Docker takes closer to an hour and setting it up so that the cache is not lost after exiting the container takes some time.
Don't get me wrong, I love the language, I love the community, but I feel like I'm contributing not because I enjoy the development process, but despite the way it's done. Just as a side note, by this point I think I had a dozen people email me asking how they can help with porting Swift to WebAssembly. I've sent back detailed build instructions with links to our repository and a list of known issues. Now I regret I didn't follow up with them, because the amount of hand-holding to make things right when working on the Swift toolchain is huge. Only two of them have actually contributed. And I realize I'm privileged by having a top of the line MacBook Pro, can you imagine people trying this on something like a MacBook Air? I'm not even talking about non-Apple hardware here.
Anyway, the main issue I've stumbled upon is setting CI up on GitHub Actions in our SwiftWasm fork. The problem is that GitHub runners are restricted in time (5 hours, but in reality I saw runners killed just after 3-4 hours) and disk space (18 gigs). An average build there takes about 2-4 hours without caching, and 1 hour for macOS, 2-3 hours on Linux with caching. We're pretty close to reaching the limits (even with release builds). We can't use self-hosted runnners because it's a public project, so I was thinking we could reuse some of the infrastructure from upstream? I wasn't able to find any documentation describing how Jenkins is set up and how it interacts with the Swift CI bot.
Given the overall development experience, I think documenting the CI setup is the least that could be done to make it easier for community contributors. Making the local development experience pleasant when developing locally is probably a whole another topic (and we had a few already here on Forums).