-
Notifications
You must be signed in to change notification settings - Fork 585
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
--fsiargs switch broken with 3.x usage of FsiEvaluationSession #502
Comments
I don't see any easy way to replicate the E.g. It would be nice if the script only got the args intended for it. Anyone got a good idea (or do we have to fall back to environment variables only)? |
…rgs switch the value of an environemnt variable named fsiargs-buildscriptargs. This is the best solution to make this restricted set of args explicitly available to the build script.
OK. I decided the best bet would be to put these args in their own environment variable. This keeps the subset intact and makes the access explicit. I'll send the PR. |
The
--fsiargs
switch is broken in 3.x and I'm not sure how best to proceed to fix it (or work around it).I'm raising this issue as I tried to discuss it with @forki on Twitter and it was too hard :).
In 2.x and before, FAKE ran
fsi.exe
, which has the following command line:fsi.exe [options] [script-file [arguments] ]
(more details)The FAKE
--fsiargs
switch (which I added), allowed us to explicitly specify thisfsi
command line. It meant we could specify options forfsi
(e.g.--checked+
), but more importantly (for me) specify arguments for the build script, rather than stuffing them all in environment variables. So, an--fsiargs
example might be:--fsiargs --checked+ build.fsx --myarg someval --myage 41 --etc blah
(see FAKE command line Options for more)In 3.x we directly use
FsiEvaluationSession
. However, the new version concatenates the fsi options and the script args. When script args are present, the session evaluation fails, as fsi does not recognise my own custom script arguments.Easy Repro
You can easily repro this by setting the FAKE.exe project Debug Command Line Argument to the following (which would have been fine with 2.x):
--fsiargs test1.fsx --scriptArg a
You will get the error:
My initial fix attempt
I tried to fix by trying to mimic the
fsi
command line structure. Look at this small diff to see what I did. However, theRun
evaluation seems to have different semantics toEvaluate
(it does not return execution to FAKE), I get no console output andGetCommandLineArgs
returns all the args, not just the script arguments.I'd really appreciate some thoughts from someone that understands
FsiEvaluationSession
as to what I should do to fix this. Thanks!The text was updated successfully, but these errors were encountered: