jaredly / jaredly/reason-language-server
No such file or directory error with ppx_expect
- Dominant language
- OCaml
- Stars
- 649
- Forks
- 85
- PR merge metrics
- No merged PRs in 30d
Description
I'm using `ppx_expect` to test my Reason files. In any Reason module that includes `let%expect_test` I see the following build error:
```
type error here Line 1:
Error: I/O error: : No such file or directory
```
I'm building with `esy`. When I run the tests with `esy dune runtest` everything runs just fine. This problem only effects editing _Reason_ files that use `let%expect_test` (ml files do not exhibit this issue). All other files work fine.
The entire build command from debug.log is too much to paste here, but the last part of the build command the output showing the error are:
```
{snip}
-bin-annot -open NaismithSrc -open Core_kernel -open NaismithExt.Pipe -ppx '/src/reason-playground/naismith/_esy/default/store/b/naismith-6ce4e131/default/.ppx/c71d0a51e5287292e3bae7e7566a859b/ppx.exe --as-ppx --cookie '\''library-name="NaismithSrc"'\''' -impl /src/reason-playground/naismith/_esy/default/store/b/naismith-6ce4e131/.lsp/NaismithSrc__Repl.ast with pwd /src/reason-playground/naismith/src
Now loading /src/reason-playground/naismith/_esy/default/store/b/naismith-6ce4e131/.lsp/NaismithSrc__Repl.cmt
Size 55934
<< Making lastDefinitions with type error for file:///src/reason-playground/naismith/src/Repl.re
type error here Line 1:
Error: I/O error: : No such file or directory
Sending notification {"jsonrpc": "2.0", "method": "textDocument/publishDiagnostics", "params":{"uri": "file:///src/reason-playground/naismith/src/Repl.re", "diagnostics": [{"range": {"start": {"line": 0, "character": 0}, "end": {"line": 0, "character": 0}}, "message": "Line 1:\nError: I/O error: : No such file or directory", "severity": 1}]}}
```
If it helps, here's the output of `esy ls-libs` showing installed libraries and versions:
```
naismith@0.1.0 [build pending]
├── @esy-ocaml/reason@3.6.0 [built]
│ ├── reason.easy_format
│ ├── reason.cmdliner
│ └── reason
├── @opam/alcotest@opam:1.0.0 [built]
│ └── alcotest
├── @opam/base@opam:v0.13.0 [built]
│ ├── base.shadow_stdlib
│ ├── base.md5
│ ├── base.caml
│ ├── base.base_internalhash_types
│ └── base
├── @opam/core_kernel@opam:v0.13.0 [built]
│ ├── core_kernel.weak_pointer
│ ├── core_kernel.weak_hashtbl
│ ├── core_kernel.weak_array
│ ├── core_kernel.version_util
│ ├── core_kernel.uuid
│ ├── core_kernel.uopt
│ ├── core_kernel.unpack_buffer
│ ├── core_kernel.univ
│ ├── core_kernel.tuple_pool
│ ├── core_kernel.total_map
│ ├── core_kernel.timing_wheel
│ ├── core_kernel.thread_safe_queue
│ ├── core_kernel.thread_pool_cpu_affinity
│ ├── core_kernel.sexp_hidden_in_test
│ ├── core_kernel.rope
│ ├── core_kernel.pooled_hashtbl
│ ├── core_kernel.pairing_heap
│ ├── core_kernel.moption
│ ├── core_kernel.linked_stack
│ ├── core_kernel.limiter
│ ├── core_kernel.int_set
│ ├── core_kernel.hash_heap
│ ├── core_kernel.force_once
│ ├── core_kernel.flags
│ ├── core_kernel.fheap
│ ├── core_kernel.composition_infix
│ ├── core_kernel.bounded_int_table
│ ├── core_kernel.binary_packing
│ ├── core_kernel.base_for_tests
│ ├── core_kernel.balanced_reducer
│ └── core_kernel
├── @opam/dune@opam:2.2.0 [built]
│ ├── dune.configurator
│ └── dune
├── @opam/expect_test_helpers_kernel@opam:v0.13.0 [built]
│ ├── expect_test_helpers_kernel.expect_test_helpers_base
│ └── expect_test_helpers_kernel
├── @opam/fmt@opam:0.8.8 [built]
│ ├── fmt.tty
│ ├── fmt.top
│ ├── fmt.cli
│ └── fmt
├── @opam/menhir@opam:20200123 [built]
│ └── menhir
├── @opam/merlin@opam:3.3.3 [built]
│ └── merlin
├── @opam/odoc@opam:1.5.0 [built]
│ ├── odoc.xref
│ ├── odoc.parser
│ ├── odoc.odoc
│ ├── odoc.model
│ ├── odoc.loader
│ ├── odoc.html
│ ├── odoc.compat
│ └── odoc
├── @opam/patdiff@opam:v0.13.0 [built]
│ ├── patdiff.lib
│ └── patdiff
├── @opam/ppx_deriving@opam:4.4 [built]
│ ├── ppx_deriving.std
│ ├── ppx_deriving.show
│ ├── ppx_deriving.runtime
│ ├── ppx_deriving.ord
│ ├── ppx_deriving.map
│ ├── ppx_deriving.make
│ ├── ppx_deriving.iter
│ ├── ppx_deriving.fold
│ ├── ppx_deriving.eq
│ ├── ppx_deriving.enum
│ ├── ppx_deriving.create
│ ├── ppx_deriving.api
│ └── ppx_deriving
├── @opam/ppx_expect@opam:v0.13.0 [built]
│ ├── ppx_expect.payload
│ ├── ppx_expect.matcher
│ ├── ppx_expect.evaluator
│ ├── ppx_expect.config
│ ├── ppx_expect.common
│ ├── ppx_expect.collector
│ └── ppx_expect
├── @opam/rtop@opam:3.5.2 [built]
│ └── rtop
├── @opam/sedlex@opam:2.1 [built]
│ ├── sedlex.ppx
│ └── sedlex
├── @opam/stdio@opam:v0.13.0 [built]
│ └── stdio
├── @pesy/esy-pesy@0.1.0-alpha.5 [built]
│ ├── pesy--esy-pesy.utils
│ ├── pesy--esy-pesy.lib
│ ├── pesy--esy-pesy.errors
│ └── pesy--esy-pesy
├── @reason-native/console@0.1.0 [built]
│ ├── console.lib
│ └── console
├── @reason-native/pastel@0.3.0 [built]
│ ├── pastel.lib
│ ├── pastel.internal
│ └── pastel
├── @reason-native/rely@3.2.1 [built]
│ ├── rely.lib
│ ├── rely.internal
│ └── rely
├── ocaml@4.8.1000 [built]
└── refmterr@3.3.0 [built]
├── refmterr.lib
└── refmterr
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the error by editing a Reason file containing `let%expect_test` with the reported esy setup, comparing editor diagnostics with `esy dune runtest`. Trace the language-server build command and its `ppx_expect` invocation shown in the report. Done means Reason files no longer receive the I/O diagnostic while the existing test command continues to pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100