Refactor how CI works in this repository#588
Conversation
There are a number of changes in this commit aimed at addressing WebAssembly#587 and making it easier to test WebAssembly#586 in CI. Notable changes here are: * The matrix of what to test is much different from before. One matrix entry now builds just one target and optionally tests that target. * The CI matrix ensures that wasi-libc builds on a variety of platforms, e.g. Windows/macOS/Linux as well as Linux aarch64. * The CI matrix has one entry for building with an older version of LLVM. This version was bumped from LLVM to LLVM 11 since LLVM is installed through `apt-get`, not through downloads any more. * On Linux LLVM/Clang are downloaded through `apt-get` instead of from llvm-project binaries to avoid dealing with `libtinfo5` and dependencies. * The CI matrix has a test job per-target. This can be expanded/shrunk as necessary but currently everything is tested with LLVM 16 (as before) and only on Linux (also as before). The test run is seqeunced to happen after the build of libc itself. * The CI matrix has split out V8 headless tests into their own job to avoid running multiple suites of tests in a single job. * Installation of LLVM is refactored to a separate action to reduce the noise in `main.yml`. * Setting `TARGET_TRIPLE` can now be done through environment variables as opposed to only through arguments to `make`. * Handling of `BULITINS_LIB` has improved. Previously the build target for `libc_so` would modify the compiler's resource directory and this is updated to use a custom directory in `OBJDIR`. * Arranging compiler-rt for tests is now done with `-resource-dir` instead of copying the directory into the system compiler's location. Overall it's the intention that no amount of testing is lost in this PR. The goal is to expand things out in such a way that it's much easier to add one-off tests of wasi-libc in various build configurations and such. The theory is that this is as "simple" as adding a new matrix entry, copied from previous ones, customized with various variables and environment variables to affect the build (e.g. `CFLAGS`). Closes WebAssembly#587
|
Oh, I forgot to also mention, but this deletes the |
|
Timing wise this is before this PR and this is this PR, summarized as:
|
Why do this is github is going to do it anyway? Isn't it maybe nice to be able to download the artifacts or a PR for local testing sometimes? |
|
Sure seems reasonable. I prefer to keep things out of CI where possible as it's generally not fun to read yml, but it's pretty small in this case and if it benefits someone it's not too much harm. The origins of this upload date back to 9580a25 and the original migration from Azure Pipelines to GitHub Actions FWIW. |
abrown
left a comment
There was a problem hiding this comment.
I think this is great! We could probably polish up the resource directory bits to only set up the resources needed for the currently-running job but, honestly, that can be done later. This is definitely a step forward.
sunfishcode
left a comment
There was a problem hiding this comment.
Agreed, this looks like a good step forward!
|
after this change, "CC=/opt/wasi-sdk-25.0/bin/clang make -j8 libc_so" doesn't work anymore. is it intended? it seems that, BUILTINS_LIB was set to the non-existent path (build/wasm32-wasi/resource-dir//lib/wasi/libclang_rt.builtins-wasm32.a) and i causes the "%.a" rule to generate an empty library. |
This reverts commit 48eb92c.
|
No that's not intentional. If you can figure out why that works on CI but doesn't work for you that'd be appreciated! |
This reverts commit 48eb92c.
because the ci supplies compiler-rt in a bit unusual way? wasi-libc/.github/workflows/main.yml Lines 158 to 160 in 553305f |
There are a number of changes in this commit aimed at addressing #587 and making it easier to test #586 in CI. Notable changes here are:
The matrix of what to test is much different from before. One matrix entry now builds just one target and optionally tests that target.
The CI matrix ensures that wasi-libc builds on a variety of platforms, e.g. Windows/macOS/Linux as well as Linux aarch64.
The CI matrix has one entry for building with an older version of LLVM. This version was bumped from LLVM to LLVM 11 since LLVM is installed through
apt-get, not through downloads any more.On Linux LLVM/Clang are downloaded through
apt-getinstead of from llvm-project binaries to avoid dealing withlibtinfo5and dependencies.The CI matrix has a test job per-target. This can be expanded/shrunk as necessary but currently everything is tested with LLVM 16 (as before) and only on Linux (also as before). The test run is seqeunced to happen after the build of libc itself.
The CI matrix has split out V8 headless tests into their own job to avoid running multiple suites of tests in a single job.
Installation of LLVM is refactored to a separate action to reduce the noise in
main.yml.Setting
TARGET_TRIPLEcan now be done through environment variables as opposed to only through arguments tomake.Handling of
BULITINS_LIBhas improved. Previously the build target forlibc_sowould modify the compiler's resource directory and this is updated to use a custom directory inOBJDIR.Arranging compiler-rt for tests is now done with
-resource-dirinstead of copying the directory into the system compiler's location.Overall it's the intention that no amount of testing is lost in this PR. The goal is to expand things out in such a way that it's much easier to add one-off tests of wasi-libc in various build configurations and such. The theory is that this is as "simple" as adding a new matrix entry, copied from previous ones, customized with various variables and environment variables to affect the build (e.g.
CFLAGS).Closes #587