-
Notifications
You must be signed in to change notification settings - Fork 249
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
Dotnet restore uses global temporary directory #2793
Comments
Not sure what is best temp to use on Linux: http://stackoverflow.com/questions/31068/how-do-i-find-the-temp-directory-in-linux |
@rrelyea Not sure, but on Ubuntu 14.04 only |
As a work around, you can either set your environment variable |
Same issue on centos. I believe all *nix systems are affected. Did not check on windows yet. Any reason to not use user specific directory (i.e. inside |
+1 i ran into same problem in an non-root docker container. @IntelOrca thank you. I think this is a bug. |
Another possible workaround is to simply delete |
Yes remove the /tmp/NuGetScratch will work fine. Besides, I have created a docker image to resolve some problem about this and other anti-root tools like yeomon . https://hub.docker.com/r/osexp2000/dnetcore_docker_image/ |
Deleting the folder will not solve the issue of two users doing a package restore at the same time. |
On linux, Path.GetTempPath returns "/tmp" while on Windows it returns a user specific folder "C:\Users\tmds\AppData\Local\Temp". From the corefx code it seems like the value returned by Path.GetTempPath can be controlled by setting the TMPDIR environment variable. Setting this variable to a user specific folder can serve as a workaround. According to the documentation Path.GetTempPath should return the current user's temporary folder. I'll create a matching issue in the corefx repo to see of Path.GetTempPath needs to be updated so it returns a user specific folder or whether the NuGet.Client needs to take into account it may not be the sole owner of the directory returned by Path.GetTempPath. |
Would it be possible to enhance NuGet to work with any number of concurrent package restores even for the same user? |
@IntelOrca NuGet allows concurrent restores for the same and different users. "lock" is a folder and in it are files which represent a lock on a file in the filesystem. |
Fixed with NuGet/NuGet.Client#1035. Thanks @tmds! |
Woohoo! Thanks 😄 |
Deleting |
Fixed the issue by deleting |
This is a forwarded issue from the Dotnet CLI repository, I was informed that this issue stems from the NuGet side of things.
The original issue can be seen here: https://github.com/dotnet/cli/issues/2806
Steps to reproduce
dotnet restore
dotnet restore
Expected behavior
dotnet restore
should work as expected and my project's dependencies should be restored.Actual behavior
dotnet restore
attempts to re-use the /tmp/NuGetScratch/lock causing a permissions error and failing out.Environment data
dotnet --info
output:(Attempting to run
dotnet --info
yields no helpful information, I randotnet --version
)dotnet --version
:.NET Command Line Tools (1.0.0-beta-001598)
Product Information:
Version: 1.0.0-beta-001598
Commit Sha: N/A
Runtime Environment:
OS Name: ubuntu
OS Version: 14.04
OS Platform: Linux
Runtime Id: ubuntu.14.04-x64
The text was updated successfully, but these errors were encountered: