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

CCL does not exit after evaluation with --batch option #470

Open
galdor opened this issue Dec 26, 2023 · 5 comments
Open

CCL does not exit after evaluation with --batch option #470

galdor opened this issue Dec 26, 2023 · 5 comments

Comments

@galdor
Copy link

galdor commented Dec 26, 2023

According to the documentation, --batch makes CCL exit on stdin EOF.

Running:

ccl --no-init --batch --quiet --eval '(format t "Hello world!~%")'

Leads to CCL printing the message correctly and hanging there without exiting until one hits ^D to explicitely send EOF. In this state, using ^C to send SIGINT causes CCL to enter the debugger (really not something expected with --batch_).

Stracing CCL shows that it is reading the standard input:

[pid 21446] write(1, "Hello world!\n", 13Hello world!
) = 13
[pid 21446] read(0,  <unfinished ...>

I would expect CCL to exit after all forms passed to --eval options have been evaluated.

Environment: CCL 1.12.2 running on Linux x86_64.

@phoe
Copy link
Contributor

phoe commented Dec 26, 2023

If it's meaningful in any way, sbcl --script doesn't quit without a manual ^D either, and requires an explicit (sb-ext:quit) call in its eval chain.

For CCL, is adding --eval '(ccl:quit)' at the end satisfying?

@galdor
Copy link
Author

galdor commented Dec 26, 2023

SBCL absolutely exits after loading and evaluating a file with --script. Tested 5s ago with sbcl --script /tmp/test.lisp and a file containing (format t "Hello world!~%"). Same thing with sbcl --no-userinit --non-interactive --eval '(format t "Hello world!~%")' (the fact that it prints this stupid banner is another problem), as it should be.

@metayan
Copy link

metayan commented Dec 26, 2023

If we give it what it's asking for, it does what it's supposed to do:

echo |ccl --no-init --batch --quiet --eval '(format t "Hiya!~%")'

;)

@phoe
Copy link
Contributor

phoe commented Dec 26, 2023

Welp, I launched sbcl --script in a terminal, at which point it was reading from standard input, which needed a manual ^D.

I assume then this is a feature request for a ccl --script-like syntax that accepts a filename, loads it, and then exits.

I would expect CCL to exit after all forms passed to --eval options have been evaluated.

I meant sbcl --eval '(format t "Hello world!")' which doesn't quit, apologies for the confusion.

@galdor
Copy link
Author

galdor commented Dec 26, 2023

CCL should absolutely have --script to avoid having to provide --no-init --batch --quiet, but --batch should absolutely result in CCL exiting after having processed --load and --eval options (more precisely after code evaluated due to these options has terminated).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants