-
Notifications
You must be signed in to change notification settings - Fork 843
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
Namespaced templates don't work on windows #4394
Comments
Hello @bradrn Thanks for raising the issue. Template handling has changed in 1.9.1 — I'll check the details and get back to you tomorrow. |
@dbaynard I know template handling has changed in 1.9.1 — it's one of the new template features which I'm having trouble with. |
It works for me on 1.9.0.1 (the RC) — I've put the output below.
Edit: works for me on Linux. |
I think this is a Windows issue.
Note the backslash, where you entered a solidus? This is probably overeager path conversion for Windows. The relevant PR is #4103. I got as far as this, for now: Line 67 in b18fb2f
It's treating the namespaced template as a path. |
I'm not too sure that line in |
I think I've managed to find the bug. The issue is in these part of stack/src/Stack/Types/TemplateName.hs Lines 94 to 100 in f9d0042
stack/src/Stack/Types/TemplateName.hs Lines 134 to 141 in f9d0042
If the template name begins with github: , the template name will succeed in being parsed using parseRepoPath ; if not, it will be parsed as a relative path using parseRelFile — which will of course convert / to \ on Windows. This causes problems with this exception handler, which downloads a template if it does not already exist locally. I think that the easiest solution would be to simply convert all the slashes back in that exception handler, but I'm not sure if that would work in all cases.
|
Thanks 👍 — and thanks for tracking down the bug itself, too.
Right, so when stack sees I don't like that a Would you be willing to work on a PR, @bradrn? |
Yes.
This is already done: Lines 305 to 307 in f9d0042
Admittedly, there is a comment next to the constructor clarifying the name: stack/src/Stack/Types/TemplateName.hs Lines 38 to 40 in f9d0042
Yes, I would definitely be willing to work on a PR. Unfortunately, I'm not entirely sure how to fix this problem, as it is impossible to distinguish a |
Steps to reproduce
Run
stack new test-yesod yesodweb/simple
.Expected
Downloads the template at https://github.com/yesodweb/stack-templates/blob/master/simple.hsfiles.
Actual
Errors with
That template doesn't exist
:The problem seems to be that
stack
is still looking in the https://github.com/commercialhaskell/stack-templates repo - but even when I change it to the URL it still doesn't work:Stack version
(Also, I'm using Windows.)
Method of installation
Official binary, downloaded from stackage.org or fpcomplete's package repository
The text was updated successfully, but these errors were encountered: