Building stage1 only

(I know I asked this many times in IRC channel but I don't remember getting any answers. I apologize if anyone had answered this on IRC channel and I missed) With current build system, even if I choose "devel1" it always builds stage2 compiler too. A comment in build.mk says that it's for working on stage1 compiler, so I'd expect it to build only stage1. The reason I want stage1-only builds is the time it takes to build both stages. It takes approximately 30 minutes and if I could reduce this down to half that would greatly improve my work flow. Most of the time I don't need a full build, but in my experience, it's very easy to end up in a state where `make` simply can't build, and only easy fix is a `make clean`, which costs 30 minutes because then I have to build from scratch. This happens way too often, and so I need a stage1-only build. Thanks..

I haven't tested this, but I imagine putting `stage=1` in your build.mk or even on the command line should work.
Richard
On Oct 19, 2015, at 4:47 PM, Ömer Sinan Ağacan
(I know I asked this many times in IRC channel but I don't remember getting any answers. I apologize if anyone had answered this on IRC channel and I missed)
With current build system, even if I choose "devel1" it always builds stage2 compiler too. A comment in build.mk says that it's for working on stage1 compiler, so I'd expect it to build only stage1.
The reason I want stage1-only builds is the time it takes to build both stages. It takes approximately 30 minutes and if I could reduce this down to half that would greatly improve my work flow.
Most of the time I don't need a full build, but in my experience, it's very easy to end up in a state where `make` simply can't build, and only easy fix is a `make clean`, which costs 30 minutes because then I have to build from scratch. This happens way too often, and so I need a stage1-only build.
Thanks.. _______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Hi Ömer,
in mk/build.mk, set:
* Stage1Only=YES
* stage=1
* BuildFlavour=devel1
Then 'cd ghc && make'. Don't run make in the toplevel directory.
After building the stage1 compiler, it does still start the process of
configuring the libraries for the stage2 compiler, but it shouldn't build
them. Last time I checked, I didn't find an easy way to fix this. Maybe the
shake rewrite of the build system will have a better solution.
See Note [Stage1Only vs stage=1] in mk/config.mk.in for an explanation.
Thomas
On Tue, Oct 20, 2015 at 12:35 AM, Richard Eisenberg
I haven't tested this, but I imagine putting `stage=1` in your build.mk or even on the command line should work.
Richard
On Oct 19, 2015, at 4:47 PM, Ömer Sinan Ağacan
wrote: (I know I asked this many times in IRC channel but I don't remember getting any answers. I apologize if anyone had answered this on IRC channel and I missed)
With current build system, even if I choose "devel1" it always builds stage2 compiler too. A comment in build.mk says that it's for working on stage1 compiler, so I'd expect it to build only stage1.
The reason I want stage1-only builds is the time it takes to build both stages. It takes approximately 30 minutes and if I could reduce this down to half that would greatly improve my work flow.
Most of the time I don't need a full build, but in my experience, it's very easy to end up in a state where `make` simply can't build, and only easy fix is a `make clean`, which costs 30 minutes because then I have to build from scratch. This happens way too often, and so I need a stage1-only build.
Thanks.. _______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

it's very easy to end up in a state where `make` simply can't build, and only easy fix is a `make clean` Out of sheer curiosity: in what situations does that happen for you? *If* you are working on a single branch, ie. you're not switching back and forth between master and your feature branches, this should not happen (and even if you switch between branches it should still be safe for most of the time). Richard already gave you a trick (cd ghc/ && make 2) that allows to build only stage 2 compiler without rebuilding stage 1 or any of the libraries. One situation that comes to my mind that can really require a full rebuild is changing format of interface files. But other than that you shouldn't have to do a full rebuild too often.
I know how you feel. When I started working on GHC I had to do a full rebuild very often. But now I improved my workflow and only do a full build after a major rebase of my branch against master. Janek --- Politechnika Łódzka Lodz University of Technology Treść tej wiadomości zawiera informacje przeznaczone tylko dla adresata. Jeżeli nie jesteście Państwo jej adresatem, bądź otrzymaliście ją przez pomyłkę prosimy o powiadomienie o tym nadawcy oraz trwałe jej usunięcie. This email contains information intended solely for the use of the individual to whom it is addressed. If you are not the intended recipient or if you have received this message in error, please notify the sender and delete it from your system.

Out of sheer curiosity: in what situations does that happen for you? *If* you are working on a single branch, ie. you're not switching back and forth between master and your feature branches, this should not happen (and even if you switch between branches it should still be safe for most of the time).
I'm actually swtiching branches quite a lot, because most of the time I have
multiple tasks at hand, working on multiple tickets etc.
But I think there's another way to introduce this kind of failures. Since
compilation take very long, I never start the build process and wait until it's
done, I keep coding in the meantime. Maybe I should rsync changes manually to
another directory and run build there while I keep working on current tree etc.
I just tried `make 1` in ghc directory and I think it worked(I'll try on a
clean tree once I have to `make clean` and see if it's really building only
stage-1). But my next question is why marking it as such in build.mk doesn't
work.. I'd expect `devel1` to build stage1 only.
2015-10-20 3:12 GMT-04:00 Jan Stolarek
it's very easy to end up in a state where `make` simply can't build, and only easy fix is a `make clean` Out of sheer curiosity: in what situations does that happen for you? *If* you are working on a single branch, ie. you're not switching back and forth between master and your feature branches, this should not happen (and even if you switch between branches it should still be safe for most of the time). Richard already gave you a trick (cd ghc/ && make 2) that allows to build only stage 2 compiler without rebuilding stage 1 or any of the libraries. One situation that comes to my mind that can really require a full rebuild is changing format of interface files. But other than that you shouldn't have to do a full rebuild too often.
I know how you feel. When I started working on GHC I had to do a full rebuild very often. But now I improved my workflow and only do a full build after a major rebase of my branch against master.
Janek
--- Politechnika Łódzka Lodz University of Technology
Treść tej wiadomości zawiera informacje przeznaczone tylko dla adresata. Jeżeli nie jesteście Państwo jej adresatem, bądź otrzymaliście ją przez pomyłkę prosimy o powiadomienie o tym nadawcy oraz trwałe jej usunięcie.
This email contains information intended solely for the use of the individual to whom it is addressed. If you are not the intended recipient or if you have received this message in error, please notify the sender and delete it from your system.

Hi Ömer,
I'll offer my own tips & tricks below. Adopt which ones you like!
On Oct 20, 2015, at 9:19 AM, Ömer Sinan Ağacan
I'm actually swtiching branches quite a lot, because most of the time I have multiple tasks at hand, working on multiple tickets etc.
Yes, switching branches causes lots of problems. To avoid this, I maintain many (13, today) different ghc repos, each in different states/branches. Then I don't have to recompile. Since starting doing this, I haven't looked back -- much better than just one repo with many branches. And git makes it easy enough to move changes back and forth when necessary. (Some repos are actually on the same branch as others but just with different build settings.)
But I think there's another way to introduce this kind of failures. Since compilation take very long, I never start the build process and wait until it's done, I keep coding in the meantime. Maybe I should rsync changes manually to another directory and run build there while I keep working on current tree etc.
I do this also and have not run into trouble with editing while compiling. I don't think this is the issue.
I just tried `make 1` in ghc directory and I think it worked(I'll try on a clean tree once I have to `make clean` and see if it's really building only stage-1). But my next question is why marking it as such in build.mk doesn't work.. I'd expect `devel1` to build stage1 only.
devel1 means that you're debugging the stage1 compiler, so that compiler is built without optimizations and with DEBUG set. But a great test case for debugging the compiler is building GHC itself. So I wouldn't want devel1 to stop building stage2. Richard
2015-10-20 3:12 GMT-04:00 Jan Stolarek
: it's very easy to end up in a state where `make` simply can't build, and only easy fix is a `make clean` Out of sheer curiosity: in what situations does that happen for you? *If* you are working on a single branch, ie. you're not switching back and forth between master and your feature branches, this should not happen (and even if you switch between branches it should still be safe for most of the time). Richard already gave you a trick (cd ghc/ && make 2) that allows to build only stage 2 compiler without rebuilding stage 1 or any of the libraries. One situation that comes to my mind that can really require a full rebuild is changing format of interface files. But other than that you shouldn't have to do a full rebuild too often.
I know how you feel. When I started working on GHC I had to do a full rebuild very often. But now I improved my workflow and only do a full build after a major rebase of my branch against master.
Janek
--- Politechnika Łódzka Lodz University of Technology
Treść tej wiadomości zawiera informacje przeznaczone tylko dla adresata. Jeżeli nie jesteście Państwo jej adresatem, bądź otrzymaliście ją przez pomyłkę prosimy o powiadomienie o tym nadawcy oraz trwałe jej usunięcie.
This email contains information intended solely for the use of the individual to whom it is addressed. If you are not the intended recipient or if you have received this message in error, please notify the sender and delete it from your system.
ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
participants (4)
-
Jan Stolarek
-
Richard Eisenberg
-
Thomas Miedema
-
Ömer Sinan Ağacan