Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/tool-debugger/find-artifacts fails due to incorrect environment access #8544

Open
gasche opened this Issue Mar 25, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@gasche
Copy link
Member

gasche commented Mar 25, 2019

I could reproduce under both trunk and 4.08.

Under 4.08, the test log in _ocamltest/tests/tool-debugger/find-artifacts/debuggee/ocamlc.byte/debuggee.byte.output says:

Loading program... done.
Breakpoint: 1
10   <|b|>print x;
Debugger [version 4.08.0+dev6-2019-03-01] environment error:
 The files /usr/local/lib/ocaml/stdlib.cmi
 and /home/gasche/Prog/ocaml/github-4.08/testsuite/tests/tool-debugger/find-artifacts/_ocamltest/tests/tool-debugger/find-artifacts/debuggee/ocamlc.byte/out/blah.cmi
 make inconsistent assumptions over interface Stdlib

which suggests that the problem come from a discrepancy between the test environment and a /usr/local OCaml install on my system -- the test environment should be configured so that this local install is never used by the testsuite.

Interestingly, the failure log on trunk is much less readable:

Loading program... done.
Breakpoint: 1
10   <|b|>print x;
Uncaught exception: Persistent_env.Error(_)

This looks like an error-reporting regression due to #2228, I will investigate -- but this is independent from the bug being reported in the present issue, which is present under both trunk and 4.08.

gasche added a commit to gasche/ocaml that referenced this issue Mar 25, 2019

Expose Persistent_env.Error and catch it from the debugger
The debugger reimplements its own error-reporting logic without using
the reporter-registration mechanism of the compiler, so it needs to be
adapted after the split between `Env` and `Persistent_env` in ocaml#2228.

(Interestingly, this forced me to expose the `Error of error`
exception in the Persistent_signature, which was not the case
before. It was probably a mistake to not expose an exception value
that can be raised by (correctly-written) consumers of the module.)

I noticed the issue while inspecting a testsuite failure (ocaml#8544).

Before this patch:

```
$ cat tests/tool-debugger/find-artifacts/_ocamltest/tests/tool-debugger/find-artifacts/debuggee/ocamlc.byte/debuggee.byte.output
Loading program... done.
Breakpoint: 1
10   <|b|>print x;
Uncaught exception: Persistent_env.Error(_)
```

After:
```
$ cat tests/tool-debugger/find-artifacts/_ocamltest/tests/tool-debugger/find-artifacts/debuggee/ocamlc.byte/debuggee.byte.output
Loading program... done.
Breakpoint: 1
10   <|b|>print x;
Debugger [version 4.09.0+dev0-2019-01-18] environment error:
 The files /usr/local/lib/ocaml/stdlib.cmi
 and [...]_ocamltest/tests/tool-debugger/find-artifacts/debuggee/ocamlc.byte/out/blah.cmi
 make inconsistent assumptions over interface Stdlib
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.