-
Notifications
You must be signed in to change notification settings - Fork 238
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
Too deeply nested script executions lead to not found NuGet packages #364
Comments
Uwe, just letting you know... I am looking into it. |
Uwe, everytime a script is executed it adds user search dirs to the path: But it is done once per process. Thus it should not accumulate as I assume you are talking about script execution in new processes. |
Uwe, I just changed the implementation of that algorithm (a368d5b) Can you check if it addresses the problem of growing PATH? Please note that PATH can also be updated by any other apps sunning in the same parent-child process branch. |
I've tried the preview version directly to run on my project. It now immediately fails on some scripts with the original error message of missing references, even without any nested calls. I try to reproduce this in an isolated minimal script but currently fail. Will continue trying. What I discovered is that running
always seems to not generate those
with the stable version installed as a .NET Tool actually does create them. Update 1I still fail to create an isolated set of example scripts but now even other projects that succeed with the stable version fail with the new preview version. Update 2I've tried with v4.8.14.0 and this version also does not create those Update 3I've tried with v4.8.12.0, i.e. the very same version that I also have installed as a global .NET Tool. Running
does not create those
does. I'm very confused now. What might I do wrong? |
The preview was a throw-away build just to quickly test the immediate idea in your environment. Most likely I have made some mistake there. Please remove that preview and I will rebuild it after I troubleshoot it. The change itself is valid. There is also another possibility to oversaturate envars via storing assembly path. I have fixed it by allowing switching off in CSScriptLib.dll but I did not do it for exe. I did not anticipate an intensive parent-child process forking. I just overlooked it. I am looking into it. What will also help, is a hello-world test case that shows the problem for the v4.8.14. Will need it if I cannot get anywhere on my own. |
Thanks, Oleg. As I added in my above comment, even 4.8.12, when not running as a .NET Tool, no I cannot get my head around what is different (on my system) to have such a behavior. |
I am also a little puzzled. So it explains. This will do the trick. .\css -config:set:LegacyNugetSupport=false
# ensure you are not executing
css -config:set:LegacyNugetSupport=false But... I do not see any code that actually creates this file regardless of the settings. CS-Script seems to read it but not to create it. It does not make sense but I am trying to see what is going on. Any ideas? |
I see, thanks a lot, Oleg. In fact I did call Will try now whether this makes any difference. |
Yep. This will create that *.nuget.cs file. creation of this file is part of the new Nuget support. It contains all nuget assemblies that dotnet aggregates on the Thus your problem with pre-release will be solved by disabling the LegacyNugetSupport algorithm. I probably should now disable it by default. After that you can see if the change in the path makes any difference. I also check in your scripts if |
I have also added a more detailed description about the way nuget support works: https://github.com/oleg-shilo/cs-script/wiki/NuGet-Support#how-does-it-work |
Thanks again, Oleg! I'm just in the middle of letting my scripts run with v4.8.14.1 and until now it seems to run way better. I'll post here an update when if succeeded or failed. |
Not a prob. When you have time. |
A first, shorter run through the scripts succeeded. 🥰 Will try another more thorough run now. |
I also disabled that location-envar by default. But it will only be available with the next pre- or a proper release. |
Running my full build scripts with v4.8.14.1 results again in these errors
I'll simply stick to legacy CS-Script for now and when the new version is released (no need to hurry!) I'll try again with this version. If you want me to test other previews simply drop me a line, I'm happy to do so 😊 |
OK, then let's put it on pause until it is ready. |
Thanks. I've tried several hours to create a test case without success 😭 |
:) |
The names of the packages seem to be arbitrary. One of them is e.g. SharpZipLib. |
I have attached the automated test that is testing deep to 25 levels of nesting. |
Thank you! I've let your script run for several hours now and I even added looping. Even with v4.8.12 I could not generate any errors. Drives me crazy! |
I know the feeling..... :o( |
I migrated a larger project of mine from using CS-Script for .NET Framework to the "new" CS-Script for .NET Core.
Errors
While most of the scripts run successfully I experience errors like these:
Translated to English this should read:
This happens only when the script is executed from within other scripts.
My script "architecture"
Basically I'm doing a chain of something like this.
I'm not quite sure but I do think the maximum nesting level is about 3 or 4.
In addition, I sometimes execute child scripts in a loop and this also seems to fail after some loops.
Assumption
This works for some nesting depth but suddenly leads to above errors when the nesting depth is too deep.
(At least this is my strong assumption)
Discoveries
I do log a lot of stuff, beside others the
Path
environment variable.To my surprise for every call to my scripts, it seems to get larger and something like this is appended:
and later it gets bigger:
(My largest
Path
value was 3421 characters long in total)My assumption is that the
Path
variable gets larger for every nested call to the a script and then it is too large and it cannot find the paths to the NuGet packages anymore and thus results in the above error.Request for help
Does the above makes some sense?
Is there a way to not completely rewrite/redesign my nested calling structure and still fix this issue?
The text was updated successfully, but these errors were encountered: