riot icon indicating copy to clipboard operation
riot copied to clipboard

core sublibrary clashes with core alternate standard library

Open roddyyaga opened this issue 1 year ago • 5 comments

Hey, I'm running into problems using this in a project that also depends on https://github.com/janestreet/core (inconsistent assumptions over interface for Core__Ref). Changing the riot files to reference riot.core doesn't fix this.

Could this be renamed to riot_core or something? That's how I fixed it locally. Possibly this is a bug in dune (I vaguely thought this was supposed to work), but even if it is I guess the fix for that will take a while, so it would be nice to fix it in riot.

roddyyaga avatar Dec 21 '23 13:12 roddyyaga

Thanks for flagging this! 👍🏼 I'll look at how to hide those libs, this stuff should be contained in the Riot.Runtime module.

leostera avatar Dec 21 '23 15:12 leostera

Incoming fix! 🚀 This should fix it: https://github.com/leostera/riot/commit/329b09382da4d628657cbbfee3382d6c2012151a – could you pin it locally and let me know if it solves your issue?

leostera avatar Dec 21 '23 15:12 leostera

@roddyyaga did this fix it for you?

leostera avatar Dec 26 '23 17:12 leostera

I get this with riot 0.0.8

File "bin/amq.ml", line 1:          
Error: The files /home/user/.opam/5.1.1/lib/async/async.cmi
       and bin/.main.eobjs/byte/dune__exe__Datatypes.cmi
       make inconsistent assumptions over interface Core
Had 1 error, waiting for filesystem changes...


FraMecca avatar Mar 11 '24 15:03 FraMecca

As per @anmonteiro's suggestion we should try using (include_subdirs qualified) at the riot/runtime level to just ship a single library for the whole runtime.

leostera avatar Mar 22 '24 21:03 leostera

I ran into issues with (include_subdirs qualified) since some of the subdirs need to refer to each other. So, in #85 I went with (include_subdirs unqualified) instead, and then just manually added a bunch of wrapper modules so that e.g. Core still appears as a module name.

For what it's worth, https://github.com/ocaml/dune/issues/3864 would probably make all of this unnecessary.

leviroth avatar May 30 '24 11:05 leviroth