Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't download library from Hackage #1065

Closed
a12l opened this issue May 2, 2022 · 11 comments · Fixed by exercism/haskell-test-runner#49
Closed

Can't download library from Hackage #1065

a12l opened this issue May 2, 2022 · 11 comments · Fixed by exercism/haskell-test-runner#49

Comments

@a12l
Copy link

a12l commented May 2, 2022

When I submit my solution to a Haskell exercise, I get an error message in the Tests tab.

The solution works flawlessly on my computer, and the library's source code hasn't changed in two years.

Cabal file info not found for multiset-0.3.4.3@sha256:968192524bd38ffa29856e1e3f9f6f8a5704f98899d4b25f8ebd425001594f61,1790, 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))

My package.yaml file

name: anagram
version: 1.4.0.8

dependencies:
  - base
  - text
  - containers
  - multiset

library:
  exposed-modules: Anagram
  source-dirs: src
  ghc-options: -Wall
  # dependencies:
  # - foo       # List here the packages you
  # - bar       # want to use in your solution.

tests:
  test:
    main: Tests.hs
    source-dirs: test
    dependencies:
      - anagram
      - hspec

The library's Cabal file is can be found here: https://github.com/twanvl/multiset/blob/master/multiset.cabal, and the library is listed on Hackage here: https://hackage.haskell.org/package/multiset

@a12l a12l changed the title Problem Can't download library from Hackage May 2, 2022
@NobbZ
Copy link
Member

NobbZ commented May 2, 2022

In general the Testrunner does not have any internet connectivity. You have to solve the exercise with the libraries available in the runner.

@glennj
Copy link

glennj commented May 2, 2022

On the other hand, and I assume you're using the exercism CLI, you could be satisfied that the solutions are passing on your computer and live with test runner failures. I do this on the Perl5 track where I use modules that aren't installed in the test runner. I've learned to accept the shame of the public failure status on my published solutions.

@a12l
Copy link
Author

a12l commented May 3, 2022

In general the Testrunner does not have any internet connectivity. You have to solve the exercise with the libraries available in the runner.

From the Haskell Anagram exercise

[...]
Later, it may be a good idea to revisit this problem and play with other data types and libraries:

  • Text, from package text.
  • Sequence and Set, from package containers.
  • MultiSet, from package multiset

[...]

It explicitly says that I should be able to use the library.

@NobbZ
Copy link
Member

NobbZ commented May 3, 2022

It says that you might want to play with those libs, not that you will be able to use them on the test runner.

Indeed though I have to be honest. The wording is unfortunate. And perhaps the testrunner can be adjusted to allow usage of those packages, or wording can be adjusted to explicitely warn that submissions using those libs will fail on the test runner?

@exercism/haskell any opinion on this?

@a12l
Copy link
Author

a12l commented May 3, 2022

It says that you might want to play with those libs, not that you will be able to use them on the test runner.

But the text and the containers packages is available in the environment? I haven't looked at all the Haskell exercises, but both text and containers have never been required, but just been available to "play with".

And for someone that use the live editor, how is one supposed to "play with" multiset if you can't even compile your program? It's like to teach someone programming by giving them a reference book with a pen and paper, but never tell them if what they write even make sense. Feedback loops are important!

@a12l
Copy link
Author

a12l commented May 3, 2022

@NobbZ Not blaming you personally, it just feels like an obvious bug to me that it isn't available. But the Haskell team should be able to clarify it :)

@petertseng
Copy link
Member

To fix this issue, multiset should be added to https://github.com/exercism/haskell-test-runner/blob/main/pre-compiled/package.yaml

Reasons why it is appropriate to be added:

@iHiD
Copy link
Member

iHiD commented May 5, 2022

@petertseng @ErikSchierboom Is this one that either of you can fix? Should this issue be moved to exercism/haskell?

@SleeplessByte
Copy link
Member

I think it should be moved, and I think this packages should be added.

@ErikSchierboom
Copy link
Member

PR has been opened: exercism/haskell-test-runner#49 Once that is merged and the test runner is deployed (within 15 mins or so after merging), this issue should be fixed.

@SleeplessByte
Copy link
Member

It has been merged. Within about 15 minutes from now this should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants