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.71k stars 197 forks source link

Building and running Terra on Termux #619

Closed romariorios closed 1 year ago

romariorios commented 1 year ago

I managed to build and run Terra on Termux1. All that was needed was:

This looks enough for me, but the LLVM 15 migration commit2 did a lot more than what I did. Is anything missing?

elliottslaughter commented 1 year ago

Hey, nice. Thanks for doing this.

If it builds and passes the test suite, that counts as working in my book.

Some LLVM releases do require more work, because LLVM does not promise backwards compatibility between releases. However, I am a fan of the approach of "build, and if it works, ship it". LLVM does occasionally have deprecations, but in my experience it's not really worth following up on them until they cause the build to break outright. Sometimes the "replacement" features don't really work yet (as has been the case in LLVM's ongoing migration to untyped pointers). In other cases, the "replacments" get removed themselves. (E.g., we skipped the ORCv1 migration entirely because we never switched to it.)

Of course, there is always the possibility of performance regressions, but I don't hold back releases for those. (First, whether any given chance is a regression or improvement depends on the given application. Second, these issues are often tricky to diagnose and follow up on, so it doesn't make sense to hold back merging (or even releases) for them.)

romariorios commented 1 year ago

Cool! Thanks for the quick response.

Looking closer, the only thing that seems to be missing is adding CI pipelines for LLVM 16, but I guess I can do that in a later PR. Can you point me to some sort of guide for that, though?

elliottslaughter commented 1 year ago

There are a couple of steps. I'm happy to do this, so you don't need to worry about it. But just FYI, here's what needs to be done:

  1. We need to build the new LLVM for all our platforms. I've got this going in CI here. This will probably take another 3-4 hours: https://github.com/terralang/llvm-build/actions/runs/4874851000
  2. After that we need to update the script here to support the new LLVM version: https://github.com/terralang/terra/blob/master/travis.sh#L43-L48 (note: we only do this for macOS due to #540 breaking LLVM > 11 on Windows)
  3. Then we need to update the GitHub Actions config to add LLVM 16 (note this requires multiple changes to add exclusions, etc.): https://github.com/terralang/terra/blob/master/.github/workflows/main.yml#L23
elliottslaughter commented 1 year ago

CI configuration is being tested in: https://github.com/terralang/terra/pull/623

I have one other fix pending in: https://github.com/terralang/terra/pull/624

After that, I think LLVM 16 is fully working.

elliottslaughter commented 1 year ago

Ok, merged both those PRs, so that's everything I can think of. Feel free to close this issue unless there is something else.

elliottslaughter commented 1 year ago

Closing since I haven't heard anything, but feel free to reopen if there is anything else.