Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007808OCamltoplevelpublic2018-06-14 11:412018-12-02 16:07
Assigned Tonojebar 
PlatformOSOS Version
Product Version4.06.1 
Target VersionFixed in Version4.08.0+dev/beta1 
Summary0007808: Add an OCAML_TOPLEVEL_PATH variable to ocaml
DescriptionIn the new world of opam and its system and non-system switches allowing both:

  # #use "topfind"


  #!/usr/bin/env ocaml
  #use "topfind"

to work correctly has proven to be a dire source of hacks and workarounds (I can provide full details if one needs to be convinced).

It turns out that letting the `ocaml` binary be affected by an OCAML_TOPLEVEL_PATH variable, whose semantics would simply be to add the colon separated directories to the includes (#directory include) would allow us to get rid of all of these hacks.

Slightly related to 0007770
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
nojebar (developer)
2018-06-14 14:30

Note that you can already do this today by using OCAMLPARAM, e.g.

  OCAMLPARAM=I=<dir1>,I=<dir2>,_ ocaml

will result in <dir1> and <dir2> to be added to the list of include directories.
dbuenzli (reporter)
2018-06-14 14:38

Sure but I'd rather not use OCAMLPARAM for that as it affects all the ocaml tools and may be used by switches for other purposes.
gasche (administrator)
2018-06-14 16:31

The request seems sensible to me, but I think that the current name is a bit misleading (to me it says where to find the toplevel binary), I would expect INCLUDE_PATH to be in the name.
dbuenzli (reporter)
2018-06-14 16:52

Agreed on the name, I just reused what opam devs initially used. Here are a few candidates


Logic would go for OCAML_INCLUDE_PATH but this could be mistaken as applying to the compilers or one might want to reserve it for that purpose to follow the example of C_INCLUDE_PATH.

nojebar (developer)
2018-06-15 12:48 [^]
nojebar (developer)
2018-12-02 16:07

Merged, will be in 4.08.

- Issue History
Date Modified Username Field Change
2018-06-14 11:41 dbuenzli New Issue
2018-06-14 14:30 nojebar Note Added: 0019189
2018-06-14 14:38 dbuenzli Note Added: 0019190
2018-06-14 16:31 gasche Note Added: 0019191
2018-06-14 16:52 dbuenzli Note Added: 0019192
2018-06-15 12:48 nojebar Note Added: 0019196
2018-06-20 10:41 nojebar Assigned To => nojebar
2018-06-20 10:41 nojebar Status new => assigned
2018-12-02 16:07 nojebar Note Added: 0019497
2018-12-02 16:07 nojebar Status assigned => resolved
2018-12-02 16:07 nojebar Fixed in Version => 4.08.0+dev/beta1
2018-12-02 16:07 nojebar Resolution open => fixed

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker