Skip to content
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

Compiler crash #224

Closed
Nexus6 opened this issue Feb 22, 2017 · 3 comments
Closed

Compiler crash #224

Nexus6 opened this issue Feb 22, 2017 · 3 comments

Comments

@Nexus6
Copy link

Nexus6 commented Feb 22, 2017

I deliberately introduced a syntax error in one of my sources (simply added /2 to an empty line) and Coconut complains but then terminates too:

Coconut v1.2.2
$ coconut -t27 -j2 -w .

in storage.coco:
  CoconutParseError: parsing failed (line 25)
    /2
Coconut: Exiting due to CoconutParseError.

Coconut does not exit if the watcher is already running, such as when a prior compilation was successful and it's watching for something new and I subsequently introduce the error in the source and save it. I then get the expected parser errors but the Coconut process goes back to watching again. However, if, at that point, I CTRL-C the Coconut process and re-run it with the exact same parameters (as above) I see the parser error message and the process exits.

@evhub
Copy link
Owner

evhub commented Feb 22, 2017

@Nexus6 This was intended behavior. When Coconut is asked to compile a file it exits with 1 if the compilation fails, to allow other processes invoking it to know that there was an error. This is consistent regardless of what parameters are passed to the compilation. That initial compilation, however, is different from Coconut's behavior once it begins watching--when watching a file, Coconut does not exit upon a compilation error.

I can see how this behavior could be confusing, though. The obvious solution is that, if --watch is passed, Coconut should assume that it need not indicate to a calling process whether the initial compilation succeed. The argument for this is that the fact that --watch can never terminate means that waiting for an exit code is not a very good idea. I think I buy that argument.

@evhub evhub added this to the v1.2.3 milestone Feb 22, 2017
evhub added a commit that referenced this issue Feb 22, 2017
@evhub
Copy link
Owner

evhub commented Feb 22, 2017

I just made the change on develop! pip install coconut-develop to grab it and test it out.

@Nexus6
Copy link
Author

Nexus6 commented Feb 23, 2017

Tested. As far as I can tell this issue is fixed. Thanks!

@evhub evhub closed this as completed Feb 23, 2017
@evhub evhub added the resolved label Feb 23, 2017
@evhub evhub mentioned this issue May 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants