OK, bit of archaeology here... I'm trying to update an old project (mixing C++ and Swift) which dates back to Swift 3 / XCode 8 / OSX 10.11. I used User Migration to bring the whole user account onto a new Big Sur VM (11.4), then installed XCode 10.1 (the last version which could upgrade Swift 3 to 4) and started to build it.
I got a whole string of permission errors on files -- .h's which were created by the same user, and which were even present in other targets in the same project. These could largely be fixed by opening the files manually in xcode, and in one case explicitly adding it to the same target. Then at linking I started getting the same errors on my boost dylibs -- errno 1, operation not permitted.
I'm assuming this is a sandboxing issue -- so far granting XCode Full Disk Access seems to have gotten me past that problem. But is there a correct way of handling this?