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

Add explicit type for stack.yaml location #243

Merged
merged 1 commit into from
Aug 31, 2020

Conversation

fendor
Copy link
Collaborator

@fendor fendor commented Aug 31, 2020

Also, if no stack.yaml was given, don't default to "stack.yaml"

This also fixes a regression. Assume the following setup:

> cat File.hs
module File where

foo :: Int
foo = 2
> cat hie.yaml
cradle:
  stack:
> hie-bios check File.hs

This used to work, as we simply invoked stack repl to find the project arguments

@fendor
Copy link
Collaborator Author

fendor commented Aug 31, 2020

cc @WorldSEnder might be interesting for you. Also, this is the only way I can ask for a review from you :)

Also, if no stack.yaml was given, don't default to "stack.yaml"
@WorldSEnder
Copy link
Contributor

That's a good catch, I didn't think about standalone stack projects. I suppose there should be a testcase to document the regression.

I have a question about the usage of prependIfRelative. I was under the expression that </> already handles this, by returning the second argument if it starts with a drive letter or directory separator. Is there some windows detail I'm missing? In any case, I think it would be worth to document this with a test case (in a different PR).

@fendor
Copy link
Collaborator Author

fendor commented Aug 31, 2020

I was under the expression that </> already handles this

You seem to be right! Then this is an oversight, and this function should not exist at all. We should remove it. Thank you for mentioning this! I was not aware that this should work.

@WorldSEnder
Copy link
Contributor

WorldSEnder commented Aug 31, 2020

There are some subtle differences, if I read the documentation correctly (I don't have a windows system to test right now). For example, isRelative "c:test" == True but "D:\\foo" </> "C:bar" == "C:bar" (i.e. handled as if "c:bar" was absolute).

But I don't see an example where isAbsolute f and (wdir </> f) /= f, so I do believe prependIfRelative is superfluous.

@fendor fendor merged commit 15ab177 into haskell:master Aug 31, 2020
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 this pull request may close these issues.

None yet

2 participants