exercism / sml

Exercism exercises in Standard ML.
https://exercism.org/tracks/sml
MIT License
27 stars 35 forks source link

Generating exercises currently requires online connection. #195

Closed kotp closed 2 years ago

kotp commented 2 years ago

While reviewing bin/generate updates in April 2022, I noticed that I could not rely on my local clone of problem-specifications but instead it hit the internet, which is highly unreliable, it is a dependency that is unnecessary. Instead, we should be working from local resources first, before needing to go out for the information.

[binary]: <urlopen error [Errno -3] Temporary failure in name resolution> is what I received as I was trying to generate the exercise, while reviewing.

rainij commented 2 years ago

I was surprised by that too. I wanted to add a test case to one of the sml exercises. The official way requires to add it to the corresponding canonical-data.json in the problem-specifications repo. Then one may pull in this new test-case by the bin/generate script. To test if the new test cases works I had to modify bin/generate temporarily to load my modified version of canonical-data.json (from my local repo). Of course this works but it is not nice.

I would like to know what the desired behavior should be. I agree to local first. So when I have a local checkout of problem-specifications I probably want to use it. If it is not there I may want to use the online version? Maybe the one or other ci-script (GitHub Actions) has a some special need? So should there be flag or something? Also should I assume a relative location when I have a local checkout?

I may have time to implement this (if this is desired). But I would like to gather some input, possibly from others as well. It does not need to be a detailed specification. If I have some input I may just propose something as a PR and one can discuss the details there.

kotp commented 2 years ago

It is possible and allowed for the tracks to add or not use tests from canonical-data.json, and even to have exercises for a track without having it in canonical-data.json if it is an exercise that is specifically suited for a language, or a concept exercise.


Also should I assume a relative location when I have a local checkout?

I think the locations should look like this:

problem-specifications
├── bin
├── exercises
└── patches
sml
├── bin
├── docs
├── exercises
└── lib

You can look at other repositories to see how this is referenced in regards to generation, and how github actions are set up per track for doing testing, and other checks.

rainij commented 2 years ago

Thanks for the clarifications @kotp . If nobody else opens a PR on this I try to do it by end of April.

kotp commented 2 years ago

Thank you, @rainij I reviewed it. Added another issue related to the executable as well, in terms of what is required to run it.

kotp commented 2 years ago

I think this is done. Closing it.