al-damiri has quit [Quit: Connection closed for inactivity]
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
nullifidian_ has joined #ocaml
nullifidian has quit [Ping timeout: 256 seconds]
infinity0 has quit [Ping timeout: 256 seconds]
pierpa has joined #ocaml
infinity0 has joined #ocaml
kmicinski has joined #ocaml
<kmicinski>
I'm trying to package some ocaml modules from one of my projects into a findlib library, and yet the internet seems to be of zero use here. Any tips? I've put them all in a `project.mlpack` and then done `ocamlbuild project.cmo`, followed by doing a `ocamlfind install project project.cmo META`
<kmicinski>
Is that roughly the right idea? When I try to use the findlib project somewhere else, I don't seem to be pulling in any of the modules that I believe I've included.
mfp has quit [Ping timeout: 260 seconds]
<companion_cube>
I think it's `ocamlfind install project META files`
<companion_cube>
ocamlfind wants the META file first
<companion_cube>
(I think)
<kmicinski>
right, so that will theoretically get me where I need to be? (I.e., this isn't just a totally stupid road)
Haudegen has quit [Remote host closed the connection]
<companion_cube>
oh otherwise it looks fine!
silver has quit [Read error: Connection reset by peer]
<companion_cube>
either foo.mlpack or foo.mllib will make you a library, I think, if you ask `ocamlbuild foo.cma`
<companion_cube>
(the mlpack will pack modules into namespace Foo)
<kmicinski>
ah, so it's cma, what's the diff vs cmo, bytecode vs native?
<companion_cube>
cma is a bytecode lib, cmxa a native lib
<kmicinski>
Okay, the last thing you said makes sense, and that's what I thought
<companion_cube>
you will also want to install the .cmi files
<kmicinski>
ah, so what's a `.cmo`?
<kmicinski>
for some reason I feel like I saw that alongside a lot of `.mlpack` docs
<companion_cube>
a .cmo is like a .o for C
<companion_cube>
it's an object file for one module
<companion_cube>
in bytecode
<companion_cube>
.cmx is an object file in native
<companion_cube>
a .cma contains a bunch of .cmo, a .cmxa a bunch of .cmx
<kmicinski>
okay, that helps.
<kmicinski>
that roughly aligns with my intuition
<kmicinski>
Ocamlbuild knows of no rules that apply to a target named src/test/inputs/src/project.mly
<kmicinski>
So that's what I get now, after everything builds
<kmicinski>
(Along with "This can happen if you ask Ocamlbuild to build a target with the wrong extension (e.g. .opt instead of .native) or if the source files live in directories that have not been specified as include directories")
<companion_cube>
look into _build/_log to see what's the last thing it tried to build
<kmicinski>
looks like there might be a circular build problem somewhere
<kmicinski>
there is a graph with a lot of shared-looking prefixes
<companion_cube>
yeah, I alwys forget how to fix that, you'll have to find out yourself
<companion_cube>
is it new code?
<kmicinski>
My intuition tells me that the build system has a maximum constraint depth and gives up
<kmicinski>
so it's code that I haven't built into a library before
<kmicinski>
but builds fine as is
<companion_cube>
you might want to give dune/jbuilder a try
<kmicinski>
hm.
<companion_cube>
it does a lot of things for you
<kmicinski>
yeah
govg has quit [Ping timeout: 260 seconds]
govg has joined #ocaml
<kmicinski>
So it looks like the problem is that I have all these directories that are not source files that ocamlbuild shouldn't be looking at, and when it goes into those it breaks
richi235 has quit [Remote host closed the connection]
<kmicinski>
Even if they have -traverse set
govg has quit [Ping timeout: 264 seconds]
<companion_cube>
weird
govg has joined #ocaml
<companion_cube>
with -traverse it shouldn't look at them at all
<companion_cube>
d oyou have something like "<foo/bar>: -traverse" in your _tags?
richi235 has joined #ocaml
<kmicinski>
Yes, that's right
<kmicinski>
so, for example, I have src/dbg, and then in my src's _tags <dbg/*>: -traverse
<companion_cube>
ah, it should be <dbg>: -traverse
<companion_cube>
I think
<companion_cube>
it's an attribute on the directory, not its content
<kmicinski>
Yeah, this doesn't change anything (I tried both to be sure..)
<companion_cube>
erf, no idea then, sorry
<kmicinski>
no worries.
<kmicinski>
think I'm getting .. closer
govg has quit [Ping timeout: 240 seconds]
<kmicinski>
yeah, just super strange it works w/ ocamlfind for regular buiding but not cma. Makes me feel like I must be misunderstanding how it's used
<companion_cube>
tbh I switched to oasis (which relies on ocamlbuild) a long time ago, and recently to jbuilder
<kmicinski>
I'm not against it, I just have a project where it seems like this shouldn't be a hard fix and reengineering the build system is an investment I'd rather not make if I don't have to
<companion_cube>
yeah, I konw the feeling
picolino has quit [Ping timeout: 240 seconds]
<kmicinski>
woot! Okay figured it out. It was a package that I specified in the wrong place, but that caused ocamlbuild to trigger a huge red herring in error reporting
<kmicinski>
It looks like it's using some sort of exhaustive search to find out all possible locations of things you specify (perhaps because I had a <src/**>:include?) and then reports files that *could have* matched with the thing you specified. (So, e.g., in this case it was looking for libsrc/dynArray.ml and then just tried dynArray.{mly,mll,ml,mli,..} in every directory).
<kmicinski>
companion_cube: you said that I should also include the `.cmi` files with ocamlfind?
<kmicinski>
(Also, thanks for your help, this is a tricky corner of ocaml..)
whoman has quit [Read error: Connection reset by peer]
picolino has joined #ocaml
<companion_cube>
it's useful for using the library, to have the cmi, yes :)
<companion_cube>
otherwise the signatures are not known
hyper has joined #ocaml
<hyper>
Hey, new to ocaml
<hyper>
is there any way to have recursive record types of another cases' type
<hyper>
like `type mytype = Foo of string | Baz of string | Bar of Foo * string
<hyper>
right now it errors because type Foo isn't defined, is there a way to state that it is mytype.Foo ?
<lpollen>
'Foo' isn't a type, it's a type constructor
<lpollen>
yu can say 'Bar of mytype * string' but you can't constrain that to only Foo
<hyper>
unfortunate. So the best idiomatic way around that would be to just separately define Foo?
<lpollen>
that or ensure that Bar only has Foos in it without the help of the type system.
bartholin has quit [Ping timeout: 260 seconds]
<hyper>
not an option in this program, trying to represent ASTs
<hyper>
thanks for the help!
jfntn` has joined #ocaml
kmicinski has quit [Ping timeout: 248 seconds]
jfntn has quit [Ping timeout: 256 seconds]
bartholin has joined #ocaml
sh0t has quit [Remote host closed the connection]
hyper has quit [Ping timeout: 260 seconds]
govg has joined #ocaml
jfntn` has quit [Ping timeout: 256 seconds]
kmicinski has joined #ocaml
jimmyrcom_ has quit [Ping timeout: 240 seconds]
jimmyrcom has quit [Ping timeout: 265 seconds]
jimmyrcom has joined #ocaml
jimmyrcom_ has joined #ocaml
nicoo has quit [Ping timeout: 255 seconds]
jimmyrcom has quit [Ping timeout: 240 seconds]
jimmyrcom_ has quit [Ping timeout: 240 seconds]
jimmyrcom has joined #ocaml
jimmyrcom_ has joined #ocaml
nicoo has joined #ocaml
picolino has quit [Ping timeout: 252 seconds]
spew has joined #ocaml
picolino has joined #ocaml
jimmyrcom has quit [Ping timeout: 260 seconds]
jimmyrcom_ has quit [Ping timeout: 260 seconds]
spew has quit [Read error: Connection reset by peer]
jao has quit [Ping timeout: 260 seconds]
pierpa has quit [Quit: Page closed]
kmicinski has quit [Ping timeout: 240 seconds]
mbuf has joined #ocaml
jimmyrcom has joined #ocaml
jimmyrcom_ has joined #ocaml
<_xvilka_>
hi
<_xvilka_>
still fighting with that database queries
<ec>
From the context, I would think `Uuseg.create (seg :> Uuseg.boundary)` is just `Uuseg.create (Uuseg.boundary seg)`, but then why would he use that format?
mk9 has quit [Ping timeout: 265 seconds]
<dr_toboggan>
ec: i believe it's related to ocaml's OOP features