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

/c/ghcup/env file seems wrong in Windows #955

Open
jasagredo opened this issue Dec 21, 2023 · 3 comments
Open

/c/ghcup/env file seems wrong in Windows #955

jasagredo opened this issue Dec 21, 2023 · 3 comments

Comments

@jasagredo
Copy link

I don't think I provided any particular flags when installing GHCup (it was some time ago, I could delete it and install it again) but I think the env file is somewhat wrong. My installation folders are /c/ghcup and /c/cabal, however the script reads as follows:

➜ cat /c/ghcup/env
case ":$PATH:" in
    *:"/c/ghcup/bin":*)
        ;;
    *)
        export PATH="/c/ghcup/bin:$PATH"
        ;;
esac
case ":$PATH:" in
    *:"$HOME/.cabal/bin":*)
        ;;
    *)
        export PATH="$HOME/.cabal/bin:$PATH"
        ;;
esac

The /c/ghcup path is correct, but the .cabal one is not.

@jasagredo jasagredo changed the title .ghcup/env file seems wrong in Windows /c/ghcup/env file seems wrong in Windows Dec 21, 2023
@jasagredo
Copy link
Author

Maybe I installed ghcup inside mingw (therefore using bootstrap-haskell) instead of inside powershell (so not using bootstrap-haskell.ps1)? that would probably be an important fact to know.

@hasufell
Copy link
Member

For the env script on windows we can assume a mingw environment.

In the powershell environment, we rely on proper windows environment variables.

Indeed, we seem to hardcode the location:

export PATH="\$PATH:\$HOME/.cabal/bin"

So it's sub-optimal. The problem is that cabal has differing defaults for the bin location, which depends on directory existence on your filesystem (bad implementation of the XDG spec: haskell/cabal#7386).

And cabal has also no proper cli interface to discover those locations afaik. Maybe @fendor knows more.

@fendor
Copy link
Contributor

fendor commented Dec 22, 2023

Yeah, I don't think there is currently a way. In cabal head there is now cabal path --installdir (we want to rework the command as the latest cabal meeting), and could be usable in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants