You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 6401 Reporter:@gasche Assigned to:@alainfrisch Status: closed (set by @xavierleroy on 2017-02-16T14:16:19Z) Resolution: fixed Priority: low Severity: feature Target version: 4.03.0+dev / +beta1 Fixed in version: 4.03.0+dev / +beta1 Category: tools (ocaml{lex,yacc,dep,debug,...}) Tags: patch Monitored by:@hcarty
Bug description
When hacking on the compiler itself, a classic failure when running the toplevel is that it tries to link against the installed standard library instead of the one being modified, which gives various interface mismatches -- the fix is to pass "-I stdlib -nostdlib", and I also need "-noinit" for other reasons.
On trunk, the reporting is currently not very nice (there might be a regression from older versions):
% ./byterun/ocamlrun ./ocaml
OCaml version 4.02.0+dev5-2014-04-29
Fatal error: exception Env.Error(_)
The attached patch calls the error-reporting routines to print a better error message:
% ./byterun/ocamlrun ./ocaml
OCaml version 4.02.0+dev5-2014-04-29
File "none", line 1:
Error: The files ./ocaml
and /home/gabriel/.opam/4.02.0local+git-trunk/lib/ocaml/pervasives.cmi
make inconsistent assumptions over interface Pervasives
Additional information
The patch is careful to only catch Env.Error exceptions, so as not to trash the backtraces of other, unplanned-for failures. After catching and reporting the exception, it terminates with "exit 2":
keeping an uninitialized toplevel alive makes no sense
re-raising the exception seems useless (the backtrace is trashed) and potentially confusing
"2" was already used as an error code in topmain.ml
Original bug ID: 6401
Reporter: @gasche
Assigned to: @alainfrisch
Status: closed (set by @xavierleroy on 2017-02-16T14:16:19Z)
Resolution: fixed
Priority: low
Severity: feature
Target version: 4.03.0+dev / +beta1
Fixed in version: 4.03.0+dev / +beta1
Category: tools (ocaml{lex,yacc,dep,debug,...})
Tags: patch
Monitored by: @hcarty
Bug description
When hacking on the compiler itself, a classic failure when running the toplevel is that it tries to link against the installed standard library instead of the one being modified, which gives various interface mismatches -- the fix is to pass "-I stdlib -nostdlib", and I also need "-noinit" for other reasons.
On trunk, the reporting is currently not very nice (there might be a regression from older versions):
The attached patch calls the error-reporting routines to print a better error message:
Additional information
The patch is careful to only catch Env.Error exceptions, so as not to trash the backtraces of other, unplanned-for failures. After catching and reporting the exception, it terminates with "exit 2":
File attachments
The text was updated successfully, but these errors were encountered: