caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] OASIS and conditional compilation
@ 2012-12-15 16:02 Dario Teixeira
  2012-12-15 16:17 ` Wojciech Meyer
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Dario Teixeira @ 2012-12-15 16:02 UTC (permalink / raw)
  To: OCaml mailing-list; +Cc: Sylvain Le Gall

Hi,

I've come across a perplexing issue with OASIS.  I'm not sure if this is
just a bug or if I'm trying to push the tool beyond its design parameters.

PG'OCaml can be compiled against either Batteries or ExtLib (the latter
mostly for legacy compatibility). To allow the harmonious coexistence of
the two options in the same system, the build system should allow for
the compilation of one or the two versions of the library side by side.
In OASIS-speak (I'm using version 0.3):

  Flag "batteries"
    Description: Link PG'OCaml against Batteries
    Default: true

  Flag "extlib"
    Description: Link PG'OCaml against ExtLib
    Default: true

  Library "pgocaml_batteries"
    Build$:               flag(batteries)
    Install$:             flag(batteries)
    Path:                 src
    Modules:              PGOCaml, PGOCaml_generic
    BuildDepends:         unix, calendar, csv, pcre, batteries, camlp4.macro
    ByteOpt+:             -ppopt -DUSE_BATTERIES
    NativeOpt+:           -ppopt -DUSE_BATTERIES
    FindlibContainers:    pgocaml
    Findlibname:          batteries
    XMETARequires:        unix, calendar, csv, pcre, batteries

  Library "pgocaml_extlib"
    Build$:               flag(extlib)
    Install$:             flag(extlib)
    Path:                 src
    Modules:              PGOCaml, PGOCaml_generic
    BuildDepends:         unix, calendar, csv, pcre, extlib, camlp4.macro
    FindlibContainers:    pgocaml
    Findlibname:          extlib
    XMETARequires:        unix, calendar, csv, pcre, extlib

Note that the major difference is that "-ppopt -DUSE_BATTERIES" must be
passed to Camlp4 only when compiling the Batteries version.  The problem
is that it's *always* passed, even if the "batteries" flag is disabled
by passing "--disable-batteries" to the configure script.

Did I misinterpret something crucial about OASIS, or is this indeed a bug?

Thanks in advance!
Best regards,
Dario Teixeira

P.S. The full OASIS spec file can be viewed at this location:
     https://forge.ocamlcore.org/scm/viewvc.php/branches/oasification/_oasis?revision=157&root=pgocaml

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] OASIS and conditional compilation
  2012-12-15 16:02 [Caml-list] OASIS and conditional compilation Dario Teixeira
@ 2012-12-15 16:17 ` Wojciech Meyer
  2012-12-15 16:56   ` Dario Teixeira
  2012-12-15 17:23   ` Sylvain Le Gall
  2012-12-15 16:59 ` Török Edwin
  2012-12-16  1:13 ` Jacques-Pascal Deplaix
  2 siblings, 2 replies; 8+ messages in thread
From: Wojciech Meyer @ 2012-12-15 16:17 UTC (permalink / raw)
  To: Dario Teixeira; +Cc: OCaml mailing-list, Sylvain Le Gall

Hi,

Dario Teixeira <darioteixeira@yahoo.com> writes:

> Note that the major difference is that "-ppopt -DUSE_BATTERIES" must be
> passed to Camlp4 only when compiling the Batteries version.  The problem
> is that it's *always* passed, even if the "batteries" flag is disabled
> by passing "--disable-batteries" to the configure script.

Probably it's a leftover setup.data, that contains these flags.

Just remove setup.data and regenerate files,

-- 
Wojciech Meyer
http://danmey.org

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] OASIS and conditional compilation
  2012-12-15 16:17 ` Wojciech Meyer
@ 2012-12-15 16:56   ` Dario Teixeira
  2012-12-15 17:23   ` Sylvain Le Gall
  1 sibling, 0 replies; 8+ messages in thread
From: Dario Teixeira @ 2012-12-15 16:56 UTC (permalink / raw)
  To: Wojciech Meyer; +Cc: OCaml mailing-list, Sylvain Le Gall

Hi,



> Probably it's a leftover setup.data, that contains these flags.
> 
> Just remove setup.data and regenerate files,

Thanks for the reply.

No, that's not it.  The problem persists even after a complete
cleanup and regeneration.

Best regards,
Dario

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] OASIS and conditional compilation
  2012-12-15 16:02 [Caml-list] OASIS and conditional compilation Dario Teixeira
  2012-12-15 16:17 ` Wojciech Meyer
@ 2012-12-15 16:59 ` Török Edwin
  2012-12-15 18:31   ` Dario Teixeira
  2012-12-16  1:13 ` Jacques-Pascal Deplaix
  2 siblings, 1 reply; 8+ messages in thread
From: Török Edwin @ 2012-12-15 16:59 UTC (permalink / raw)
  To: caml-list

On 12/15/2012 06:02 PM, Dario Teixeira wrote:
> Hi,
> 
> I've come across a perplexing issue with OASIS.  I'm not sure if this is
> just a bug or if I'm trying to push the tool beyond its design parameters.
> 
> PG'OCaml can be compiled against either Batteries or ExtLib (the latter
> mostly for legacy compatibility). To allow the harmonious coexistence of
> the two options in the same system, the build system should allow for
> the compilation of one or the two versions of the library side by side.
> In OASIS-speak (I'm using version 0.3):
> 
>   Flag "batteries"
>     Description: Link PG'OCaml against Batteries
>     Default: true
> 
>   Flag "extlib"
>     Description: Link PG'OCaml against ExtLib
>     Default: true
> 
>   Library "pgocaml_batteries"
>     Build$:               flag(batteries)
>     Install$:             flag(batteries)
>     Path:                 src
>     Modules:              PGOCaml, PGOCaml_generic
>     BuildDepends:         unix, calendar, csv, pcre, batteries, camlp4.macro
>     ByteOpt+:             -ppopt -DUSE_BATTERIES
>     NativeOpt+:           -ppopt -DUSE_BATTERIES

I think it simply adds these to the tags file, and since its the same module name
in both cases it'll get built with those flags even when batteries is disabled.

--Edwin

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] OASIS and conditional compilation
  2012-12-15 16:17 ` Wojciech Meyer
  2012-12-15 16:56   ` Dario Teixeira
@ 2012-12-15 17:23   ` Sylvain Le Gall
  2012-12-15 18:25     ` Dario Teixeira
  1 sibling, 1 reply; 8+ messages in thread
From: Sylvain Le Gall @ 2012-12-15 17:23 UTC (permalink / raw)
  To: Wojciech Meyer; +Cc: Dario Teixeira, caml-list

[-- Attachment #1: Type: text/plain, Size: 897 bytes --]

Hi,

Can you send me  the generated _tags.

The problem is probably in the fact that the same file are compiled twice
and are applied exactly the same set of options in ocamlbuild.

Note that in general ocaml doesn't support well conditional compilation....

Regards
Sylvain
Le 15 déc. 2012 17:17, "Wojciech Meyer" <wojciech.meyer@gmail.com> a écrit :

> Hi,
>
> Dario Teixeira <darioteixeira@yahoo.com> writes:
>
> > Note that the major difference is that "-ppopt -DUSE_BATTERIES" must be
> > passed to Camlp4 only when compiling the Batteries version.  The problem
> > is that it's *always* passed, even if the "batteries" flag is disabled
> > by passing "--disable-batteries" to the configure script.
>
> Probably it's a leftover setup.data, that contains these flags.
>
> Just remove setup.data and regenerate files,
>
> --
> Wojciech Meyer
> http://danmey.org
>

[-- Attachment #2: Type: text/html, Size: 1395 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] OASIS and conditional compilation
  2012-12-15 17:23   ` Sylvain Le Gall
@ 2012-12-15 18:25     ` Dario Teixeira
  0 siblings, 0 replies; 8+ messages in thread
From: Dario Teixeira @ 2012-12-15 18:25 UTC (permalink / raw)
  To: Sylvain Le Gall, Wojciech Meyer; +Cc: caml-list

Hi,

>Can you send me  the generated _tags.

>The problem is probably in the fact that the same file are compiled twice and are applied exactly the same set of options in ocamlbuild.
>Note that in general ocaml doesn't support well conditional compilation....
>Regards
>Sylvain


Thanks for the reply.

The _tags file is here:
https://forge.ocamlcore.org/scm/viewvc.php/branches/oasification/_tags?revision=155&root=pgocaml

But anyway, it seems my original intention may not be feasible.
Consequently, I'm tempted to simply drop the support for ExtLib
in newer releases of PG'OCaml.  This will simplify the build system
tremendously.  Moreover, since modern packaging tools like OPAM
allow pinning a package to an older version, legacy users won't
be forced to upgrade.

Best regards,
Dario Teixeira


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] OASIS and conditional compilation
  2012-12-15 16:59 ` Török Edwin
