-
Notifications
You must be signed in to change notification settings - Fork 18
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
Allow paths as environment file names #94
Conversation
Mirroring the behaviour of ghc and cabal install --lib "foo" -> $ghcEnvDir/foo "./" -> $pwd/.ghc.environment.$ghcPlarform-$ghcVersion "./foo" where foo is not a directory -> $pwd/foo Closes #17
-- "./foo" where foo is not a directory -> $pwd/foo | ||
getEnvPath :: Opts -> GhcInfo -> Peu r (Path Absolute) | ||
getEnvPath Opts { optEnvName } ghcInfo = | ||
if FP.takeBaseName optEnvName == optEnvName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is how we check for path-likeness in cabal, but I'm not sure it's the best way to do it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I don't like this either. I think picking some format (e.g. alphanumeric + -_
) to be environment names, and everything else interpreted as paths would be better.
I'm not sure. I'll think some more and do the changes myself. Bear with me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there anything I can do to help with this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping :)
Ping :) I also think it could be a good idea to make |
I disagree. |
Why? I found myself using local environments more often than global ones. There is a risk of littering the filesystem with them though... |
There is a reason why I made this tool outside of |
Sure, just wanted to know the reason since that'd apply to a cabal command too. Personal preference is valid of course! |
But it has the risk of break the local project build if |
Build tools that provide their own environment/packagedb to ghc are supposed to override it though. In fact, I don't think environment files can break cabal builds. If stack does not reset the environment, i think that's a bug in stack since there could always be an user-generated one in the way. I think the biggest issue is having hidden state in your filesystem. Anyway I think this discussion should go in haskell/cabal#6481, since @phadej already decided for edit: okay... I didn't expect it but |
Mirroring the behaviour of ghc and cabal install --lib
"foo" -> $ghcEnvDir/foo
"./" -> $pwd/.ghc.environment.$ghcPlarform-$ghcVersion
"./foo" where foo is not a directory -> $pwd/foo
Closes #17