haskell icon indicating copy to clipboard operation
haskell copied to clipboard

Show students what packages are available in the test runner

Open petertseng opened this issue 3 years ago • 5 comments

The test runner only has a limited set of packages, since it is forbidden from having internet access. If a student submits a package.yaml with a package that is not in that set, there will be an error. To give students a better idea of what packages the test runner has, instead of forcing them to resort to trial and error, the track documentation shown to the students should allow them to discover this. Suggestion for how to do this:

Add an explanation to https://github.com/exercism/haskell/blob/main/docs/TESTS.md#using-packages, containing the following points (which you can paraphrase or refine as necessary):

  • The available packages are those that come with GHC, listed in https://downloads.haskell.org/~ghc/9.0.1/docs/html/libraries/index.html, plus those that were added to the test runner, listed in https://github.com/exercism/haskell-test-runner/blob/main/pre-compiled/package.yaml.
  • If a package isn't on that list but you think it should be, send a pull request adding it to https://github.com/exercism/haskell-test-runner/blob/main/pre-compiled/package.yaml.

petertseng avatar Feb 06 '22 12:02 petertseng

I think this is the reason for my word count solution failing with the following error:

Cabal file info not found for regex-tdfa-1.3.1.0@sha256:bec13812a56a904ff3510caa19fe1b3ce3939e303604b1bcb3162771c52311ba,6324, updating
Selected mirror https://hackage.haskell.org/
Downloading root
HttpExceptionRequest Request {
  host                 = "hackage.haskell.org"
  port                 = 443
  secure               = True
  requestHeaders       = [("Accept-Encoding",""),("User-Agent","Haskell pantry package")]
  path                 = "/root.json"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 (ConnectionFailure Network.Socket.getAddrInfo (called with preferred socket type/protocol: AddrInfo {addrFlags = [AI_ADDRCONFIG], addrFamily = AF_UNSPEC, addrSocketType = Stream, addrProtocol = 0, addrAddress = <assumed to be undefined>, addrCanonName = <assumed to be undefined>}, host name: Just "hackage.haskell.org", service name: Just "443"): does not exist (Try again))

regex-tdfa is a fairly common package from what I can tell, and other tracks do allow for use of regex, so it's not philosophically banned either.

asarkar avatar Jul 07 '22 09:07 asarkar

@petertseng I submitted a PR a week ago, can any of the maintainers take a look?

asarkar avatar Jul 14 '22 08:07 asarkar

Now that I have addressed the above by approving the above PR, we should remember to keep discussion on topic. This issue is about updating the instructions, and discussions in this issue should be focused on that (e.g. questions about how to word the instructions or where exactly they should go, etc.) Discussions about specific packages to be added should be discussed by opening a PR in the haskell-test-runner repo or by a separate issue in this repo.

petertseng avatar Jul 14 '22 22:07 petertseng

Discussions about specific packages to be added should be discussed by opening a PR in the haskell-test-runner repo

Sure, but if a PR sits unattended for a week, then the author has no choice but to try and raise maintainers, by commenting in a ticket where a recommendation has been explicitly made to open such PR. Such a comment can’t be penalized or written off as irrelevant.

asarkar avatar Jul 14 '22 22:07 asarkar

Not to worry - no penalty has been applied that I am aware of, and if there is a penalty applied that I am not aware of, let this comment serve as my authorisation to rescind that penalty.

petertseng avatar Jul 15 '22 01:07 petertseng