Open valpackett opened 5 years ago
Hi, thanks for reporting. Would you provide the --verbose
log, please.
The error comes from path
, but there are a number of places in the stack
codebase where it might occur. The log would help identify what's going on. Thanks!
There's not that much stuff…
2019-09-23 23:51:27.347922: [debug] Checking for project config at: /usr/home/greg/src/github.com/myfreeweb/microformats2-parser/stack.yaml
2019-09-23 23:51:27.348923: [debug] Loading project config file stack.yaml
2019-09-23 23:51:27.369298: [debug] SELECT COUNT(*) FROM "last_performed" WHERE ("action"=?) AND ("timestamp">=?); [PersistInt64 1,PersistUTCTime 2019-09-22 20:51:27.368436142 UTC]
2019-09-23 23:51:27.376880: [debug] Using package location completions from a lock file
2019-09-23 23:51:27.904727: [debug] Parsing cabal file for wai-cli (from Hackage)
2019-09-23 23:51:27.916225: [debug] Asking for a supported GHC version
2019-09-23 23:51:27.916393: [debug] Getting system compiler version
2019-09-23 23:51:27.918400: [error] InvalidAbsFile "/usr/home/greg/src/github.com/myfreeweb/microformats2-parser/.git/safe/../../bin/ghc-8.6.5"
Yeah, this is it.
Calls out to this:
https://github.com/mrkkrp/path-io/blob/7260ada0b313b2c4778936c3f3563451dedd314c/Path/IO.hs#L980-L984
resolveFile :: MonadIO m
=> Path Abs Dir -- ^ Base directory
-> FilePath -- ^ Path to resolve
-> m (Path Abs File)
resolveFile b p = liftIO $ D.canonicalizePath (toFilePath b F.</> p) >>= parseAbsFile
It seems canonicalizePath
doesn't handle internal ..
.
Since some indirections (symbolic links on all systems, .. on non-Windows systems, and junction points on Windows) are dependent on the state of the existing filesystem, the function can only make a conservative attempt by removing such indirections from the longest prefix of the path that still points to an existing file or directory.
I think this is possibly an issue with path-io
— I recommend you open an issue there and see what they think.
Steps to reproduce
With a relative path in
$PATH
(e.g. for this trick)try to build something with system GHC.
Expected
Should work :)
Actual
Stack version
Method of installation