Skip to content

stack2nix fails with 404 with lts-15.13 #95

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

Closed
matsumonkie opened this issue Jun 12, 2020 · 7 comments
Closed

stack2nix fails with 404 with lts-15.13 #95

matsumonkie opened this issue Jun 12, 2020 · 7 comments

Comments

@matsumonkie
Copy link

matsumonkie commented Jun 12, 2020

Hello!
First things first, thanks a lot for this work, it might help me a lot.

I'm trying to build a static binary from a stack project based. My project is using stack lts-15.13 with gh883. When I try to build the adapted default.nix, stack2nix fails with a 404:

 % $(nix-build --no-link -A fullBuildScript)
+ /nix/store/4jl99687r2r5xdxis5g93v7cy5rmzrjb-stack2nix-0.2.3/bin/stack2nix /home/iori/Work/patchGirl2/back --stack-yaml stack.yaml --hackage-snapshot 2019-10-08T00:00:00Z -o /tmp/stack2nix-output-dir.q5rywLgu3b/stack2nix-output.nix

Ensuring git version is >= 2 ...
Ensuring cabal version is >= 2 ...
stack2nix: RedownloadInvalidResponse Request {
  host                 = "raw.githubusercontent.com"
  port                 = 443
  secure               = True
  requestHeaders       = []
  path                 = "/fpco/lts-haskell/master//lts-15.13.yaml"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 "/home/iori/.stack/build-plan/lts-15.13.yaml" (Response {responseStatus = Status {statusCode = 404, statusMessage = "Not Found"}, responseVersion = HTTP/1.1, responseHeaders = [("Connection","keep-alive"),("Content-Length","14"),("Content-Security-Policy","default-src 'none'; style-src 'unsafe-inline'; sandbox"),("Strict-Transport-Security","max-age=31536000"),("X-Content-Type-Options","nosniff"),("X-Frame-Options","deny"),("X-XSS-Protection","1; mode=block"),("Content-Type","text/plain; charset=utf-8"),("Via","1.1 varnish (Varnish/6.0)"),("X-GitHub-Request-Id","9E3C:51E6:45222:54D20:5EE1FA35"),("Accept-Ranges","bytes"),("Date","Thu, 11 Jun 2020 09:32:37 GMT"),("Via","1.1 varnish"),("X-Served-By","cache-cdg20740-CDG"),("X-Cache","MISS, MISS"),("X-Cache-Hits","0, 0"),("X-Timer","S1591867957.157747,VS0,VE444"),("Vary","Authorization,Accept-Encoding"),("Access-Control-Allow-Origin","*"),("X-Fastly-Request-ID","1f20cd3df7a973cb09e66cd12d6ffbe7f5b31e62"),("Expires","Thu, 11 Jun 2020 09:37:37 GMT"),("Source-Age","0")], responseBody = (), responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose})

It seems the issue comes from path = "/fpco/lts-haskell/master//lts-15.13.yaml" and the double slash.
So my question is, is lts-15.13 supported ?

@matsumonkie
Copy link
Author

The failing build can be found here if it helps to reproduce

@matsumonkie
Copy link
Author

I believe the issue comes from https://github.com/nh2/static-haskell-nix/blob/master/static-stack2nix-builder/stack2nix-script.nix#L88
I'm a beginner at nix though, so not quite sure :-S

@matsumonkie
Copy link
Author

So I've been investigating a little bit more and it turns out that the issue comes from stack2nix :-(
I'll close this issue!

@nh2
Copy link
Owner

nh2 commented Jun 19, 2020

You don't need to close the issue because it's with stack2nix, because I essentially maintain that too.

What you see seems to be this:
https://stackoverflow.com/questions/57516944/stack-new-command-failing-to-download-build-plan-for-lts-14-1

But it doesn't tell what the actual problem is. Newer stack seems to fix it, but it may not be easy to upgrade stack2nix to use a newer Stack immediately.

So it would be good to know if indeed we could fix it in stack2nix by removing double slashes, if that is the problem.

@nh2 nh2 reopened this Jun 19, 2020
@nh2
Copy link
Owner

nh2 commented Jun 19, 2020

I think I found it:

commercialhaskell/lts-haskell#247 (comment)

leading via commercialhaskell/stack#5204 (comment) to https://www.stackage.org/blog/2020/02/discontinuing-legacy-snapshots:

you will not be able to use Stack 1.9 or earlier with newer nightly or LTS 15 snapshots

This means we need to upgrade stack2nix to work with Stack 2 (currently it depends on Stack 1.9).

Or alternatively switch from stack2nix to haskell.nix, if it works well enough.

Both are no trivial tasks though.

@matsumonkie
Copy link
Author

Yeah, it seems indeed quite hard :-(
I've kind of given up trying to make it work with stack2nix and am actually trying to use the same technique postgres.
Not completely sure how great it is since my nix knowledge is still quite low though ? (would love your opinion whether postgres' solution is right or not!)

Good luck in trying to fix stack2nix for newer version!

@nh2
Copy link
Owner

nh2 commented Jul 23, 2021

This was fixed with PR #98, with commit 66fce68, which updates stack2nix to a version with Stack2 support.

@nh2 nh2 closed this as completed Jul 23, 2021
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

No branches or pull requests

2 participants