Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006401OCamlOCaml tools (ocaml{lex,yacc,dep,browser,debug})public2014-05-07 10:392014-06-02 20:33
Reportergasche 
Assigned To 
PrioritylowSeverityfeatureReproducibilityN/A
StatusconfirmedResolutionopen 
PlatformOSOS Version
Product Version 
Target Version4.03.0+devFixed in Version 
Summary0006401: [patch] use proper error reporting for toplevel's environment initialization
DescriptionWhen 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 InformationThe 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
Tagspatch
Attached Filespatch file icon toplevel-initialization-error-reporting.patch [^] (1,746 bytes) 2014-05-07 10:39 [Show Content]

- Relationships

-  Notes
(0011382)
johnwhitington (reporter)
2014-05-07 14:04
edited on: 2014-05-07 14:04

Excellent. I knew I must have been missing something simple, but no-one seemed to know!

http://sympa.inria.fr/sympa/arc/caml-list/2014-01/msg00017.html [^]


- Issue History
Date Modified Username Field Change
2014-05-07 10:39 gasche New Issue
2014-05-07 10:39 gasche File Added: toplevel-initialization-error-reporting.patch
2014-05-07 14:04 johnwhitington Note Added: 0011382
2014-05-07 14:04 johnwhitington Note Edited: 0011382 View Revisions
2014-06-02 20:30 doligez Tag Attached: patch
2014-06-02 20:33 doligez Severity tweak => feature
2014-06-02 20:33 doligez Status new => confirmed
2014-06-02 20:33 doligez Target Version => 4.03.0+dev


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker