Issue #34 resolved

.ocamlspot is ignored

Mark Christiaens avatarMark Christiaens created an issue

I have a project built using ocamlbuild. Its build results are in a separate build directory. I wanted to point ocamlspot to the build directory (to fetch the cmt files). I made a .ocamlspot file in the source directory. As a test, I invoke ocamlspot.opt (from that source directory) and I look at the strace results. I see that the .ocamlspot file is not accessed in any way.

Comments (11)

  1. camlspotter

    How did you strace the command? The .ocamlspot file is only scanned when ocamlspot tries to find modules out of the search criteria.

    There is a test at tests/dot_ocamlspot. You can see how it works typing make in the directory. Personally I do not use .ocamlspot file so the test is really small. If you find anything wrong with .ocamlspot file please file a reproducible example so that I can invesitgate.

  2. Mark Christiaens
    > pwd
    /home/christim/tmp/DSS-buchla/src/ocaml
    
    > cat .ocamlspot 
    build_dir=../../build/debug/ocaml/dss_exe_unittest/
    
    > ls ../../build/debug/ocaml/dss_exe_unittest/AXM/AXM.cmt
    ../../build/debug/ocaml/dss_exe_unittest/AXM/AXM.cmt
    
    > ~/tmp/ocamlspot/ocamlspot query AXM/AXM.ml:l1c1
    Error: cmt file not found: AXM/AXM.cmt
    BYE!
    
    > strace -o out.txt ~/tmp/ocamlspot/ocamlspot query AXM/AXM.ml:l1c1
    Error: cmt file not found: AXM/AXM.cmt
    BYE!
    

    out.txt does not refer to .ocamlspot.

  3. Mark Christiaens

    Hmm, there may be some version confusion in play here.

    I notice that the test you mention is not present on the branch I'm on.

    > ocaml -version
    The OCaml toplevel, version 4.00.1
    

    I tried again with this branch (corresponding to the compiler version)

    > hg branch
    4.00.1.2.1.2
    

    But that test is present on the default branch. Could it be that the .ocamlspot functionality hasn't been ported?

    I tried compiling the default branch but I got:

    ocamlc -annot -bin-annot -w A-4-9-40-42-44 -warn-error A-4-9-32-33-34-40-42-44  -g -I +compiler-libs -I +unix -c ttfold.ml
    File "ttfold.ml", line 42, characters 10-49:
    Error: The constructor Tpat_construct expects 5 argument(s),
           but is applied here to 4 argument(s)
    make: *** [ttfold.cmo] Error 2
    
  4. camlspotter

    I quickly investigated the status of .ocamlspot, from newer to older:

    • a86331a0cf32 (current default, for 4.01.0 compiler): works
    • branch 4.01.0.2.2.0: works
    • 692bfa31178e: works
    • branch 4.00.1.2.1.2: tests/dot_ocamlspot dir missing. I copied the test from default and used it. Result: failed

    Conclusion: the fix is introduced after 4.00.1.2.1.2.

  5. camlspotter

    I created a branch 4.00.1.2.1.3 (not be confused with 4.01.0.2.1.3) which should include the fix. Sorry for my confusion and your inconvenience.

  6. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.