Fix issues with package management subdirectories#12381
Merged
KevinRansom merged 1 commit intodotnet:mainfrom Nov 16, 2021
Merged
Fix issues with package management subdirectories#12381KevinRansom merged 1 commit intodotnet:mainfrom
KevinRansom merged 1 commit intodotnet:mainfrom
Conversation
brettfo
reviewed
Nov 12, 2021
| if Directory.Exists(workingDirectory) then | ||
| Directory.Delete(workingDirectory, true) | ||
| #if !DEBUG | ||
| if workingDirectory.IsValueCreated then |
Member
There was a problem hiding this comment.
Don't you only want to delete the directory if line 198 above (Directory.CreateDirectory(directory) |> ignore) was executed, not simply if the lazy block was entered?
Contributor
Author
There was a problem hiding this comment.
@brettfo , I think the real issue, is that the directory must be created. If a directory with the name already exists, then it's still a problem. Of course, given that the directory name is 'managed threadid - some randomly generated guid' then it's unlikely to already exist. But I shall address that.
brettfo
approved these changes
Nov 15, 2021
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #12140 - Fsc deletes the output directory
Fixes #11923 - FSI fails with "error FS3217: No such file or directory"
Additionally, this makes working directory evaluation lazy ... so it doesn't touch the disk unless nuget evaluation is actually required.
#12140 - Fsc deletes the output directory
The output directory deletion was because, we pass the directory from --out: to the package manager, the pm intended to create use and delete a subdirectory from that, however, due to a bug it didn't. Instead it used the directory from --out: and tried to delete that.
Fixes #11923 - FSI fails with "error FS3217: No such file or directory"
This failed because when no directory is specified the package manager created a directory in the temp directory named
nuget/Some randomized directory name.On linux, if the
tempdir/nugethad been created by a different user, e.g. the sudo admin user, then subsequent scri0pts not run with that user would fail.This modification simply eliminates the common part of the path. So the script should be able to write using whatever user is executing the code.