-
Notifications
You must be signed in to change notification settings - Fork 10.3k
git clean deletes ts client #6845
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
Comments
Looks like a known issue in git. See git-for-windows/git#437 and https://www.bountysource.com/issues/29901518-git-clean-removes-content-of-symlinks |
@BrennanConroy I think we should look into removing symbolic link usage :( |
As @natemcmaster cited, the path references in package.json cause npm to create the link. This is a very common pattern for path-based references between node modules. If it causes problems with git for windows that's concerning. I'm not sure if there's a simple way to work around it. |
@anurse I was thinking that we could do dependencies differently. Perhaps not possible, but I thought there could be a way. Multiple people keep hitting this on Windows unfortunately. It's easy to revert but it's definitely a nuisance. |
Does |
@natemcmaster do you think a mitigation possibility could be that we move the TS client out of the mondo repo and begin the process of separating the non-.NET SignalR clients into their own repositories somewhere else? If that would mitigate here, we could start talking about doing it soon. |
The same problem would apply in a new repo too. The problem is a combination of the way npm on windows does “File:/” dependencies and a bug in git-for-windows. Moving to a new repo doesn’t solve either of those problems.
|
@natemcmaster but it does reduce the number of people affected by it, and if you're planning to separate the clients anyways... |
Moving to a new repo solves the problem of everyone complaining. Only a couple people will hit the issue if we move it, and we can ignore it. |
IMO, let's not jump to a "new repo" solution just yet. I'd rather have simplified build infra with less repos. Even if it means we can't solve this fully. |
Maybe. Worth a shot. The biggest place this is used is in the Functional Tests and they use WebPack. We should probably use a standard version reference instead of a path reference and then use the WebPack config to redirect to the local path. |
Any chance our new usages of yarn make this simpler? It's always very annoying when I run into this. |
Yarn does the same thing npm does— symlink a directory— so no. Problem still exists.
|
I just had a Given that, the solution is actually super simple. Add
We could do this just in the @BrennanConroy could you see if this fixes the issue? If so, let's do it. (cc @Tratcher @aspnet/build) |
We would need to commit the symlink folders otherwise they would probably appear in |
either way, I likes it 😃 |
@BrennanConroy true, but the files themselves are already committed anyway so it might just work? There could be a recursion issue though since I think the |
Tried various incantations of the above but couldn't get it working |
Back to the drawing board I guess :(. |
There is an issue tracking this in git for windows and it seems like there's a possibility it will be fixed git-for-windows/git#607 |
Found a reasonable way. See #12281 |
I wouldn't call that a fix, but it's a reasonable stop-gap. We shouldn't close this work item based on that, but I will be moving this out from preview 8. |
My preference is that |
In other words, keep this open and move it to the backlog. |
Thanks for your perspectives and for unassigning me 😺 |
Fixed by git-for-windows/git#2268 in 2.23.0? Needs verification. |
Fixed ! |
git clean -xdf
keeps deletingsrc\SignalR\clients\ts\signalr
andsrc\SignalR\clients\ts\signalr-protocol-msgpack
Repro steps:
build /t:restore
(runs npm install)dir /al /s
(shows those folders as hard junctions from\src\SignalR\clients\ts\FunctionalTests\node_modules\@aspnet
)git clean -xdf
(those folders get deleted)git status
(git shows those folders as deleted)This happens because we've configured a junction between
src\SignalR\clients\ts\FunctionalTests\node_modules\@aspnet\signalr
andsrc\SignalR\clients\ts\signalr
(how?) andnode_modules/
is in the.gitignore
file. When git clean clears the node_modules dir it follows the junction and deletes the client as well.Proposal: can we populate the
node_modules\@aspnet\signalr
folder via some other mechanism besides using a junction? E.g. manually copy the files?Open question: Where is this junction configured? Is it this?
https://github.com/aspnet/AspNetCore/blob/89a7f3cf774d46eaaea26861744a224a6487f31c/src/SignalR/clients/ts/tsconfig.base.json#L21-L28
@davidfowl @BrennanConroy @anurse
The text was updated successfully, but these errors were encountered: