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

Utop in Emacs under Windows crashes when UTop is mistyped as Utop #411

Open
ysalmon opened this issue Jan 23, 2023 · 2 comments
Open

Utop in Emacs under Windows crashes when UTop is mistyped as Utop #411

ysalmon opened this issue Jan 23, 2023 · 2 comments

Comments

@ysalmon
Copy link

ysalmon commented Jan 23, 2023

I am fumbling with Emacs+Utop+company under Windows, and I may have stumbled into some bug.

At the prompt from utop mode in Emacs, if I type Utop (instead of UTop), then a dot, the text cursor stops blinking, and if I type another character, utop crashes with code 2 after a Fatal error: exception Persistent_env.Error(_).

This happens too if I do the same kind of case-mistyping with modules not from the stdlib (eg. GRaphics), but not with eG. ARRay.

I also could not reproduce the behaviour under Linux.

I believe this to be related to filenames being case insensitive under windows : when one case-mistypes the module name, one still gets to the corresponding .cmi file, but the module name is wrong and this is not properly handled.

This is corroborated by the following : running utop directly in a cygwin terminal, typing Utop.version;; gives

Error: Wrong file naming: C:\OCaml64\home\yann\.opam\4.14.0+mingw64\lib\utop\utop.cmi
       contains the compiled interface for UTop when Utop was expected

although the file is actually named uTop.cmi.

Doing the same under linux gives Error: Unbound module Utop.

EDIT : this might be an OCaml bug or deficiency, in fact.

@ysalmon ysalmon changed the title Utop in Emacs under Windows crashes when eg. UTop is mistyped as eg. Utop Utop in Emacs under Windows crashes when UTop is mistyped as Utop Jan 23, 2023
@ysalmon
Copy link
Author

ysalmon commented Jan 23, 2023

There was an OCaml PR to perform case-sensitive search for cmi files, but it was not merged.

@emillon
Copy link
Collaborator

emillon commented Feb 22, 2023

Hi,
To determine if this is an issue with utop or the ocaml toplevel, can you try to reproduce it with the vanilla toplevel?
ie

% ocaml
#use "topfind";;
#require "graphics";;
#show_module GRaphics;;

Or something like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants