Hi, I took another look at the Makefile regarding this problem and I think there are 3 use cases to focus on. These uses cases concern partial compilation of Haskell sources, i.e., I have compiled some Haskell sources with some flags and other Haskell sources with other flags, and I don't want to mix different flags in the same linkage stage.
The three uses cases are: 1. Normal compilation 2. Compilation with profiling 3. Compilation with coverage This means, for example, that we shouldn't mix Haskell object files compiled with profiling with those compiled with coverage. There are other flags that control Haskell compilation, such as, PCRE and Parallel3, that control whether these libraries are available. However, these seem less important in the following sense: they are defined at configure time and they should remain the same while compiling the Haskell binaries. In other words, I don't thinkg that we should worry about someone compiling some Haskell source files with PCRE and some other Haskell source files without PCRE. The same for Parallel3. Anyone care to comment ? Thanks, Jose On Wed, Aug 07, 2013 at 11:35:15AM +0200, Guido Trotter wrote: > On Tue, Aug 6, 2013 at 7:05 PM, Iustin Pop <[email protected]> wrote: > > On Tue, Aug 06, 2013 at 06:24:21PM +0200, Iustin Pop wrote: > >> On Tue, Aug 06, 2013 at 04:56:29PM +0200, Guido Trotter wrote: > >> > On Tue, Aug 6, 2013 at 4:17 PM, Jose A. Lopes <[email protected]> > >> > wrote: > >> > > From: "Jose A. Lopes" <[email protected]> > >> > > > >> > > Remove filename suffix, for Haskell object and interface file, in GHC > >> > > invocation to prevent recompilation of the same Haskell sources. > >> > > > >> > > Signed-off-by: Jose A. Lopes <[email protected]> > >> > > --- > >> > > Makefile.am | 1 - > >> > > 1 file changed, 1 deletion(-) > >> > > > >> > > diff --git a/Makefile.am b/Makefile.am > >> > > index e32e31a..56b8e82 100644 > >> > > --- a/Makefile.am > >> > > +++ b/Makefile.am > >> > > @@ -866,7 +866,6 @@ $(HS_ALL_PROGS): %: %.hs $(HS_LIBTESTBUILT_SRCS) > >> > > Makefile > >> > > $(GHC) --make \ > >> > > $(HFLAGS) \ > >> > > $(HS_PARALLEL3) $(HS_REGEX_PCRE) \ > >> > > - -osuf $(notdir $@).o -hisuf $(notdir $@).hi \ > >> > > $(HEXTRA) $(HEXTRA_INT) $@ > >> > > @touch "$@" > >> > > > >> > > >> > Are you sure this is enough? > >> > d5506465b53089cc3c3d126fc42fc26c971271b7 says this was introduced > >> > because: > >> > > >> > - different compilation options are used for different tools > >> > - different libraries are used in different binaries (and thus I > >> > suppose different preprocessing directories enabling/disabling code, > >> > eg. if we don't have some optional library installed that would allow > >> > some tool to work but not others) > >> > >> Furthermore, removing this will break parallel compilation, because then > >> multiple targets will attempt to build the same target file at once. > > > > By the way, buildbot should test this using -j8 or -j16, so it could be > > used as a test if this patch works (in regard to parallel builds). > > > > Well, that means it "might" or might not work. > Also depending on how many cpus the machine has, the order in which > things happen that day, randomness, etc :) > > Guido
