Skip to content
This repository has been archived by the owner on Feb 3, 2022. It is now read-only.

Add a vcvars32.bat-like bat file #56

Open
r0ml opened this issue Mar 20, 2014 · 7 comments
Open

Add a vcvars32.bat-like bat file #56

r0ml opened this issue Mar 20, 2014 · 7 comments

Comments

@r0ml
Copy link

r0ml commented Mar 20, 2014

To make it easier to use several HP versions installed on the same machine, there should be a convenient way to temporary modify the environment to make a specific HP version the default. If you have used Visual Studio, then vcvars32.bat is what I have in mind. Bulat also suggested adding a GUI tool for this.

@r0ml r0ml added this to the 2013.2.0.0 Release milestone Mar 20, 2014
@r0ml
Copy link
Author

r0ml commented Mar 20, 2014

if you're using cygwin's bash (actually, a slight variation should work with unix/bash as well), you can do something like the following in your ~/.bashrc (might need tweaking, this version assumes that there is a ghc/ghc-<version>/bin in your PATH that you want to replace, and that your GHCs are installed in c:/ghc/ghc-<version>):

function set-ghc { export PATH=`echo $PATH | sed 's/ghc\/ghc-[0-9.]*\/bin/ghc\/'$1'\/bin/'`; }
function F { i=0;
             for f in /cygdrive/c/ghc/$2*; 
             do COMPREPLY[$i]=`basename $f`; 
                i+=1 ; 
             done; }
complete -F F set-ghc

Calling set-ghc 6.10.3 replaces the in-PATH GHC, and function F is used to provide commandline completion for set-ghc, based on the currently installed GHCs.

Oh, and of course I have several GHCis in my right-click menu, as "Open with GHCi <version>", so the above doesn't need to replace the system-wide PATH.

Then one only needs to be able to go directly to the docs matching the currently selected GHC, which I can do from within GHCi, via GHC.Paths (not yet included in HP:-(, or from within Vim, via the haskellmode plugins.

@r0ml
Copy link
Author

r0ml commented Mar 20, 2014

Adding ghc-paths at its current state to HP would be useless, since it refers to the paths on the build machine, not the machine on which HP is installed.

@r0ml
Copy link
Author

r0ml commented Mar 20, 2014

By the nature of ghc-paths (capture the GHC installation paths in a Haskell module), you cannot bundle an installed version. That doesn't mean you couldn't install a bundled version, though!-) That is what post-install scripts are for, usually (call cabal install on a local copy, at the end of the HP installation).

I'm not saying it should be added - on its own, it is easy enough to install from hackage. The point is that it was designed to simplify a whole class of installation path related issues, so having it available for installation might be very useful (and better than reinventing its functionality).

This ticket is but one example of how it might make your job easier to have it at hand: I just install ghc-paths with every GHC I install, and if I have the path to ghc.exe, I can find everything else for that version (ghc-pkg.exe, libdir, docs), so I only have to worry about changing one path (and using a different GHCi with an absolute path works just as well).

As I said, just a suggestion.

@r0ml
Copy link
Author

r0ml commented Mar 20, 2014

It would be a bit more tricky than just calling cabal install (we can't assume a working Internet connection), but doable. More serious problem with ghc-paths in its current form is that including it would again make the HP directory non-relocatable.

@r0ml
Copy link
Author

r0ml commented Mar 20, 2014

A better idea is to just ship MSYS and put a shortcut to it from the program menu. This will provide an environment in which the user can build libraries with C sources and Build-type: Configure.

@23Skidoo
Copy link
Member

See also https://github.com/ygale/win-hp-path

@spl
Copy link

spl commented Nov 13, 2014

Is there a similar issue for Mac OS X? https://github.com/spl/ghc-ver

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

No branches or pull requests

4 participants