Ended up using chatgpt, it walked me through a ton of solutions. Turns out the swift on non Mac platforms does not respect the .cache directory in all phases. Was given a more specific version and the issues cleared up. During the build it was trying to use root.