Re: Update Cabal submodule to HEAD (1.21)

Hi, Am Samstag, den 19.07.2014, 01:14 +0100 schrieb Edward Z.Yang:
The reason for this is that the builders do not have a sufficiently recent version of process, which Cabal has upgraded to depend on. Probably 'cabal update && cabal install process' should bring it up to date and make it working. Unfortunately, the build system bypasses Cabal for the bootstrap build of Cabal, so the version dependency range is not checked.
didn’t seem to help just like that. https://api.travis-ci.org/jobs/30346178/log.txt?deansi=true Probably because of "-no-user-package-db". Trying with "cabal install --global" now.
BTW, I noticed the builders are still bootstrapping from 7.4. Since 7.8 was stabilized recently, we're going to be retiring support for bootstrapping from 7.4 soon. Upgrade!
7.4 is still the version in the latest Debian stable release, as well as the almost latest Ubuntu LTS release (14.4 is still kinda new). But I guess I can install ghc from a PPA on travis. It doesn’t help with the process problem, though, that also affects 7.6. Greetings, Joachim -- Joachim “nomeata” Breitner mail@joachim-breitner.de • http://www.joachim-breitner.de/ Jabber: nomeata@joachim-breitner.de • GPG-Key: 0xF0FBF51F Debian Developer: nomeata@debian.org

Hi, Am Samstag, den 19.07.2014, 16:48 +0200 schrieb Joachim Breitner:
Am Samstag, den 19.07.2014, 01:14 +0100 schrieb Edward Z.Yang:
The reason for this is that the builders do not have a sufficiently recent version of process, which Cabal has upgraded to depend on. Probably 'cabal update && cabal install process' should bring it up to date and make it working. Unfortunately, the build system bypasses Cabal for the bootstrap build of Cabal, so the version dependency range is not checked.
didn’t seem to help just like that. https://api.travis-ci.org/jobs/30346178/log.txt?deansi=true
Probably because of "-no-user-package-db". Trying with "cabal install --global" now.
I did this on the builder machines, but now I noticed that I’d also like to build this on my own machine, and using cabal to do system wide installations is not really the recomended way. And people wanting to hack on GHC that do not have root access have to jump through even more hoops (such as making a user installation of GHC). It would also break building Distribution packages (and already does so on) http://deb.haskell.org/dailies/ Is there an easy way out here?
I suppose if you /really/ wanted to we could add a macro to disable ctl-c support and pass it on the zeroboot.
I tried that (there is already a macro BOOTSTRAPPING), and then it does build inplace/bin/ghc-cabal. But the next thing it tries to do is to build Cabal, which then fails, expecting the newer process. So process needs to be added to PACKAGES_STAGE0. But this adds "--constriant process == 1.2.0.0" to the options when building hsc2hs, which then fails – but only with make -j2. In a sequential build, process happens to be built before hsc2hs.... So I guess I need to tell make somehow to first configure and register process and then configure and register hsc2hs. But I’m lost in GHC’s makefiles... Can anyone point me into the right direction? Greetings, Joachim -- Joachim “nomeata” Breitner mail@joachim-breitner.de • http://www.joachim-breitner.de/ Jabber: nomeata@joachim-breitner.de • GPG-Key: 0xF0FBF51F Debian Developer: nomeata@debian.org

Hi, Am Sonntag, den 20.07.2014, 16:58 +0200 schrieb Joachim Breitner:
I suppose if you /really/ wanted to we could add a macro to disable ctl-c support and pass it on the zeroboot.
I tried that (there is already a macro BOOTSTRAPPING), and then it does build inplace/bin/ghc-cabal.
But the next thing it tries to do is to build Cabal, which then fails, expecting the newer process.
So process needs to be added to PACKAGES_STAGE0. But this adds "--constriant process == 1.2.0.0" to the options when building hsc2hs, which then fails – but only with make -j2. In a sequential build, process happens to be built before hsc2hs....
So I guess I need to tell make somehow to first configure and register process and then configure and register hsc2hs. But I’m lost in GHC’s makefiles... Can anyone point me into the right direction?
So I got a working configuration. The following patch needs to be applied to Cabal: diff --git a/Cabal/Distribution/Simple/Utils.hs b/Cabal/Distribution/Simple/Utils.hs index 9096186..54df19d 100644 --- a/Cabal/Distribution/Simple/Utils.hs +++ b/Cabal/Distribution/Simple/Utils.hs @@ -379,7 +379,12 @@ rawSystemExitWithEnv verbosity path args env = do hFlush stdout (_,_,_,ph) <- createProcess $ (Process.proc path args) { Process.env = (Just env) - , Process.delegate_ctlc = True } +#ifndef BOOTSTRAPPING +-- delegate_ctlc has been added in process 1.2, and we still want to be able to build +-- bootstrap GHC on systems not having that version + , Process.delegate_ctlc = True +#endif + } exitcode <- waitForProcess ph unless (exitcode == ExitSuccess) $ do debug verbosity $ path ++ " returned " ++ show exitcode @@ -405,7 +410,12 @@ rawSystemIOWithEnv verbosity path args mcwd menv inp out err = do , Process.std_in = mbToStd inp , Process.std_out = mbToStd out , Process.std_err = mbToStd err - , Process.delegate_ctlc = True } +#ifndef BOOTSTRAPPING +-- delegate_ctlc has been added in process 1.2, and we still want to be able to build +-- bootstrap GHC on systems not having that version + , Process.delegate_ctlc = True +#endif + } exitcode <- waitForProcess ph unless (exitcode == ExitSuccess) $ do debug verbosity $ path ++ " returned " ++ show exitcode and this adjustment made to GHCs build system: diff --git a/ghc.mk b/ghc.mk index e9d7e83..cfe46ec 100644 --- a/ghc.mk +++ b/ghc.mk @@ -382,8 +382,10 @@ else # Packages that are built by stage0. These packages are dependencies of # programs such as GHC and ghc-pkg, that we do not assume the stage0 # compiler already has installed (or up-to-date enough). +# "process" can be removed once the version required by Cabal is not +# particularly new any more. -PACKAGES_STAGE0 = Cabal/Cabal hpc bin-package-db hoopl transformers +PACKAGES_STAGE0 = process Cabal/Cabal hpc bin-package-db hoopl transformers ifeq "$(Windows_Host)" "NO" ifneq "$(HostOS_CPP)" "ios" PACKAGES_STAGE0 += terminfo @@ -732,6 +734,11 @@ fixed_pkg_prev= $(foreach pkg,$(PACKAGES_STAGE0),$(eval $(call fixed_pkg_dep,$(pkg),dist-boot))) utils/ghc-pkg/dist/package-data.mk: $(fixed_pkg_prev) compiler/stage1/package-data.mk: $(fixed_pkg_prev) + +# we also need to configure hsc2hs after process has been configured, as +# BOOT_PKG_CONSTRAINTS will make hsc2hs want to use the in-tree process library. +utils/hsc2hs/dist/package-data.mk : libraries/process/dist-boot/package-data.mk + endif ifneq "$(BINDIST)" "YES" Now I’d like to apply this change, but I’m not sure how to proceed with such GHC-specific fixes to Cabal. I guess I could create a pull request, wait for the Cabal devs to apply it, wait for the next Cabal release, and then update the submodule. Is there anything quicker that gets the fix in until that has happened? Greetings, Joachim -- Joachim “nomeata” Breitner mail@joachim-breitner.de • http://www.joachim-breitner.de/ Jabber: nomeata@joachim-breitner.de • GPG-Key: 0xF0FBF51F Debian Developer: nomeata@debian.org

