Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
toplevels built with ocamlmktop should automatically get -I dirs added to #directory list #4672
Original bug ID: 4672
When ocamlmktop is used to create a toplevel, the -Iargument can be used to supply directories to the search path for .cmi files. However, when the toplevel is run, these directories must be supplied once again. It would be nice if the toplevel that is built would remember these directories.
In practice, I've found new users to be confused by the current behavior. The purpose of creating a toplevel is to create a stand-alone interpreter with all the needed modules pre-linked. However, without supplying the -I directories again (or by supplying them via #directory directives), these modules can't be opened even though their code is included in the toplevel. An "Unbound module" error will result.
As an alternative, perhaps the contents of the .cmi files needed by any linked-in modules could be included in the toplevel automatically. This would avoid the need to search any directories to find them when the toplevel is run. This would make the toplevel more self-contained.