<TimFreeman>
Does the bug reproduce when run against the bleeding edge?
<whee>
yes
<TimFreeman>
Drat. Any workarounds obvious to you? I don't want to restructure all my libraries for this, but I suppose I could...
<TimFreeman>
Um, I guess "restructure all my libraries" really means "restructure things so there are no libraries".
<whee>
hrrrm
<TimFreeman>
Hmm. Getting rid of "c" gets rid of the problem, even though c isn't used.
<whee>
haha, now that is odd
<TimFreeman>
Thanks much for running it against the bleeding edge for me. I'll file a bug report.
<whee>
it's really weird
<whee>
if you include c, it only gets a new object twice
<whee>
perhaps a is being garbage collected between runs or something crazy?
<whee>
most likely not :\
<TimFreeman>
No, the problem is that there are two a's. One came in through b, and one came in through c. When d asks for a it happens to get the one from c.
<whee>
yes, but the number of times a is instantiated doesn't appear to be related to the number of modules that uses it
<TimFreeman>
I think it's related to the number of paths by which it is used. Have any enlightening variations that you tried?
<whee>
well I had it using c, and then calling C.exercise () before B.exercise (), and C gets an object with an id of 1 while b gets one with 0 and d1 g ets 1
gehel has quit [Read error: 60 (Operation timed out)]
<whee>
which is even more confusing
<TimFreeman>
Yes, I think the modules are instantiated before d starts running, so the order that b and c are used in d might not matter.
<whee>
probabbly, hmm
<whee>
aha
<whee>
I know what's happening
<TimFreeman>
Yes?
<whee>
it's the way you're compiling it
<whee>
you're building b.cma/cmo and linking that with a, then building c and linking it with a
<whee>
so there's two different ones there
<TimFreeman>
But b and c really do use a. Is there an alternative?
<whee>
if you run 'ocamlc -o doop -I a -I b -I c -I d a/a.ml b/b.ml c/c.ml d/d1.ml d/d2.ml' from the top level directory and run ./doop, it'll work correctly
<whee>
you may want to have a look at OCamlMakefile and use that for building, it should handle things correctly
<TimFreeman>
Yes, that is what I meant by restructuring my code not to use libraries. I was using OCamlMakefile, but with enough stuff wrapped around it so maybe it's not OCamlMakefile's fault.
<mrvn_>
Should it do the same if you compile each *.ml on its one and then link all cmx files together?
<whee>
I just compiled it with OCamlMakefile and it does behave correctly
<TimFreeman>
I guess I could invoke OcamlMakefile once from the top instead of once in each directory.
<whee>
what you want to do is run ocamlc -c on each .ml, and then link them all together at the end
<mrvn_>
and each object only once.
<whee>
yes
<TimFreeman>
mrvn_: No, I think whee is saying that that would fix the problem.
<TimFreeman>
Okay, no libraries for me, I guess. :-(.
<whee>
well mrvn said the same thing I did
<TimFreeman>
Multiple interpretations of what "the same thing" refers too. I think we all agree.
<whee>
you just need to make sure there's only one copy of the compiled object file when it all gets linked together
rox|deminished is now known as rox
<TimFreeman>
If I link b with "ocamlc -a -I ../a -o b.cma b.cmo" instead of "ocamlc -a -I ../a/a.cma -o b.cma b.cmo", and likewise c, it works right and I can keep my libraries.
lament is now known as w1nt3rm00t
w1nt3rm00t is now known as lament
esabb has quit ["using sirc version 2.211+KSIRC/1.2.1"]
TimFreeman has quit [Remote closed the connection]
polin8 has quit [Read error: 104 (Connection reset by peer)]
polin8 has joined #ocaml
graydon has quit [Read error: 113 (No route to host)]
gehel has joined #ocaml
Zadeh has joined #ocaml
Zadeh_ has quit [Read error: 54 (Connection reset by peer)]
docelic|away is now known as docelic
skylan has quit ["Reconnecting"]
skylan has joined #ocaml
lament has quit ["<Liam> cocks || <Liam> gigantic cocks || <Liam> slapping me in the face"]
asqui has quit [Read error: 104 (Connection reset by peer)]
polin8_ has joined #ocaml
polin8_ has quit [Client Quit]
lament has joined #ocaml
mattam has joined #ocaml
foxen5 has quit []
Yurik has joined #ocaml
<Yurik>
re
lament has quit ["<Liam> cocks || <Liam> gigantic cocks || <Liam> slapping me in the face"]
lament has joined #ocaml
docelic is now known as docelic|away
Yurik has quit [Read error: 110 (Connection timed out)]
esabb has joined #ocaml
docelic|away is now known as docelic
lament has quit ["<Liam> cocks || <Liam> gigantic cocks || <Liam> slapping me in the face"]
mattam_ has joined #ocaml
Zadeh_ has joined #ocaml
Zadeh has quit [Read error: 54 (Connection reset by peer)]
mrvn has joined #ocaml
mattam has quit [Read error: 110 (Connection timed out)]
mrvn_ has quit [Read error: 110 (Connection timed out)]
smklsmkl has joined #ocaml
smkl has quit [Remote closed the connection]
graydon has joined #ocaml
docelic is now known as docelic|sleepo
mattam_ is now known as mattam
karryall has quit ["ERC vVersion 3.0 $Revision: 1.328 $ (IRC client for Emacs)"]
Dalroth has joined #ocaml
intero has joined #ocaml
<intero>
hi all
<intero>
does anyone know anything about FFI? should be something for linking C code
<mrvn>
Foreign Function interface?
<mrvn>
look at all the existing modules for C libraries.
foxen5 has joined #ocaml
esabb has left #ocaml []
smklsmkl is now known as smkl
systems has joined #ocaml
systems has left #ocaml []
docelic|sleepo is now known as docelic
rox is now known as rox|
docelic has quit ["Client Exiting"]
docelic has joined #ocaml
docelic is now known as docelic|away
polin8 has quit [Read error: 54 (Connection reset by peer)]
polin8 has joined #ocaml
polin8 has quit [Client Quit]
polin8 has joined #ocaml
polin8 has quit [Client Quit]
polin8 has joined #ocaml
<intero>
thanks mrvn
<intero>
know where i can check?
gene9 has joined #ocaml
gene9 has quit [Client Quit]
Dalroth has quit [Read error: 104 (Connection reset by peer)]