ocaml-community / utop

Universal toplevel for OCaml
Other
844 stars 112 forks source link

Xdg module unbound with utop 2.13.0 #446

Closed SnarkBoojum closed 1 year ago

SnarkBoojum commented 1 year ago

With utop 2.13.0:

utop # #use_output "dune utop";;
File "_none_", line 1:             
Error: Module `Xdg' is unavailable (required by `UTop_private')
Command exited with code 1.        

and indeed, if I try "open Xdg;;" in "utop", it fails -- I have to run "utop -I /usr/lib/ocaml/xdg" to make "open Xdg;;" work. But that doesn't fix the #use_output line...

emillon commented 1 year ago

Hi. Thanks for the report. How did you install utop?

#use_output "dune utop";;

This is not something that's supposed to work: dune utop (from your shell) is supposed to start utop with the right modules loaded. Does that work?

(for #use_output, the command to call is #use_output "dune top" but it's a different thing)

SnarkBoojum commented 1 year ago

No, "dune utop" doesn't work -- since the project doesn't build completely and that's actually what I want to debug!

emillon commented 1 year ago

what happens when you run dune utop from the shell?

emillon commented 1 year ago

hmm, forget about this. does your debugging approach work with an older version of utop? (also, how did you install utop)

SnarkBoojum commented 1 year ago

I install utop with the Debian package -- I'm part of the team preparing it. It did work in previous versions. I can use this debugging trick with the regular ocaml toplevel, but as you know it's a bit uncomfortable to work with.

SnarkBoojum commented 1 year ago

When I run "dune utop", it just sits telling me the compilation isn't done... one file is missing - the one failing!

emillon commented 1 year ago

It did work in previous versions.

utop 2.13.0 added a dependency against xdg >= 3.9.0, have you added that dependency on the Debian side? If so, do you have a log of utop 2.13.0 being built with it?

SnarkBoojum commented 1 year ago

Well, xdg isn't a separate package -- it's shipped with the dune package. The relevant part of the log is:

make[1]: Entering directory '/home/jpuydt/Debian/build/utop-2.13.0'
dune build -p utop
make[1]: Leaving directory '/home/jpuydt/Debian/build/utop-2.13.0'

where I can only see that I should find a way to make the build more verbose on what it does!

But there are neither error nor warning: dune does find xdg required from src/lib/dune.

emillon commented 1 year ago

I think we need to take one step back: what steps, exactly, used to work with utop 2.12.1, and do not work with the version you're packaging? If it's the dune utop command, in which project are you running this command?

SnarkBoojum commented 1 year ago

I just tried to build a small example of the problem -- and I couldn't reproduce the Xdg issue. And it turns out that when there's a compilation problem, you just have to wait long enough for dune to decide it has reached 100% anyway.

Sorry for the noise.