Skip to content
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

Closed
vicuna opened this Issue Jun 27, 2017 · 5 comments

Comments

Projects
None yet
1 participant
@vicuna
Copy link
Collaborator

commented Jun 27, 2017

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")".

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 27, 2017

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.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 27, 2017

Comment author: @Octachron

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.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 30, 2017

Comment author: @alainfrisch

The toplevel already loads .cmo/.cma passed on the command-line. How would "-plugin" be different?

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Sep 29, 2017

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 .

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Sep 30, 2017

Comment author: @xavierleroy

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

@vicuna vicuna closed this Sep 30, 2017

@vicuna vicuna added this to the 4.06.0 milestone Mar 14, 2019

@vicuna vicuna added the bug label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.