cake-build / resources

Contains different kind of resources such as bootstrappers and configuration files.
MIT License
54 stars 79 forks source link

Undesirable side-effects due to environment variable created by bootstrapper #101

Closed Jericho closed 3 years ago

Jericho commented 3 years ago

The bootstrapper creates three environment variables which are not cleared when the scripts concludes which means that these variables will remain effective as long as the PowerShell session is active.

This is a problem if a developer switches from the bootstrapper for .net framework (to build project A) to the bootstrapper for .net tool (to build project B) IN THE SAME POWERSHELL SESSION <-- this is important. You get weird errors that are hard to investigate. See this issue for an example where I struggled to figure out what was preventing me from building my project. @gep13 helped me investigate and we eventually figured out the presence of the environment variables what the culprit.

This problem goes away if you close PowerShell and open a new session but a safer solution would be to ensure the bootstrapper cleans up after itself.