As long as we get Cabal to do a release before we cut a release, it should be fine, so all we need is for Cabal to take the patch. Edward Excerpts from Joachim Breitner's message of 2014-07-20 16:55:20 +0100:
Hi,
Am Sonntag, den 20.07.2014, 16:58 +0200 schrieb Joachim Breitner:
I suppose if you /really/ wanted to we could add a macro to disable ctl-c support and pass it on the zeroboot.
I tried that (there is already a macro BOOTSTRAPPING), and then it does build inplace/bin/ghc-cabal.
But the next thing it tries to do is to build Cabal, which then fails, expecting the newer process.
So process needs to be added to PACKAGES_STAGE0. But this adds "--constriant process == 1.2.0.0" to the options when building hsc2hs, which then fails – but only with make -j2. In a sequential build, process happens to be built before hsc2hs....
So I guess I need to tell make somehow to first configure and register process and then configure and register hsc2hs. But I’m lost in GHC’s makefiles... Can anyone point me into the right direction?
So I got a working configuration. The following patch needs to be applied to Cabal:
diff --git a/Cabal/Distribution/Simple/Utils.hs b/Cabal/Distribution/Simple/Utils.hs index 9096186..54df19d 100644 --- a/Cabal/Distribution/Simple/Utils.hs +++ b/Cabal/Distribution/Simple/Utils.hs @@ -379,7 +379,12 @@ rawSystemExitWithEnv verbosity path args env = do hFlush stdout (_,_,_,ph) <- createProcess $ (Process.proc path args) { Process.env = (Just env) - , Process.delegate_ctlc = True } +#ifndef BOOTSTRAPPING +-- delegate_ctlc has been added in process 1.2, and we still want to be able to build +-- bootstrap GHC on systems not having that version + , Process.delegate_ctlc = True +#endif + } exitcode <- waitForProcess ph unless (exitcode == ExitSuccess) $ do debug verbosity $ path ++ " returned " ++ show exitcode @@ -405,7 +410,12 @@ rawSystemIOWithEnv verbosity path args mcwd menv inp out err = do , Process.std_in = mbToStd inp , Process.std_out = mbToStd out , Process.std_err = mbToStd err - , Process.delegate_ctlc = True } +#ifndef BOOTSTRAPPING +-- delegate_ctlc has been added in process 1.2, and we still want to be able to build +-- bootstrap GHC on systems not having that version + , Process.delegate_ctlc = True +#endif + } exitcode <- waitForProcess ph unless (exitcode == ExitSuccess) $ do debug verbosity $ path ++ " returned " ++ show exitcode
and this adjustment made to GHCs build system:
diff --git a/ghc.mk b/ghc.mk index e9d7e83..cfe46ec 100644 --- a/ghc.mk +++ b/ghc.mk @@ -382,8 +382,10 @@ else # Packages that are built by stage0. These packages are dependencies of # programs such as GHC and ghc-pkg, that we do not assume the stage0 # compiler already has installed (or up-to-date enough). +# "process" can be removed once the version required by Cabal is not +# particularly new any more.
-PACKAGES_STAGE0 = Cabal/Cabal hpc bin-package-db hoopl transformers +PACKAGES_STAGE0 = process Cabal/Cabal hpc bin-package-db hoopl transformers ifeq "$(Windows_Host)" "NO" ifneq "$(HostOS_CPP)" "ios" PACKAGES_STAGE0 += terminfo @@ -732,6 +734,11 @@ fixed_pkg_prev= $(foreach pkg,$(PACKAGES_STAGE0),$(eval $(call fixed_pkg_dep,$(pkg),dist-boot))) utils/ghc-pkg/dist/package-data.mk: $(fixed_pkg_prev) compiler/stage1/package-data.mk: $(fixed_pkg_prev) + +# we also need to configure hsc2hs after process has been configured, as +# BOOT_PKG_CONSTRAINTS will make hsc2hs want to use the in-tree process library. +utils/hsc2hs/dist/package-data.mk : libraries/process/dist-boot/package-data.mk + endif
ifneq "$(BINDIST)" "YES"
Now I’d like to apply this change, but I’m not sure how to proceed with such GHC-specific fixes to Cabal. I guess I could create a pull request, wait for the Cabal devs to apply it, wait for the next Cabal release, and then update the submodule. Is there anything quicker that gets the fix in until that has happened?
Greetings, Joachim

