Simon Marlow | 14 Aug 10:01

Re: Build system idea

Roman Leshchinskiy wrote:

> But that is precisely my (other) point. A lot of that work is really 
> unnecessary and could be done by Cabal since it only or mostly depends 
> on the package information. Instead, it is implemented somewhere in 
> Distribution.Simple and not really usable from the outside. For 
> instance, a lot of the functionality of setup sdist, setup register and 
> so on could be implemented generically and used by a make-based build 
> system as well.

That's exactly what I'm proposing we do in GHC: re-use Cabal's setup 
register and some of the other parts of the simple build system in a 
make-based build system for packages.  It might require a bit of 
refactoring of Cabal, but I don't expect it to be a major upheaval at all.

I think what you're proposing is mostly a matter of abstracting parts of 
Cabal with cleaner and more modular APIs, which is absolutely a good thing, 
but doesn't require a fundamental redesign.  The tight coupling and lack of 
separation between Cabal's generic parts and the simple build system is 
somewhat accidental (lazy implementors :-), and is actually a lot better 
than it used to be thanks to the work Duncan has put in.  I'm sure it'll 
improve further over time.

The other part of your complaint is that the BuildInfo is in the .cabal 
file along with the PackageDescription (the types are pretty well separated 
internally).  Again I don't think there's anything fundamental here, and in 
fact some packages have separate .buildinfo files.

Cheers,
	Simon
(Continue reading)

Roman Leshchinskiy | 15 Aug 06:06
Favicon

Re: Build system idea

On 14/08/2008, at 18:01, Simon Marlow wrote:

> Roman Leshchinskiy wrote:
>
>> But that is precisely my (other) point. A lot of that work is  
>> really unnecessary and could be done by Cabal since it only or  
>> mostly depends on the package information. Instead, it is  
>> implemented somewhere in Distribution.Simple and not really usable  
>> from the outside. For instance, a lot of the functionality of setup  
>> sdist, setup register and so on could be implemented generically  
>> and used by a make-based build system as well.
>
> That's exactly what I'm proposing we do in GHC: re-use Cabal's setup  
> register and some of the other parts of the simple build system in a  
> make-based build system for packages.  It might require a bit of  
> refactoring of Cabal, but I don't expect it to be a major upheaval  
> at all.

Ah! I hadn't realised that you are going to reuse Cabal functionality.  
You wrote "Extract the code from Cabal that generates Makefiles" so I  
thought you won't be really using anything from Cabal.

> I think what you're proposing is mostly a matter of abstracting  
> parts of Cabal with cleaner and more modular APIs, which is  
> absolutely a good thing, but doesn't require a fundamental  
> redesign.  The tight coupling and lack of separation between Cabal's  
> generic parts and the simple build system is somewhat accidental  
> (lazy implementors :-), and is actually a lot better than it used to  
> be thanks to the work Duncan has put in.  I'm sure it'll improve  
> further over time.
(Continue reading)


Gmane