Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007570OCamlcompiler driverpublic2017-06-27 12:272017-09-30 11:05
Assigned To 
PlatformOSOS Version
Product Version4.05.0 +dev/beta1/beta2/beta3/rc1 
Target Version4.06.0 +dev/beta1/beta2/rc1Fixed in Version4.06.0 +dev/beta1/beta2/rc1 
Summary0007570: Toplevel "ocaml -plugin" is not usable
DescriptionSince OCaml 4.03 and 0006108, the dynlink library cannot be used inside the toplevel. However, like "ocamlc" and "ocamlopt", the toplevel "ocaml" provides a "-plugin" option. Trying to use this option yields a toplevel fatal error due to the uncatched exception:
"Invalid_argument("The dynlink.cma library cannot be used inside the OCaml toplevel")".
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
xleroy (administrator)
2017-06-27 16:04

Indeed, dynlink is not usable from the toplevel, because the toplevel provides its own dynlink-like mechanisms, see in particular the way the #load directive is implemented.

This said, the fact that no one noticed the issue until now suggests that there is no use for plugins inside the toplevel and that this functionality could also be removed.
octachron (developer)
2017-06-27 18:18

I gladly concede that the fact that I may be the first to stumble on this issue
clearly indicates that this is not a very sought after feature.

However, this may be partially due to the lack of documentation for compiler plugins up to now.

In term of use case, I was thinking that with plugins working uniformly across the compilers and the toplevel, it may be possible to offload the internationalization of errors and warnings messages to a plugin with just a handful of new hooks in the compiler.
frisch (developer)
2017-06-30 10:33

The toplevel already loads .cmo/.cma passed on the command-line. How would "-plugin" be different?
octachron (developer)
2017-09-29 19:53

One difference might be that the "-plugin" option can modify the arguments of ocamlc/ocamlopt, another point would be just for the sake of symmetry with ocamlc/ocamlopt. Anyway, since the feature is still not functional, I think it ought to be removed for now: [^] .
xleroy (administrator)
2017-09-30 11:05

"Resolved" by removing the ocaml -plugin option and its documentation.

- Issue History
Date Modified Username Field Change
2017-06-27 12:27 octachron New Issue
2017-06-27 13:37 octachron Description Updated View Revisions
2017-06-27 16:04 xleroy Note Added: 0018005
2017-06-27 16:04 xleroy Status new => acknowledged
2017-06-27 18:18 octachron Note Added: 0018008
2017-06-30 10:33 frisch Note Added: 0018018
2017-09-29 19:53 octachron Note Added: 0018401
2017-09-30 11:05 xleroy Note Added: 0018414
2017-09-30 11:05 xleroy Status acknowledged => resolved
2017-09-30 11:05 xleroy Resolution open => reopened
2017-09-30 11:05 xleroy Fixed in Version => 4.06.0 +dev/beta1/beta2/rc1
2017-09-30 11:05 xleroy Target Version => 4.06.0 +dev/beta1/beta2/rc1
2017-09-30 11:05 xleroy Resolution reopened => fixed

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker