cabal: other-modules

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

cabal: other-modules

Johannes Waldmann
What is the purpose of the "Other-Modules" section in a cabal file?
(I.e., can we drop it?)

If it's just the set of dependencies of the "Exported-Modules",
then a reasonable build system should be able to figure this out on its own.

The current situation is that I have to manage this list manually
(or is there some tool?) and if I forget to name some "other-module",
then "cabal install" happily builds and installs (!) the package anyway,
but I'm getting linker errors when using it.
This is a nuisance, to say the least.

J.W.


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: cabal: other-modules

Ivan Lazar Miljenovic
Johannes Waldmann <[hidden email]> writes:

> What is the purpose of the "Other-Modules" section in a cabal file?
> (I.e., can we drop it?)

Non-exported modules.

> If it's just the set of dependencies of the "Exported-Modules",
> then a reasonable build system should be able to figure this out on
> its own.

Explicit is better than implicit; this lets you have hidden modules that
don't get shipped, auto-generated modules, etc.

> The current situation is that I have to manage this list manually
> (or is there some tool?) and if I forget to name some "other-module",
> then "cabal install" happily builds and installs (!) the package anyway,
> but I'm getting linker errors when using it.

Interesting; it normally complains when this occurs (for me at least);
care to share the .cabal file to see which files it didn't complain
about?

--
Ivan Lazar Miljenovic
[hidden email]
IvanMiljenovic.wordpress.com
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: cabal: other-modules

Malcolm Wallace
In reply to this post by Johannes Waldmann

On 15 Apr 2010, at 08:24, Johannes Waldmann wrote:

> What is the purpose of the "Other-Modules" section in a cabal file?
> (I.e., can we drop it?)
>
> If it's just the set of dependencies of the "Exported-Modules",
> then a reasonable build system should be able to figure this out on  
> its own.

It is not used by the build system.  It is used by 'cabal sdist' to  
build a distribution package that contains everything needed.  If a  
file is not listed in the .cabal file, it will not end up in the  
tarball.  Cabal has no dependency analysis to help discover un-listed  
modules.

Regards,
     Malcolm

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: cabal: other-modules

Johannes Waldmann
What happened was this:

1. add some modules to a library (but forget to mention them in the cabal file),
   then (in the lib source dir, without cleaning/reconfiguring)
   "cabal install --global" (runs without complaint)

2. re-compile an application that uses the library
   (cabal configure && cabal build): this gave "undefined symbol" errors
   (for things from the added modules)

(with ghc-6.12.1 on i386 debian)

I still don't see why this "other-modules" is needed.
Ok, I understand the technical reason that cabal
does not do dependency analysis but morally, it should?

Best regards - J.W.


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Re: cabal: other-modules

José Pedro Magalhães
Hi,

On Thu, Apr 15, 2010 at 14:40, Johannes Waldmann <[hidden email]> wrote:
What happened was this:

1. add some modules to a library (but forget to mention them in the cabal file),
  then (in the lib source dir, without cleaning/reconfiguring)
  "cabal install --global" (runs without complaint)

2. re-compile an application that uses the library
  (cabal configure && cabal build): this gave "undefined symbol" errors
  (for things from the added modules)

Just to say that this has happened to me very often as well, on Windows. The first time it took me quite some time to realize what was going wrong...


Cheers,
Pedro


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Re: cabal: other-modules

Ivan Lazar Miljenovic
In reply to this post by Johannes Waldmann
Johannes Waldmann <[hidden email]> writes:
> What happened was this:
> I still don't see why this "other-modules" is needed.
> Ok, I understand the technical reason that cabal
> does not do dependency analysis but morally, it should?

Why are people suddenly using the term "morally" when they mean "why
doesn't this do what I think it should"?  None of its definitions seem
to match what you mean:
http://wordnetweb.princeton.edu/perl/webwn?s=moral

--
Ivan Lazar Miljenovic
[hidden email]
IvanMiljenovic.wordpress.com
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Re: cabal: other-modules

Dougal Stanton-2
On Thu, Apr 15, 2010 at 1:49 PM, Ivan Lazar Miljenovic
<[hidden email]> wrote:

> Johannes Waldmann <[hidden email]> writes:
>> What happened was this:
>> I still don't see why this "other-modules" is needed.
>> Ok, I understand the technical reason that cabal
>> does not do dependency analysis but morally, it should?
>
> Why are people suddenly using the term "morally" when they mean "why
> doesn't this do what I think it should"?  None of its definitions seem
> to match what you mean:
> http://wordnetweb.princeton.edu/perl/webwn?s=moral

The proper use of words isn't dictated by what is found in small
dictionaries but by the speakers of the language. Also I would caution
against the judgement 'sudden' if you haven't done a corpus check: the
recency illusion can be a real pain.

'Morally' seems just the perfect word for this occasion --- concerned
with right or proper conduct. In this case, potential discrepancies
between the files that cabal 'knows' about when issuing different
commands; or the sense of deceit when it 'appears' to work only for
faults to appear further down the line.

I would guess this is just something we have to live with if cabal
can't be expected to include its own parser & dependency chaser.

Documentation is always a good first step though :-)

Cheers,

D
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Re: cabal: other-modules

Casey McCann
On Thu, Apr 15, 2010 at 10:45 AM, Dougal Stanton
<[hidden email]> wrote:
> 'Morally' seems just the perfect word for this occasion --- concerned
> with right or proper conduct. In this case, potential discrepancies
> between the files that cabal 'knows' about when issuing different
> commands; or the sense of deceit when it 'appears' to work only for
> faults to appear further down the line.

Beyond that, there are long established traditions in some parts of
programming and mathematics for using ethical/moral terms to describe
qualities that go beyond just technical requirements or correctness;
this program should do the Right Thing, that bit of code is "evil",
and so on. Actually defining this "moral sense" is difficult, though,
and it varies somewhat from one person to another, but there seems to
be at least some common, shared understanding. It's about "should" and
"proper" instead of "is" or "must". Personally, I know I've written
code that I'd feel guilty about even if it worked perfectly and no one
else ever saw it--what else would you call that feeling?

>From another angle, here's an example of explicit moral terminology
applied to mathematics: http://www.cheng.staff.shef.ac.uk/morality/
The mathematical sense there is slightly different from the
programming sense, I think, but there seems to be some crossover. For
instance, I've gotten the impression that something like a
mathematical "moral sense" underlies much of the interest in
programming language semantics, FRP, and dependently-typed languages,
though I don't know if the people involved would necessarily call it
that.

- C.
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Re: cabal: other-modules

Brandon S Allbery KF8NH
In reply to this post by Ivan Lazar Miljenovic
On Apr 15, 2010, at 08:49 , Ivan Lazar Miljenovic wrote:
> Why are people suddenly using the term "morally" when they mean "why
> doesn't this do what I think it should"?  None of its definitions seem
> to match what you mean:


That depends on how cynical you are about religion.  :)

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [hidden email]
system administrator [openafs,heimdal,too many hats] [hidden email]
electrical and computer engineering, carnegie mellon university    KF8NH



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe

PGP.sig (202 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Re: cabal: other-modules

wren ng thornton
Ivan Lazar Miljenovic wrote:
> Why are people suddenly using the term "morally" when they mean "why
> doesn't this do what I think it should"?  None of its definitions seem
> to match what you mean:

The usage on this thread seems a bit nonstandard, but I'm assuming it's
based off the more general idiom of things being "morally equivalent"---
that is, things which *should* be equal because we mean for them to be
(regardless of what a particular model (e.g., a programming language) says).

In other words, with the right set of beliefs (i.e., "moral" beliefs, or
the "right" religion) they are indeed equal, but the world is violating
those beliefs somehow. The implication being that the world (model,
PL,...) should be changed, rather than the beliefs.

--
Live well,
~wren
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe