exercism / purescript

Exercism exercises in PureScript.
https://exercism.org/tracks/purescript
MIT License
37 stars 32 forks source link

Including extra dependencies #235

Open tomasurbanec opened 2 years ago

tomasurbanec commented 2 years ago

Hello,

is it possible to include extra dependencies while uploading solutions through CLI client?

In this case I did the Acronym exercise locally using strings-extra (and it works just fine), but I have not found a way to include the extra dependency also during compilation in the exercism system.

I have tried uploading the spago.dhall and even the sources of releveant package from .spago but no success so far. (I remember that in the Haskell track it was possible to get the extra dependencies by uploading a cabal file together with the sources.)

To give some more information, the compilation ends with this error message:

purs compile: No files found using pattern: .spago/strings-extra/v3.0.1/src/**/*.purs Error found: in module Acronym Module Data.String.Extra was not found. Make sure the source file exists, and that it has been provided as an input to the compiler. See https://github.com/purescript/documentation/blob/master/errors/ModuleNotFound.md for more information, or to contribute content related to this error. [error] Failed to build.

So, the question is: is there a way to include the extra dependencies? And if not, is there anything I can do to help with this issue?

Thanks, Tom

tomasurbanec commented 2 years ago

Oh, now I noticed, that there is already issue with this topic (https://github.com/exercism/purescript/issues/186#issue-882345492). I am going to ask there. I am sorry for the unnecessary issue.:(

emiel commented 2 years ago

Thanks for sharing your experience @tomasurbanec and apologies for the late reply. This is valuable feedback as we've been trying to make a decision on this exact issue.

It is indeed the case that you currently cannot add any additional dependencies. The test runner runs in a sandbox and doesn't even have Internet connectivity meaning we can't install anything. We currently work with a fixed set of dependencies and if anything is missing we may add it to the default set.

You can solve the Acronym exercise without the use of strings-extra. Maybe we should make this a bit more clear before people start on the exercise that we currently have a limited set of dependencies. It's a bit of a bummer to complete the exercise locally and then realize it can't be accepted because we can't test it properly without the dependencies used.

I'm really curious how the Haskell track is able to install additional dependencies...

Anyway I'll continue this discussion on #186.

SleeplessByte commented 2 years ago

@emiel perhaps those are bundled in the solution. In JS/TS we also don't allow any dependencies, but technically you could "vendor bundle" them into your solution, and that would work. Does purescript have that option?