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

#use in the toplevel loads existing stale .cmo #7571

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

Comments

Projects
None yet
1 participant
@vicuna
Copy link
Collaborator

vicuna commented Jun 27, 2017

Original bug ID: 7571
Reporter: nbb
Status: resolved (set by @xavierleroy on 2017-06-27T14:01:17Z)
Resolution: unable to duplicate
Priority: normal
Severity: minor
Version: 4.04.0
Category: toplevel

Bug description

the #use directive is described as

#use
Read, compile and execute source phrases from the given file.

but when i change the .ml and #use it while still an old corresponding .cmo is available to the toplevel this old file seems to be used.

Steps to reproduce

make a source file a.ml.
compile to bytecode a.cmo either in current directory or in _build directory as done by ocamlbuild.
edit and change a.ml.
open utop, if necessary add _build as #directory.
in utop, #use "a.ml";;
the old version will be loaded

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Jun 27, 2017

Comment author: nbb

possibly the cleanest way of handling this would be to make a temporary, private copy of the freshly compiled a.cmo? probably better than just updating the .cmo as a side effect.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Jun 27, 2017

Comment author: @xavierleroy

I am unable to reproduce the problem, either with the normal toplevel "ocaml" nor with "utop".

If you have a shell script that reproduces the problem using only "ocaml" (because "utop" is a separate project), please post it here and we'll investigate some more.

@vicuna vicuna closed this Jun 27, 2017

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Jun 27, 2017

Comment author: nbb

ok, i'll first make a utop example and then see for ocaml -- should have done that from the start...

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.