@ 2012-12-15 18:31   ` Dario Teixeira
  0 siblings, 0 replies; 8+ messages in thread
From: Dario Teixeira @ 2012-12-15 18:31 UTC (permalink / raw)
  To: Török Edwin, caml-list

Hi,

> I think it simply adds these to the tags file, and since its the same module name

> in both cases it'll get built with those flags even when batteries is  disabled.
 
Thanks for the reply.  Yes, my build needs would require OASIS to essentially
perform two separate builds, each with its own _tags file.  Alternatively, I would
need to duplicate and rename the source files, or use some file inclusion mechanism.
Either way would further complicate the build process, though...

Cheers,
Dario Teixeira

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] OASIS and conditional compilation
  2012-12-15 16:02 [Caml-list] OASIS and conditional compilation Dario Teixeira
  2012-12-15 16:17 ` Wojciech Meyer
  2012-12-15 16:59 ` Török Edwin
@ 2012-12-16  1:13 ` Jacques-Pascal Deplaix
  2 siblings, 0 replies; 8+ messages in thread
From: Jacques-Pascal Deplaix @ 2012-12-16  1:13 UTC (permalink / raw)
  To: Dario Teixeira, OCaml mailing list

On 12/15/2012 05:02 PM, Dario Teixeira wrote:
> Hi,
>
> I've come across a perplexing issue with OASIS.  I'm not sure if this is
> just a bug or if I'm trying to push the tool beyond its design parameters.
>
> PG'OCaml can be compiled against either Batteries or ExtLib (the latter
> mostly for legacy compatibility). To allow the harmonious coexistence of
> the two options in the same system, the build system should allow for
> the compilation of one or the two versions of the library side by side.
> In OASIS-speak (I'm using version 0.3):
>
>   Flag "batteries"
>     Description: Link PG'OCaml against Batteries
>     Default: true
>
>   Flag "extlib"
>     Description: Link PG'OCaml against ExtLib
>     Default: true
>
>   Library "pgocaml_batteries"
>     Build$:               flag(batteries)
>     Install$:             flag(batteries)
>     Path:                 src
>     Modules:              PGOCaml, PGOCaml_generic
>     BuildDepends:         unix, calendar, csv, pcre, batteries, camlp4.macro
>     ByteOpt+:             -ppopt -DUSE_BATTERIES
>     NativeOpt+:           -ppopt -DUSE_BATTERIES
>     FindlibContainers:    pgocaml
>     Findlibname:          batteries
>     XMETARequires:        unix, calendar, csv, pcre, batteries
>
>   Library "pgocaml_extlib"
>     Build$:               flag(extlib)
>     Install$:             flag(extlib)
>     Path:                 src
>     Modules:              PGOCaml, PGOCaml_generic
>     BuildDepends:         unix, calendar, csv, pcre, extlib, camlp4.macro
>     FindlibContainers:    pgocaml
>     Findlibname:          extlib
>     XMETARequires:        unix, calendar, csv, pcre, extlib
>
> Note that the major difference is that "-ppopt -DUSE_BATTERIES" must be
> passed to Camlp4 only when compiling the Batteries version.  The problem
> is that it's *always* passed, even if the "batteries" flag is disabled
> by passing "--disable-batteries" to the configure script.
>
> Did I misinterpret something crucial about OASIS, or is this indeed a bug?
>
> Thanks in advance!
> Best regards,
> Dario Teixeira
>
> P.S. The full OASIS spec file can be viewed at this location:
>      https://forge.ocamlcore.org/scm/viewvc.php/branches/oasification/_oasis?revision=157&root=pgocaml
>
Hi,

There is already a bug report for this:
https://forge.ocamlcore.org/tracker/index.php?func=detail&aid=1234&group_id=54&atid=291

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-12-16  1:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-15 16:02 [Caml-list] OASIS and conditional compilation Dario Teixeira
2012-12-15 16:17 ` Wojciech Meyer
2012-12-15 16:56   ` Dario Teixeira
2012-12-15 17:23   ` Sylvain Le Gall
2012-12-15 18:25     ` Dario Teixeira
2012-12-15 16:59 ` Török Edwin
2012-12-15 18:31   ` Dario Teixeira
2012-12-16  1:13 ` Jacques-Pascal Deplaix

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).