terralang / terra

Terra is a low-level system programming language that is embedded in and meta-programmed by the Lua programming language.
terralang.org
Other
2.72k stars 201 forks source link

Support for LLVM 10 and 11 #434

Closed elliottslaughter closed 3 years ago

elliottslaughter commented 4 years ago

This should now be working. There is a list of caveats below, but it's close enough that I'm going to merge and track remaining failures via issues.

Known issues at time of merge:

elliottslaughter commented 3 years ago

The remaining two issues seem to both be in C header includes:

elliottslaughter commented 3 years ago

I pushed a new set of patches that add support for LLVM 11. I was hoping this was going to fix some of the other broken tests in LLVM 10, but no luck.

One test I was able to work around, the others are marked as caveats in the top post of this PR.

elliottslaughter commented 3 years ago

I had to give up on macOS due to some sort of odd build error, but it's finally passing (modulo caveats above).

elliottslaughter commented 3 years ago

Actually, based on the error message it may be an issue with the LLVM binaries. It seems they now depend on having XCode installed:

make[2]: *** No rule to make target `/Applications/Xcode_12.0.0_fb.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/libxml2.tbd', needed by `bin/terra'.  Stop.

If that's the case this may go away if I build from source.

elliottslaughter commented 3 years ago

It's still failing with the binary I built on my local machine (though my local build works). Next step is to attempt to build on Github Actions itself (under the theory that the software setup should be compatible). It would suck if LLVM binaries are no longer sufficiently generic to be used everywhere, but if it gets CI passing it will at least be better than nothing.

elliottslaughter commented 3 years ago

The build is indeed successful when LLVM is built on Github Actions. I'm still getting issues including header files though, and the macOS image seems not to have the 10.15 SDK installed. So I think I'm stuck at this point.

At this point I'm frustrated enough with macOS that I'm going to go forward with the merge and leave the remaining items to be fixed at a future date.