Hi, Am Sonntag, den 20.07.2014, 17:08 +0100 schrieb Edward Z.Yang:
As long as we get Cabal to do a release before we cut a release, it should be fine, so all we need is for Cabal to take the patch.
Nevermind, I noticed you updated the submodule to Cabal HEAD, not Cabal some-release. But anyways...
Excerpts from Joachim Breitner's message of 2014-07-20 16:55:20 +0100:
Am Sonntag, den 20.07.2014, 16:58 +0200 schrieb Joachim Breitner: So I got a working configuration. The following patch needs to be applied to Cabal:
[..]
and this adjustment made to GHCs build system:
[..]
doesn’t quite work. It finishes phase 0, but phase 1 says make[1]: *** No rule to make target 'libraries/process/dist-boot/build/System/Process.hi', needed by 'utils/hsc2hs/dist/build/Common.o'. Schluss. and I’m stuck. Can someone help me here? Thanks, Joachim -- Joachim “nomeata” Breitner mail@joachim-breitner.de • http://www.joachim-breitner.de/ Jabber: nomeata@joachim-breitner.de • GPG-Key: 0xF0FBF51F Debian Developer: nomeata@debian.org

Since this patch causes GHC HEAD to not bootstrap out of the box from GHC 7.6, I've reverted it for now. We'll have to cross this bridge sometime though. Edward Excerpts from Joachim Breitner's message of 2014-07-20 17:18:56 +0100:
Hi,
Am Sonntag, den 20.07.2014, 17:08 +0100 schrieb Edward Z.Yang:
As long as we get Cabal to do a release before we cut a release, it should be fine, so all we need is for Cabal to take the patch.
Nevermind, I noticed you updated the submodule to Cabal HEAD, not Cabal some-release.
But anyways...
Excerpts from Joachim Breitner's message of 2014-07-20 16:55:20 +0100:
Am Sonntag, den 20.07.2014, 16:58 +0200 schrieb Joachim Breitner: So I got a working configuration. The following patch needs to be applied to Cabal:
[..]
and this adjustment made to GHCs build system:
[..]
doesn’t quite work. It finishes phase 0, but phase 1 says make[1]: *** No rule to make target 'libraries/process/dist-boot/build/System/Process.hi', needed by 'utils/hsc2hs/dist/build/Common.o'. Schluss. and I’m stuck. Can someone help me here?
Thanks, Joachim

Hi, Am Sonntag, den 20.07.2014, 22:57 +0100 schrieb Edward Z.Yang:
Since this patch causes GHC HEAD to not bootstrap out of the box from GHC 7.6, I've reverted it for now. We'll have to cross this bridge sometime though.
thanks. Cabal already has applied the patch to make the initial ghc-cabal binary build: https://github.com/haskell/cabal/commit/3ef560208721a050e91fd9e67a0066ce44b0... Now all we need to do is to figure out how to tell the build system to build process before Cabal. I started in http://www.haskell.org/pipermail/ghc-devs/2014-July/005685.html but that didn’t satisfiy the build system completely. Probably simply, but I have been staring at the makefiles for too long already. Greetings, Joachim -- Joachim “nomeata” Breitner mail@joachim-breitner.de • http://www.joachim-breitner.de/ Jabber: nomeata@joachim-breitner.de • GPG-Key: 0xF0FBF51F Debian Developer: nomeata@debian.org

For the record, Cabal is now up-to-date, we're using a different patch which relaxes the version constraint on process so that 7.6 bootstraps. Cheers, Edward Excerpts from Joachim Breitner's message of 2014-07-21 08:22:32 +0100:
Hi,
Am Sonntag, den 20.07.2014, 22:57 +0100 schrieb Edward Z.Yang:
Since this patch causes GHC HEAD to not bootstrap out of the box from GHC 7.6, I've reverted it for now. We'll have to cross this bridge sometime though.
thanks.
Cabal already has applied the patch to make the initial ghc-cabal binary build: https://github.com/haskell/cabal/commit/3ef560208721a050e91fd9e67a0066ce44b0...
Now all we need to do is to figure out how to tell the build system to build process before Cabal. I started in http://www.haskell.org/pipermail/ghc-devs/2014-July/005685.html but that didn’t satisfiy the build system completely. Probably simply, but I have been staring at the makefiles for too long already.
Greetings, Joachim
participants (2)
-
Edward Z. Yang
-
Joachim Breitner