Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
[patch] use proper error reporting for toplevel's environment initialization #6401
Original bug ID: 6401
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:
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":
Comment author: @johnwhitington
Excellent. I knew I must have been missing something simple, but no-one seemed to know!