New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Toplevel "ocaml -plugin" is not usable #7570
Comments
Comment author: @xavierleroy 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. |
Comment author: @Octachron I gladly concede that the fact that I may be the first to stumble on this issue 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. |
Comment author: @alainfrisch The toplevel already loads .cmo/.cma passed on the command-line. How would "-plugin" be different? |
Comment author: @Octachron 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: #1381 . |
Comment author: @xavierleroy "Resolved" by removing the ocaml -plugin option and its documentation. |
Original bug ID: 7570
Reporter: @Octachron
Status: resolved (set by @xavierleroy on 2017-09-30T09:05:15Z)
Resolution: fixed
Priority: low
Severity: minor
Version: 4.05.0 +dev/beta1/beta2/beta3/rc1
Target version: 4.06.0 +dev/beta1/beta2/rc1
Fixed in version: 4.06.0 +dev/beta1/beta2/rc1
Category: compiler driver
Monitored by: @gasche
Bug description
Since OCaml 4.03 and #6108, 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")".
The text was updated successfully, but these errors were encountered: