From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id D1A1D7FCCB for ; Tue, 14 Apr 2015 06:48:34 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of jordojw@gmail.com) identity=pra; client-ip=209.85.215.54; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jordojw@gmail.com"; x-sender="jordojw@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of jordojw@gmail.com designates 209.85.215.54 as permitted sender) identity=mailfrom; client-ip=209.85.215.54; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jordojw@gmail.com"; x-sender="jordojw@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-la0-f54.google.com) identity=helo; client-ip=209.85.215.54; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jordojw@gmail.com"; x-sender="postmaster@mail-la0-f54.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BlAQBbmyxVmzbXVdFcg15cBYMQuguHaYF3AQWGAAOBQQc7EQEBAQEBAQERAQEBAQEGCwsJFC6EOBEdARseAxIQNwIkAREBBQEiNYdzAQMRDaZLgy4+MYs4gWuCdoslChknDVSFEQEFDpJNDC8SgTMFhiOFC4lXhhaBHTqPSIIDEiOBDAmBc4I+HjGCQwEBAQ X-IPAS-Result: A0BlAQBbmyxVmzbXVdFcg15cBYMQuguHaYF3AQWGAAOBQQc7EQEBAQEBAQERAQEBAQEGCwsJFC6EOBEdARseAxIQNwIkAREBBQEiNYdzAQMRDaZLgy4+MYs4gWuCdoslChknDVSFEQEFDpJNDC8SgTMFhiOFC4lXhhaBHTqPSIIDEiOBDAmBc4I+HjGCQwEBAQ X-IronPort-AV: E=Sophos;i="5.11,574,1422918000"; d="scan'208";a="134237576" Received: from mail-la0-f54.google.com ([209.85.215.54]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 14 Apr 2015 06:48:34 +0200 Received: by lagv1 with SMTP id v1so73135461lag.3 for ; Mon, 13 Apr 2015 21:48:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=RDLtNlLYbZEOW4x4lX8FA3ZvqT7x9Ia5jRWkwBFNkuY=; b=L7ZkjpADjPy7kdPfAB3h+RR4TCt0oaZH6dZsgImF7SKZp9iHW0MT7TM5QkL8aFvEgg CsHHU6FSCiNmxnTf2BN5UID7BT9pdvEnfv1OW0TJdMqNVCeXdOhDVLEdMpnKZDchsg8e F4fIgnUKakf0J7EnrfpuU0+e0LSyEQmgDDEME+nuznHpXLJdjidkGeMtXNp03zmHL5SJ clzKTBxiR+D0PW3SLjx5DZ4+d2ivwaole6QTHj+hazUEdIV+/7wVxxM+UTu7V/FY6Lg4 EVDbj8oiMvbfwORrrvKBq7rMT6OUB3oRABEqAoYK6BvLlQ8P1r4u551DQ3MW7C8TTjI4 EE8Q== MIME-Version: 1.0 X-Received: by 10.112.90.201 with SMTP id by9mr15889495lbb.30.1428986912224; Mon, 13 Apr 2015 21:48:32 -0700 (PDT) Received: by 10.25.22.224 with HTTP; Mon, 13 Apr 2015 21:48:32 -0700 (PDT) Date: Mon, 13 Apr 2015 21:48:32 -0700 Message-ID: From: Jordan W To: "caml-list@inria.fr" Content-Type: multipart/alternative; boundary=001a1134664a4abb7c0513a7f1c2 X-Validation-by: jordojw@gmail.com Subject: [Caml-list] Module aliases break debugging with ocamldebug --001a1134664a4abb7c0513a7f1c2 Content-Type: text/plain; charset=UTF-8 Module aliases are the encouraged way of grouping modules together. They have worked fine up until the point where I tried to use ocamldebug with them. Module aliases allow development in the large, by permitting namespacing. I couldn't imagine building anything but a toy project with a few engineers with the restriction that no two files have the same basename! Module aliases to the rescue (thanks to Leo White for the suggestion). But, it seems that module aliases with namespacing make ocamldebug completely unusable. Here's a minimal repro case below. There are two simple namespaces each with a submodules in files named "test.ml". I am using module aliases to namespace them so that there are no collisions. Again, this works fine with everything except the debugger. I hope I'm just doing something incorrect - if that is the case, I thank you in advance for your patience. # Compile project using module aliases mkdir ~/Desktop/testOne/ mkdir ~/Desktop/testTwo/ echo "let x () = print_string \"hello from test one\"" > ~/Desktop/testOne/test.ml echo "let x () = print_string \"hello from test two\"" > ~/Desktop/testTwo/test.ml echo "module Test = NamespaceOne_test" > ~/Desktop/testOne/namespaceOne.ml echo "module Test = NamespaceOne_test" > ~/Desktop/testOne/namespaceOne.mli echo "module Test = NamespaceTwo_test" > ~/Desktop/testTwo/namespaceTwo.ml echo "module Test = NamespaceTwo_test" > ~/Desktop/testTwo/namespaceTwo.mli echo 'NamespaceOne.Test.x (); NamespaceTwo.Test.x ()' > ~/Desktop/ prog.ml # Generate namespaced module aliases ocamlc -g -c -no-alias-deps -w -49 -I ~/Desktop/testOne/ -o ~/Desktop/testOne/namespaceOne -intf ~/Desktop/testOne/namespaceOne.mli -o ~/Desktop/testOne/namespaceOne -impl ~/Desktop/testOne/namespaceOne.ml ocamlc -g -c -no-alias-deps -w -49 -I ~/Desktop/testTwo/ -o ~/Desktop/testTwo/namespaceTwo -intf ~/Desktop/testTwo/namespaceTwo.mli -o ~/Desktop/testTwo/namespaceTwo -impl ~/Desktop/testTwo/namespaceTwo.ml ocamlc -g -c -I ~/Desktop/testOne/ -open NamespaceOne -o ~/Desktop/testOne/namespaceOne_test -impl ~/Desktop/testOne/test.ml ocamlc -g -c -I ~/Desktop/testTwo/ -open NamespaceTwo -o ~/Desktop/testTwo/namespaceTwo_test -impl ~/Desktop/testTwo/test.ml ocamlc -g -c -I ~/Desktop -I ~/Desktop/testOne/ -I ~/Desktop/testTwo/ -o ~/Desktop/prog.cmo -impl ~/Desktop/prog.ml ocamlc -g -I ~/Desktop/testTwo/ -I ~/Desktop/testOne/ ~/Desktop/testOne/namespaceOne.cmo ~/Desktop/testTwo/namespaceTwo.cmo ~/Desktop/testOne/namespaceOne_test.cmo ~/Desktop/testTwo/namespaceTwo_test.cmo ~/Desktop/prog.cmo -o ~/Desktop/prog.out # Start ocamldebug ocamldebug ~/Desktop/prog.out # Run these commands inside of ocamldebug directory ~/Desktop/ directory ~/Desktop/testOne/ directory ~/Desktop/testTwo/ # This doesn't work but that makes sense - there aren't any modules named # "Test", there's one named NamespaceOne_test and one named # NamespaceTwo_test. break @Test 1 # But - neither of the namespaced modules work either! # ----------------------------------------------------------------------- break @NamespaceOne_test 1 break @NamespaceTwo_test 1 Here is proof that ocamldebug works correctly without namespacing/module aliases: # Working project without module aliases: mkdir ~/Desktop/testOne/ mkdir ~/Desktop/testTwo/ echo "let x () = print_string \"hello from test one\"" > ~/Desktop/testOne/testOneNamespaceNotNeeded.ml echo "let x () = print_string \"hello from test two\"" > ~/Desktop/testTwo/testTwoNamespaceNotNeeded.ml echo 'TestOneNamespaceNotNeeded.x (); TestTwoNamespaceNotNeeded.x ()' > ~/Desktop/prog.ml ocamlc -g -c -I ~/Desktop/testOne/ -o ~/Desktop/testOne/testOneNamespaceNotNeeded -impl ~/Desktop/testOne/testOneNamespaceNotNeeded.ml ocamlc -g -c -I ~/Desktop/testTwo/ -o ~/Desktop/testTwo/testTwoNamespaceNotNeeded -impl ~/Desktop/testTwo/testTwoNamespaceNotNeeded.ml ocamlc -g -c -I ~/Desktop -I ~/Desktop/testOne/ -I ~/Desktop/testTwo/ -o ~/Desktop/prog.cmo -impl ~/Desktop/prog.ml ocamlc -g -I ~/Desktop/testTwo/ -I ~/Desktop/testOne/ ~/Desktop/testOne/testOneNamespaceNotNeeded.cmo ~/Desktop/testTwo/testTwoNamespaceNotNeeded.cmo ~/Desktop/prog.cmo -o ~/Desktop/prog.out ocamldebug ~/Desktop/prog.out # Run these commands inside of ocamldebug. Working correctly. directory ~/Desktop/ directory ~/Desktop/testOne/ directory ~/Desktop/testTwo/ break @TestOneNamespaceNotNeeded 1 --001a1134664a4abb7c0513a7f1c2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Module aliases are the encouraged way of grouping mod= ules together. They have worked fine up until the point where I tried to us= e ocamldebug with them.

Module aliases allow development in the larg= e, by permitting namespacing. I couldn't imagine building anything but = a toy project with a few engineers with the restriction that no two files h= ave the same basename! Module aliases to the rescue (thanks to Leo White fo= r the suggestion). But, it seems that module aliases with namespacing make = ocamldebug completely unusable. Here's a minimal repro case below. Ther= e are two simple namespaces each with a submodules in files named "test.ml". I am using module aliases to nam= espace them so that there are no collisions. Again, this works fine with ev= erything except the debugger.

I hope I'm just doing something in= correct - if that is the case, I thank you in advance for your patience.

=C2=A0 =C2=A0 # Compile project using module aliases

=C2=A0 =C2=A0 mkdir ~/Desktop/testOne/
= =C2=A0 =C2=A0 mkdir ~/Desktop/testTwo/
=C2=A0 =C2=A0 echo "l= et x () =3D print_string \"hello from test one\"" > ~/Des= ktop/testOne/test.ml
=C2=A0 =C2=A0= echo "let x () =3D print_string \"hello from test two\"&quo= t; > ~/Desktop/testTwo/test.ml
= =C2=A0 =C2=A0 echo "module Test =3D NamespaceOne_test" > ~/Des= ktop/testOne/namespaceOne.ml
=C2=A0 =C2=A0 echo "module Test= =3D NamespaceOne_test" > ~/Desktop/testOne/namespaceOne.mli
<= div>=C2=A0 =C2=A0 echo "module Test =3D NamespaceTwo_test" > ~= /Desktop/testTwo/namespaceTwo.ml
=C2=A0 =C2=A0 echo "module = Test =3D NamespaceTwo_test" > ~/Desktop/testTwo/namespaceTwo.mli
=C2=A0 =C2=A0 echo 'NamespaceOne.Test.x (); NamespaceTwo.Test.x= ()' > ~/Desktop/prog.ml
=C2=A0 =C2=A0 # Generate namespaced module aliases
= =C2=A0 =C2=A0 ocamlc -g -c -no-alias-deps -w -49 -I ~/Desktop/testOne/ -o ~= /Desktop/testOne/namespaceOne -intf ~/Desktop/testOne/namespaceOne.mli -o ~= /Desktop/testOne/namespaceOne -impl ~/Desktop/testOne/namespaceOne.ml
=
=C2=A0 =C2=A0 ocamlc -g -c -no-alias-deps -w -49 -I ~/Desktop/testTwo/= -o ~/Desktop/testTwo/namespaceTwo -intf ~/Desktop/testTwo/namespaceTwo.mli= -o ~/Desktop/testTwo/namespaceTwo -impl ~/Desktop/testTwo/namespaceTwo.ml<= /div>

=C2=A0 =C2=A0 ocamlc -g -c -I ~/Desktop/testOne/ -= open NamespaceOne -o ~/Desktop/testOne/namespaceOne_test -impl ~/Desktop/te= stOne/test.ml
=C2=A0 =C2=A0 ocamlc= -g -c -I ~/Desktop/testTwo/ -open NamespaceTwo -o ~/Desktop/testTwo/namesp= aceTwo_test -impl ~/Desktop/testTwo/test.ml<= /div>
=C2=A0 =C2=A0 ocamlc -g -c -I ~/Desktop -I ~/Desktop/testOne/ -I = ~/Desktop/testTwo/ -o ~/Desktop/prog.cmo -impl ~/Desktop/prog.ml

=C2=A0 =C2=A0 ocamlc -g -I ~/= Desktop/testTwo/ -I ~/Desktop/testOne/ ~/Desktop/testOne/namespaceOne.cmo ~= /Desktop/testTwo/namespaceTwo.cmo ~/Desktop/testOne/namespaceOne_test.cmo ~= /Desktop/testTwo/namespaceTwo_test.cmo ~/Desktop/prog.cmo -o ~/Desktop/prog= .out


=C2=A0 =C2=A0 # Start ocamldeb= ug

=C2=A0 =C2=A0 ocamldebug ~/Desktop/prog.out

=C2=A0 =C2=A0 # Run these commands inside of ocamldeb= ug

=C2=A0 =C2=A0 directory ~/Desktop/
= =C2=A0 =C2=A0 directory ~/Desktop/testOne/
=C2=A0 =C2=A0 director= y ~/Desktop/testTwo/

=C2=A0 =C2=A0 # This doesn= 9;t work but that makes sense - there aren't any modules named
=C2=A0 =C2=A0 # "Test", there's one named NamespaceOne_test= and one named
=C2=A0 =C2=A0 # NamespaceTwo_test.

<= /div>
=C2=A0 =C2=A0 break @Test 1

=C2=A0 =C2= =A0 # But - neither of the namespaced modules work either!
=C2=A0= =C2=A0 # -----------------------------------------------------------------= ------

=C2=A0 =C2=A0 break @NamespaceOne_test 1
=C2=A0 =C2=A0 break @NamespaceTwo_test 1

<= br>


Here is proof that ocamld= ebug works correctly without namespacing/module aliases:

=

# Working project without module aliases:
=C2=A0 =C2=A0 mkdir ~/Desktop/testOne/
=C2=A0 =C2=A0 = mkdir ~/Desktop/testTwo/
=C2=A0 =C2=A0 echo "let x () =3D pr= int_string \"hello from test one\"" > ~/Desktop/testOne/t= estOneNamespaceNotNeeded.ml
=C2=A0 =C2=A0 echo "let x () =3D= print_string \"hello from test two\"" > ~/Desktop/testTw= o/testTwoNamespaceNotNeeded.ml
=C2=A0 =C2=A0 echo 'TestOneNam= espaceNotNeeded.x (); TestTwoNamespaceNotNeeded.x ()' > ~/Desktop/prog.ml

=C2=A0 =C2=A0= ocamlc -g -c -I ~/Desktop/testOne/ -o ~/Desktop/testOne/testOneNamespaceNo= tNeeded -impl ~/Desktop/testOne/testOneNamespaceNotNeeded.ml
=C2= =A0 =C2=A0 ocamlc -g -c -I ~/Desktop/testTwo/ -o ~/Desktop/testTwo/testTwoN= amespaceNotNeeded -impl ~/Desktop/testTwo/testTwoNamespaceNotNeeded.ml
=C2=A0 =C2=A0 ocamlc -g -c -I ~/Desktop -I ~/Desktop/testOne/ -I ~/De= sktop/testTwo/ -o ~/Desktop/prog.cmo -impl ~/Desktop/prog.ml

=C2=A0 =C2=A0 ocamlc -g -I ~/Desk= top/testTwo/ -I ~/Desktop/testOne/ =C2=A0~/Desktop/testOne/testOneNamespace= NotNeeded.cmo ~/Desktop/testTwo/testTwoNamespaceNotNeeded.cmo ~/Desktop/pro= g.cmo -o ~/Desktop/prog.out

=C2=A0 =C2=A0 ocamldeb= ug ~/Desktop/prog.out

=C2=A0 =C2=A0 # Run these co= mmands inside of ocamldebug. Working correctly.
=C2=A0 =C2=A0 dir= ectory ~/Desktop/
=C2=A0 =C2=A0 directory ~/Desktop/testOne/<= /div>
=C2=A0 =C2=A0 directory ~/Desktop/testTwo/
=C2=A0 =C2= =A0 break @TestOneNamespaceNotNeeded 1

--001a1134664a4abb7c0513a7f1c2--