-
Notifications
You must be signed in to change notification settings - Fork 91
Windows installer should add MSYS to extra-prog-path/extra-lib-dirs/... #279
Comments
There were some concerns about messing with people's cabal config files
automatically, so as I recall there was some discussion around this. and
additionally if there is no cabal config file, it wouldn't have been
created until cabal is first run anyway. But herbert suggests a few nice
approaches:
a) basically, test if a user-config file exists, and if not run user-config
in it and then alter the file. And whether or not the cabal file is
initialized by the installer can be a user-configurable option.
b) at a minimum if the instructions on what to add to the file aren't
displayed when the installer is run, we can add them.
(he also notes that a) could be easier at some point if we add a `cabal
user-config init --with-msys-location=...` flag (which can even be snuck
into cabal 2.0?)
|
I think it's generally a good idea to run Because an old config file may be lurking around, and that's generally a source of confusion (i.e. when your config file was created by some ancient cabal 1.18, and you use it with cabal 2.0, I wouldn't be surprised there to be undesired effects). It may even point to some old msys install location from a previous HP installation... (in this context So by running Here's the
|
Hmmm I may have an alternate solution. What if we change the way HP is packaged. So HP can use the The idea of it is to allow Configure would then find the libraries in their standard locations, no extra configuration needed. But as a bonus as well, user libraries installed with This also means that users have a standard place aside from I've been looking for alternative ways to package Windows binaries and this is one of the solutions I'm considering. |
I'm not sure I follow. HP already packages the same GCC and utils. Its just
we have to add the paths to the cabal file so the options get passed.
Additionally, this allows us to ensure that we use the correct gcc for ghc
rather than e.g. the one installed with an existing cygwin installation
(which may in general want to take precedence on the path?). Could you
expand on concretely what changes to the hp installer would take place, and
how cabal etc would interact differently?
…On Sun, Jun 11, 2017 at 12:58 PM, Tamar Christina ***@***.***> wrote:
Hmmm I may have an alternate solution.
What if we change the way HP is packaged. So HP can use the GHC provided
by MSYS2 or build a GHC packaged using this patch
https://phabricator.haskell.org/D3637 which I'll land for 8.4.
The idea of it is to allow GHC to use the CC on the path. So the idea is
HP would package the same GCC and utils that we do (you can just use
pacman to install the tarballs) and then GHC would pick those up.
Configure would then find the libraries in their standard locations, no
extra configuration needed. But as a bonus as well, user libraries
installed with pacman will also automatically be picked up, without the
need for any path munging.
This also means that users have a standard place aside from System32 to
drop libraries in that we'll automatically pick up. and Includes etc.
I've been looking for alternative ways to package Windows binaries and
this is one of the solutions I'm considering.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#279 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABEt2Ta0gdD8J3b0SUfw2ZMy70MXiNWuks5sDByfgaJpZM4N2YZr>
.
|
So at the moment, from your post above I think the current situation with HP is:
This is why the paths need fudging at the moment. Concretely this proposal is to
The as would any package installed with |
I don't think this is enough for us to change our behavior. Its not just finding libraries thats affected. its finding other build tools, and even sh, etc. themselves which depends on having the extra-bin-dirs in path. Its typically the configure step of build-type-configure scripts that fails. |
Sure it won't work if we expect the user to be able to use any term to build stuff. Then you would need this. Afterall I can install network without needing any extra options in my msys2 install. The proposal is to make the Windows install virtually identical to the unix ones. We don't specify all these paths on Linux either. Given the fact that you'll need a unix like shell to execute configure anyway, this isn't an issue is it? |
the unix like shell comes with the msys we distribute. so on a raw system with no dev packages installed, a fresh hp install (plus cabal config files) lets you install build-type configure packages out of the box. |
I should point out that this ticket is specifically about making it possible to build stuff with |
Right, so this ticket is about getting cabal to find libraries installed in the environment? e.g. using pacman? As I don't think getting But yeah this would be a useful addition as a lot of people don't read the step 2 on the install page.
so HP installer would just issue a series of
It can then use This would also be useful to everyone on all platforms I think, and to people like me who automate GHC/cabal setups or just simply scripting tests. If we want to get something like this in the next Cabal release we have to move quick, I believe the deadline is fairly close? What do you think @hvr , @gbaz and @23Skidoo ? |
If it's too much for the next release, I think an undocumented |
Actually no, it looks for So if it can find an appropriate |
|
Do I sense correctly we're heading towards an agreement on having as a temporary solution an undocumented/hidden handshake as suggested in #279 (comment), i.e.
? |
I'm fine with adding a temporary undocumented thingie for this. |
Yup so am I. And good to know about sh, I wasn't aware of that!
…On Wed, Dec 13, 2017, 13:41 Mikhail Glushenkov ***@***.***> wrote:
I'm fine with adding a temporary undocumented thingie for this.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#279 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABH3KcZF5_MdAhOsylIZMxV0RRYWIpvmks5s_9QggaJpZM4N2YZr>
.
|
HP will need to sync with cabal pull request: haskell/cabal#5008 |
This is in the new cabal 2.2 branch. It would be really nice to implement this with the new platform release. |
Resolve Windows installer should add MSYS to extra-prog-path/extra-lib-dirs/... (haskell#279). When the installer runs, Windows elevates the process, when possible, to the role of admin. If the installer writes the cabal.config under these privileges, the cabal.config file will have the wrong permissions for the end user. So, we must separate the privilege escalation, and perform the cabal.config change as the end user. A new sub-installer (not visible to the end-user) is introduced which performs this task, and also launches the full installer, which will get (when possible) raised privileges. As before, the full installer then launches the sub-installers. Add command line switches to hptool for additional archives needed for Windows (haskell#289) The GHC sub-installer has grown over the NSI 2GB uncompressed raw payload limit, so another split was done, breaking the GHC docs out into a separate sub-installer. As before, the sub-installers are not end-user visible (unless they looked really hard). * hptool/hptool.cabal * Add constraint to Cabal package for vers 2.2, as the cabal files generated during the build (by invocations of cabal.exe) have some changes which are not parsable with earlier versions of Cabal. * hptool/os-extras/win/templates/Bootstrapper.nsi.mu * New. This bootstrapper exists for one feature (currently) which must be done as the user, which is to write update/create the user's cabal config file. * hptool/os-extras/win/templates/CommonHP.nsh.mu * New. A few macros common to our (sub-)installer(s). * hptool/os-extras/win/templates/Extralibs.nsi.mu * hptool/os-extras/win/templates/GHC.nsi.mu * hptool/os-extras/win/templates/MSys.nsi.mu * Deleted. Replaced by using a common SubInstall.nsi.mu to generate the .nsi files for the sub-installers. * hptool/os-extras/win/templates/Nsisfile.nsi.mu * This is the "main" installer, which runs as an admin if possible. However, it is launched by the "Bootstrapper" installer (which continues to run as an unprivileged user). We want this main install to have its windows be on top of other windows. This installer handles all the user interaction, so if the user chooses not to have the cabal.config file updated, this installer needs to communicate back to the Bootstrapper that. So, when this main installer is successful (not cancelled by user or an error) *and* the user has chosen to update the cabal.config file, it returns to the shell a magic value 3 (rather than 0 or 1 for failure/success, respectively). * Moved some macros to CommonHP.nsh * Add some macros to do the sub-installer steps, and remove/edit the repeated steps which now use the macros * Add some "BringToFront" commands to try to make sure the installer window ends up on top of the windows stack. * Use nsExec::Exec rather than ExecWait, to get rid of the DOS window that shows up when we are running the ghc-pkg recache. * During the install, use the TEMP dir to hold the uncompressed installer payload (we already were doing this for the uninstaller). * hptool/os-extras/win/templates/SubInstall.nsi.mu * New. Templatized version of the sub-installer .nsi files (Extralibs.nsi.mu, GHC.nsi.mu, and MSys.nsi.mu, which are deleted), used to generate the .nsi for the Extralibs, GHC, Msys, and the new GHCDoc sub-installers. * hptool/src/GhcDist.hs * Pass in a param to allow the multiple untarrings of GHC to be named independently (which allows parallel untarring). * hptool/src/OS/Win.hs * Move most of the steps from osRules into genNsisFiles time, so that parallel building can be done shake. * hptool/src/OS/Win/WinNsis.hs * Use the SubInstall.nsi.mu to generate the sub-installer nsi files, rather than using separate files for each. * In adding the sub-installer, we added a couple more template variables which need expanding, and this requires a bit more info to be threaded through. * Add a new sub-installer, GHCDoc, needed since the main GHC sub-installer has again went over the NSI limit of 2GB (uncompressed, raw payload). * Re-order some steps, taking some from the function osRules in Win.hs, to reflect better dependencies and thus allow more parallelism in the shake build. * The function copyWinTargetExtras is moved from WinRules to this module. * hptool/src/OS/Win/WinPaths.hs * Filename re-working due to the new sub-installer template, CommonHP.nsh, plus adding the new GHCDoc sub-installer and the "Bootstrapper.nsi". * hptool/src/OS/Win/WinRules.hs * Add the FilePath for the top-level output (the "main" installer) to the winRules, so this can be passed to genNsisFiles. * Change the command which takes the untarred ghc directory and allows it to moved to a specified location, which is part of the change to allow the installer build to do the two ghc untars in parallel. * Move copyWinTargetExtras from here to WinNsis.hs * copyFileAction, copyFilesAction, copyDirAction moved to WinUtils in order to to move the body of copyWinTargetExtras into WinNsis. Note that WinRules imports WinNsis, so these common functions needed to be in a module separate from either. * HPTOOL/src/OS/Win/WinUtils.hs * copyFileAction, copyFilesAction, copyDirAction moved here from WinRules, which imports/exports fixed up accordingly. * hptool/src/Paths.hs * Add an extra parameter for ghcBinDistDir in order to name the ghc bin dist directory differently for the two times we have to untar the ghc tar file, which allows those two un-tars to be done potentially in parallel. * hptool/src/Target.hs * Separated two targets, "ghcVirtualTarget" and "haddockDocDir" so they won't be done in parallel (we really need to go through the dependencies of this entire project, as there have been a few occasional things, e.g., sometimes timing-dependent behavior of dependencies not being available when needed, etc.) * Added missing newline at end-of-file. * hptool/src/Utils.hs * Added a log message during makeDirectory. * windows-platform.sh
The changes for haskell#279 (Windows installer should add MSYS to extra-prog-path/extra-lib-dirs/...) broke silent installs. * hptool/os-extras/win/templates/Bootstrapper.nsi.mu * Force /D= to the launched sub-installer to fix haskell#311 * Add many comments about the weirdness of handling $INSTDIR
fixed! |
The problem:
build-type: Configure
packages likeold-time
andnetwork
don't build out of the box on Windows, unless you perform the following steps:(
gcc-location
is probably not needed nowadays)IMO, the HP installer should do this automatically. I can't think of any objections, and #207 doesn't mention any either.
/cc @randen @ndmitchell
The text was updated successfully, but these errors were encountered: