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

Errors in config.ml result in unhelpful error message #461

Closed
talex5 opened this Issue Nov 4, 2015 · 8 comments

Comments

Projects
None yet
6 participants
@talex5
Contributor

talex5 commented Nov 4, 2015

If config.ml doesn't compile then you get an error about unknown options instead. e.g.

$ cat config.ml 
foo

$ mirage configure --unix
mirage: unknown option `--unix'.
Usage: mirage configure [OPTION]... 
Try `mirage configure --help' or `mirage --help' for more information.

Running without arguments shows the real error:

$ mirage configure
[ERROR]

ocamlfind ocamldep -package mirage -modules config.ml > config.ml.depends
ocamlfind ocamlc -c -annot -bin-annot -package mirage -o config.cmo config.ml
+ ocamlfind ocamlc -c -annot -bin-annot -package mirage -o config.cmo config.ml
File "config.ml", line 1, characters 0-3:
Error: Unbound value foo
Command exited with code 2.
@Drup

This comment has been minimized.

Show comment
Hide comment
@Drup

Drup Nov 4, 2015

Member

Duplicated of mirage/functoria#37

Member

Drup commented Nov 4, 2015

Duplicated of mirage/functoria#37

@samoht samoht added the bug label Nov 5, 2015

@samoht samoht closed this Nov 5, 2015

@mmaker

This comment has been minimized.

Show comment
Hide comment
@mmaker

mmaker Mar 10, 2016

yo, this is not yet fixed. With mirage 2.7.0 and functoria 1.0.0:

$ cat config.ml 
foo
$ mirage configure --unix
mirage: unknown option `--unix'.
Usage: mirage configure [OPTION]... 
Try `mirage configure --help' or `mirage --help' for more information.
$ mirage configure 
[ERROR]

ocamlfind ocamldep -package mirage -modules config.ml > config.ml.depends
ocamlfind ocamlc -c -annot -bin-annot -package mirage -o config.cmo config.ml
+ ocamlfind ocamlc -c -annot -bin-annot -package mirage -o config.cmo config.ml
File "config.ml", line 1, characters 0-3:
Error: Unbound value foo
Command exited with code 2.

The error message from the first command is definitely unhelpful.

mmaker commented Mar 10, 2016

yo, this is not yet fixed. With mirage 2.7.0 and functoria 1.0.0:

$ cat config.ml 
foo
$ mirage configure --unix
mirage: unknown option `--unix'.
Usage: mirage configure [OPTION]... 
Try `mirage configure --help' or `mirage --help' for more information.
$ mirage configure 
[ERROR]

ocamlfind ocamldep -package mirage -modules config.ml > config.ml.depends
ocamlfind ocamlc -c -annot -bin-annot -package mirage -o config.cmo config.ml
+ ocamlfind ocamlc -c -annot -bin-annot -package mirage -o config.cmo config.ml
File "config.ml", line 1, characters 0-3:
Error: Unbound value foo
Command exited with code 2.

The error message from the first command is definitely unhelpful.

@samoht samoht reopened this Mar 10, 2016

@Drup

This comment has been minimized.

Show comment
Hide comment
@Drup

Drup Mar 10, 2016

Member

Dammit. I was convinced this one was solved.

@yallop Do you have an idea ? I think it is related to this line: https://github.com/mirage/functoria/blob/master/app/functoria_app.ml#L630

Member

Drup commented Mar 10, 2016

Dammit. I was convinced this one was solved.

@yallop Do you have an idea ? I think it is related to this line: https://github.com/mirage/functoria/blob/master/app/functoria_app.ml#L630

@yallop

This comment has been minimized.

Show comment
Hide comment
@yallop

yallop Mar 12, 2016

Member

I think it'd be good to start thinking how to remove base_context.

Member

yallop commented Mar 12, 2016

I think it'd be good to start thinking how to remove base_context.

@Drup

This comment has been minimized.

Show comment
Hide comment
@Drup

Drup Mar 12, 2016

Member

@yallop That means droping get_mode. I don't disagree, but it seems quite early.

Member

Drup commented Mar 12, 2016

@yallop That means droping get_mode. I don't disagree, but it seems quite early.

@samoht

This comment has been minimized.

Show comment
Hide comment
@samoht

samoht Mar 12, 2016

Member

I'm fine with it as long it is documented

Member

samoht commented Mar 12, 2016

I'm fine with it as long it is documented

@yomimono

This comment has been minimized.

Show comment
Hide comment
@yomimono

yomimono Jul 8, 2016

Member

Does it still seem quite early? I'd really like to solve this for 3.0, and that's an excellent time to drop legacy stuff.

Member

yomimono commented Jul 8, 2016

Does it still seem quite early? I'd really like to solve this for 3.0, and that's an excellent time to drop legacy stuff.

@samoht

This comment has been minimized.

Show comment
Hide comment
@samoht

samoht Jul 11, 2016

Member

@yomimono yes, 3.0 seems like a good target to remove that hack :-)

Member

samoht commented Jul 11, 2016

@yomimono yes, 3.0 seems like a good target to remove that hack :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment