Closed bobvoorneveld closed 2 months ago
I haven't looked too deeply into the build system, but it sounds like you're having a similar problem to the one in this thread I found in the swift community, and this particular comment has a suggestion for how to write a Dockerfile for incremental builds. I'm not sure if you've already seen this or not, but I thought it might help.
@abstractJohn, I'll have a look. Wasn't succesful when trying to get intermediate builds, which is a shame. I'll give it another try!
I've tried, but I'm not familiar enough with swift + docker to get intermediate builds working. SwiftNIO is a big depencency that will create a long build time, which makes it hard to speed up compile times. I'm closing this PR, maybe someone else can create a PR in the future to make this possible. I've created a PR for Build Your Own Git and swift as an alternative, hopefully that will attract some swift developers that can help in the future.
Hmm, I'm struggling to get caching working here. Even after running
swift build
inside the dockerfile, compile times are 60s+.This'd make our test runners practically unusable - the longest I've seen for other languages is ~10s (Haskell, I think).
I suspect that we might need to do something hacky like we do for Rust here: https://github.com/codecrafters-io/build-your-own-redis/blob/c5b3c42749805e2013250bde363f0c46841afa2d/dockerfiles/rust-1.76.Dockerfile#L7-L21.
@bobvoorneveld ideas? I've pushed up one commit which was an attempt to incremental compilation working.