Replace Arg.Bad with fatal in compenv.ml#1011
Replace Arg.Bad with fatal in compenv.ml#1011bschommer wants to merge 12 commits intoocaml:trunkfrom bschommer:unknown-file
Conversation
Since there is no exception handler for Arg.Bad the exception is uncaught. Now the compiler aborts with fatal and prints out the error message.
|
I'm not sure if a Change entry is need and in my opinion the error message can be improved a bit but I couldn't come up with a better one at the moment. |
|
I think that, if someone reported a bug for it, it deserves a Changes entry. Could you maybe add a regression test among the |
|
No problem. |
|
Since this is an argument parsing error, I would argue that it makes sense to restore 4.03 behavior and fail with a standard Arg error message (with the addition of the usage message). |
|
I personally find the old error message not that usefull, however I'm not in strong favor of my new message and if it is wanted I can revert to the old message. Printing the help and usage message would require either changing the interface of |
|
I think that the wording of the new error message is not very good. The older one is maybe a bit better -- it's not terribly useful, as you say, but it reads better as a sentence. |
|
I had a look and the function that raises the Exception |
The function raising Arg.Bad is only used in driver/mail.ml and driver/optmain.ml and so adding the two exception handlers restored the 4.03 behavior.
|
I don't understand the last change. I noticed with the CI that there was an issue with the patch, but what is the issue? Why is 7cf0cfa useful? I'm not so happy with the fact that you are changing the |
|
I actually have no idea, since every function I used in |
|
Could we find a solution, then, that does not change the |
|
Since |
|
I actually tried this in commit eee2829 but I got some weird linking errors. |
This reverts commit 7cf0cfa.
The problem was the missing begin...end block plus the missing exit 2.
|
I think I found the source of my link problems (beside the missing |
Removed whitespace
|
It should work now as 4.03 and before. The test filters out all options beside the message for the unknown file, this should avoid breaking the test whenever a new option is introduced. |
|
You could maybe test only ocamlc? |
Changes
Outdated
|
|
||
| - PR#7460, GPR#1011: catch exception thrown when unknown files are passed | ||
| as argument. | ||
| (Bernhard Schommer) |
There was a problem hiding this comment.
Maybe point out that @Octachron was helpful in reviewing? (Or maybe you had found the nasty syntax thing independently?) Otherwise it now seems good to merge.
There was a problem hiding this comment.
No problem, will amend the change entry.
|
Thanks to all, I merged in trunk and 4.04. (I was a bit hesitant to merge in 4.04 as this is admittedly a very minor regression, but the final patch is also very easy to check for non-intrusiveness so I went for it.) |
|
In a48b2cb I updated the new test to work also on bytecode-only configurations. (I also forget about those when I write tests.) |
Adds builtins for the equivalent of GCC's __sync_fetch_and_add/sub and __sync_bool_compare_and_swap. The pointer type may be native_pointer, ext_pointer, or bigstring with offset. The integer type may be untagged int, unboxed int64, unboxed int32, or unboxed nativeint. The builtins are not translated on ARM (but it would now be easy to add ARM backend support - armv8 provides single instructions for each of these operations). The unboxed int64 builtins are not translated on 32 bit architectures.
* Create init-cache script * Reduce startup time - Sync opam repo during build - git pull && opam update - Copy from build in run instead of git clone - Precompute package state cache - Launch server once, at the end of build - Build is complete when package.state is closed after write - Copy package.state from build in run - Misc required details - Make /var/opam-repository "safe", whatever it means - Use a shell script to wait until package.state is complete - Add inotify-tools as build dependency - Unrelated - Make docker image name the same in Makefile & HACKING.md * Add branch to git pull when polling opam repo * Formatting * Cleanup --------- Co-authored-by: Cuihtlauac ALVARADO <[email protected]>
Since there is no exception handler for Arg.Bad the exception is uncaught.
Now the compiler aborts with fatal and prints out the error message.
This should fix MPR#7460.