-
Notifications
You must be signed in to change notification settings - Fork 105
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:*UNPROCESSED-COMMAND-LINE-ARGUMENTS* is NIL when running an image #177
Comments
Okay, I took a swim in the source and at least I see why this is happening. The weirdness with some CCL options being missing from Lines 1250 to 1253 in 316ff87
The code that handles processing the rest of the command line arguments is called from a I don't have enough knowledge/context to know if this is all intentional, or if it's a bug that should be fixed. |
Hi Steve!
Why don't you use (asdf:make :my-system) and (uiop:command-line-arguments)?
You just need to add such lines to the asd file:
:build-operation "program-op"
:build-pathname "my-app"
:entry-point "my-package:main"
…On Sat, Dec 22, 2018 at 8:38 PM Steve Losh ***@***.***> wrote:
Okay, I took a swim in the source and at least I see *why* this is
happening.
The weirdness with some CCL options being missing from
ccl:*command-line-argument-list* is because some options are handled by
the C kernel and removed before Lisp ever has a chance to see them:
https://github.com/Clozure/ccl/blob/316ff87eddc9c4758e57bc725dee23638ed061be/lisp-kernel/pmcl-kernel.c#L1250-L1253
The code that handles processing the rest of the command line arguments is
called from a :before method on toplevel-function
<https://github.com/Clozure/ccl/blob/master/level-1/l1-application.lisp#L173-L185>.
This method is only called when you *don't* specify a :toplevel-function
argument to save-image
<https://github.com/Clozure/ccl/blob/master/lib/dumplisp.lisp#L137-L159>.
So that explains why ccl:*unprocessed-command-line-arguments* is empty
when I dump an image.
I don't have enough knowledge/context to know if this is all intentional,
or if it's a bug that should be fixed.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#177 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AABg-_5vH2XZz83hksbN289FWk50HHmEks5u7m4IgaJpZM4ZfiKm>
.
--
Alexander Artemenko
https://github.com/svetlyak40wt
|
@sjl something you might also be interested in is that I don’t think there is a way to disable the hidden kernel options, I think of it as a feature. :-) |
@svetlyak40wt I don't want to get into a discussion about whether ASDF/UIOP are good or not here. This ticket is about a variable that CCL exports having a seemingly-buggy value is some situations. Whether UIOP works around that or not is orthogonal to CCL having/not having a bug. @eugeneia Yeah, I see that application class is doing the same workaround as UIOP (just parsing |
@sjl One possible workaround might be an indirection between your app executable and the ccl binary. From
I.e., you could have a shell script that passes its arguments to |
The workaround mentioned in --help doesn't work because CCL:*UNPROCESSED-COMMAND-LINE-ARGUMENTS* is empty when you're running a dumped image. This is literally the title of this GitHub issue.
… On Dec 25, 2018, at 16:16, Max Rottenkolber ***@***.***> wrote:
@sjl One work around might be an indirection between your app executable and the ccl binary. From ccl --help:
Any arguments following the pseudoargument "--" are
not processed and are available to the application as
the value of CCL:UNPROCESSED-COMMAND-LINE-ARGUMENTS .
I.e., you could have a shell script that passes its arguments to exec ccl -n -I myapp.image -- ....
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I'm trying to produce a stand-alone application with CCL that takes command line arguments. I know CCL doesn't have anything like SBCL's
:save-runtime-options
feature so I won't be able to make this work perfectly, but I can't even seem to get the workaround mentioned in that ticket working.When I run CCL normally,
ccl:*command-line-argument-list*
andccl:*unprocessed-command-line-arguments*
appear to work like so:I'm a little confused about how
ccl:*command-line-argument-list*
works. At first I thought it was removing arguments that were used by CCL itself (like--batch
) but that can't be it, because it passes through other things like--quiet
. So I don't know exactly what this variable is supposed to contain.But that's okay, because
ccl:*unprocessed-command-line-arguments*
is what the workaround says to use, and that does appear to work as described (containing all arguments after the--
terminator). Great.Now I dump an image:
And run it with some arguments:
Now
ccl:*unprocessed-command-line-arguments*
is just completely empty, even with--
in the argument list. The same thing happens even if I create an image (without:prepend-kernel
) and run CCL itself:So now I'm just totally confused. Is this a bug in CCL, or am I not understanding what
ccl:*unprocessed-command-line-arguments*
is supposed to do?I'm running CCL
Version 1.11.5/v1.11.5 (LinuxX8664)
on Ubuntu 18.04.Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: