codewars / docs

The Codewars Docs :construction: WIP
https://docs.codewars.com
MIT License
55 stars 191 forks source link

Add section on reproducing RISC-V Codewars runtime locally #440

Open DonaldKellett opened 1 year ago

DonaldKellett commented 1 year ago

Depends: #438

Solvers may wish to develop RISC-V solutions and/or translations locally. It isn't immediately obvious how to do so, since it differs from the native architecture of most consumer devices at the time of writing. At least it would be nice to mention that one does not need to purchase their own RISC-V SoC and load Linux on it in order to reproduce the Codewars environment locally ;-)

We could simply mention that Codewars uses ghcr.io/codewars/riscv for the execution environment and have the solver figure out the rest, but since it outputs Codewars output format which isn't very human-friendly, perhaps we should guide users on setting up a similar environment using the text reporter instead which gives human-friendly output, e.g. docker.io/donaldsebleung/cgreen

kazk commented 1 year ago

but since it outputs Codewars output format which isn't very human-friendly, perhaps we should guide users on setting up a similar environment using the text reporter instead which gives human-friendly output

I think we can change the main to use human-friendly output based on an environment variable or a flag. Then change bin/run to support it.

https://github.com/codewars/riscv/blob/0679125cdd8326acf398c617909a681e06191c71/workspace/tests.c#L6-L8

int main(int argc, char **argv) {
  return run_test_suite(solution_tests(), create_codewars_reporter());
}