Compiled module was created by an older version of the compiler

Hello, all.

Maybe this is really a stupid question. I met this error after I updated my Xcode:

compiled module was created by an older version of the compiler; rebuild 'Swift' and try again:

I don't know whether it's caused by updating Xcode. So I need to build-script -x to rebuild the project? It's really a long time work. And any suggestions to avoid this?

UPDATE: This problem has been fixed by rebuilding with build-script -x. It takes almost 6 hours with 2-core i5 CPU. Maybe I need a higher-performance Mac. :frowning:

It’s not much help now, but in the future you should be able to rebuild only the standard library (aka the ‘Swift’ module) in cases like this. If you chose the “Automatically generate schemes” option when opening the generated Xcode project, you should have a scheme for the standard library which can be rebuilt standalone. Then you should be able to continue incrementally building the compiler. Rerunning build-script is usually not necessary unless you ran update-checkout and it picked up changes to llvm or the build which require a clean recompile.

1 Like