-
Notifications
You must be signed in to change notification settings - Fork 841
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
InvalidRelFile when using stack solver #1954
Comments
I am not sure if there are any issues in allowing packages outside the current directory. Though nothing stops us from doing that and we can support that use case, it might be simpler to think of stack.yaml only covering packages under the dir tree. Anything outside the tree can be treated as external package with something like this:
@mgsloan any thoughts on supporting outside the tree packages as part of the project? Anyway, we will have to either fix this or provide an appropriate error message. I think the technical issue here is that when we try to make a path relative to the current directory using |
As I said, the problem only appears with stack solver, stack build works fine. Also trying to give a absolute path ( which doesn't make sense either) returns the same error. |
I think the implementation of |
@mgsloan, I've answered in mrkkrp/path-io#10 that it's not currently possible to construct |
@mrkkrp we can debate if My argument in favor of |
Yeah, It makes sense for |
FYI, I'm trying out stack for the first time on Windows 10. I ran into this issue while following the instructions on New in-depth guide to stack. It said to run
Interestingly, running
After running |
I am fixing this by just not using makeRelative |
Turns out it was just making files relative for display. Fix is just to display absolute paths for things above the current dir. |
Following this question I concluded it is a bug. I'll just copy paste my question and own answer from SO.
tl;dr
Using
../my_package
usingstack solver
throw a InvalidRelFile exception where asstack build
works fine. I'm happy to provide links to the broken package to help reproducing the bug if needed.Original question
I'm having this strange issue : I'm trying to add a local package to my stack file and I get the following error. when I try to build it (stack build) it kind of work but fails suggesting me to use stack solver but when I run stack solver I got the following error
Using configuration file: stack.yaml
InvalidRelFile "/home/max/devel/sql-fragment/sql-fragment.cabal"
My stack file looks like
flags: {}
packages:
extra-deps:
...
I'm on Ubuntu 15.02 trying to use GHC-7.8.4 and stack 1.0.4 The two packages, sql-fragment and sql-fragment-mysql-simple can be found on github.
Answer
It's probably a bug in stack. I managed to find a workaround by moving sql-fragment directory into sql-fragment-mysql-simple, change ../sql-fragment to sql-fragment in the stack file launch the solver -stack solver --update-config and it works. What is strange is, I add to properly move the directory to make it work (just creating a symbolic link woudn't work) and once the solver has done its job. I moved sql-fragment where it was, revert the path to ../sql-fragment andstack build` works perfectly ;-)
The text was updated successfully, but these errors were encountered: