-
Notifications
You must be signed in to change notification settings - Fork 842
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
Absolute paths #1348
Comments
This looks like a duplicate of #1259, which is fixed in master. Can you On Sun, Nov 15, 2015 at 6:28 PM Cary Robbins [email protected]
|
@borsboom - I have the same issue with the master build. Doing |
Thanks, I was able to reproduce this using the stack-ide repo as well. The problems appears to be that the paths output by GHC are canonicalized to absolute paths when Stack is directly passing GHC's output to the console, but not when it dumps the log after a build failure. That means if you're only building a single package, the paths do get canonicalized (e.g. try |
Fixed on master branch. |
Awesome! Looking forward to testing it. Nice work! |
Confirmed, this works as expected. Thank you! |
Compiler messages will only display the relative path to source files from their respective packages (except in one case). For instance, if I check out the stack-ide project and update
stack-ide/src/main/Main.hs
with some uncompilable code, I'll get the following error -This is, of course, relative to the
stack-ide
package. However, if I am consuming stack's output from another process, there is no clear, unambiguous way for it to determine where this source file actually resides. Ideally, if the paths that were configured to be absolute, this would not be an issue.One workaround is to
cd
into the package directory and then runstack build .
; stack then seems to report the absolute path. This is far from ideal, though, since it means you'd have to do this separately for each package, making the process inefficient.Is there a way to have stack reliably produce absolute paths? If it could at least report out the absolute path to the package it is building before reporting messages, that would give the consumer process a consistent and efficient way to determine where the source file resides.
Some additional context - I am working on providing users of HaskForce the ability to build their projects with stack. It is consuming output from
stack build
and needs to be able to jump the user directly to the source locations from compiler messages. I'd like to be able to consume the output directly from stack to avoid forcing users to configure additional tools.There may be a better or simpler way to determine the absolute paths to the source files, so I am open to any solutions.
The text was updated successfully, but these errors were encountered: