Live data from Hacker News

WSL2 corrupting Git repositories and shell history

github.com

261–270 of 423 posts

Re: WSL2 corrupting Git repositories and shell history

#261

WSL2 was promised as a good working extension for a Linux dev environment on windows by my peers. Sadly, a whole host of issues specific to my dev environment meant that it was useless as I’d spend more time fixing it than getting any valuable use out of it. More importantly, this became the very reason I switched to arch full time, and haven’t looked back since. I still hope that it becomes what it was promised to b…

Opposite anecdata - I got a gaming PC and i migrated all my development to it and WSL(2) has been a godsend. VS Code has a "WSL Remote" mode that works really well (where a vscode server runs in Linux and the windows GUI access it "remotely"). I even use the Windows Github app for the occasional GUI-assisted commit, and apart from being slow its fine. I've had only two problems with this set up: - Occasionally VS Cod…

Oh you need to fucking disable Window's Defender though, or add exclusions for your Linux distro/WSL2 folder, because when installing "node_modules" it will attempt to do realtime scans for threat-protection which absolutely cripples the speed.

https://www.cicoria.com/improving-windows-subsystem-for-linu...

https://www.reddit.com/r/bashonubuntuonwindows/comments/eok7...

"I noticed a significant performance difference after adding exclusions to the Windows Defender. My Rails server and NPM installs sped up dramatically (I mean like 4x faster, no joke)."

Stupid.

Re: WSL2 corrupting Git repositories and shell history

#262
post #185
post #177

Earlier quoted context omitted.

This is data loss. A few object files in the Git directory are truncated. Which results in a corrupted repository, from Git's point of view.

That’s corruption. Data loss would indicate an entire fs transaction getting dropped entirely - but not breaking the principle of atomic ops. A write should either happen entirely or not at all.

Filesystems don't try to order writes to different files. So you get HEAD pointing to a truncated commit, or a commit pointing to a truncated blob.

The same happens if you have a power loss or kernel crash on Linux (as a kernel developer, it happened to me several times when testing freshly-committed code).

Re: WSL2 corrupting Git repositories and shell history

#263

Earlier quoted context omitted.

WSL1 is much better integrated, which is useful for some things, especially when networking is involved. And it wastes less memory as a consequence. The root partition is slower, but I'm usually manipulating windows files anyway so both versions are similarly slow. I use WSL2 right now, but only because I need to mount a vhd that's formatted with BTRFS.

You can’t compile anything with WSL1, did you notice that?

Do you mean kernel modules? You can compile programs just fine. There's a whole infrastructure around using visual studio code to run the UI natively and compile things inside the linux environment.

Re: WSL2 corrupting Git repositories and shell history

#264
post #228

> Feel like booting Linux on a separate disk because of these issues. It always seemed strange to me that people would rather use WSL than the real thing when Windows doesn't bring much advantage. What am I missing ?

The desktop experience Windows offers is often a lot better than the desktop experience of Linux. Then there's also the issue of Linux hardware support which often is not optimal. Also a lot of people need to use Windows for work and don't have a choice. And then there's the possibility people actually like using Windows. Having a full Linux terminal in your Windows desktop environment is the best of both worlds for…

>The desktop experience Windows offers is often a lot better than the desktop experience of Linux.

Shockingly, this is untrue if using KDE. Almost everything in it is better than a multi-billion-dollar company's monopolistic OS shell somehow, from the taskbar customization to the features (disable compositing, deep customization of effects and behavior, have windows remember size/position, etc.) to the file manager, Dolphin, which has split views, tabs, had a dark theme a dozen years ago, more file metadata to show optionally like date modified and size, thumbnails for even text files, terminal integration, and more (although technically that's an independent package available on any DE). The exceptions are how "smoothly" windows glide around the screen when dragged and that the Windows taskbar looks slightly better.

Re: WSL2 corrupting Git repositories and shell history

#265
post #11

Earlier quoted context omitted.

It's very useful for projects that require (or work better in) a linux environment. I don't want to start up a full linux VM, that sounds like a lot of overhead and I'm more likely to not bother at all. WSL is much lighter than that (we're not talking virtualbox here), if I open windows terminal its up and running, there's almost-zero start up cost. With VSCode I can switch between working in WSL and windows easily,…

You've not explained why you would not run a native Linux system in the first place…

I write C# for .Net Core and .Net Framework professionally.

I'm open to suggestions but it simply seems crazy difficult to do this outside of Windows. WSL lets me jump into *nix quickly when I need it for whatever reason. I don't need a desktop machine. Why not just use WSL?

Re: WSL2 corrupting Git repositories and shell history

#266

Earlier quoted context omitted.

Opposite anecdata - I got a gaming PC and i migrated all my development to it and WSL(2) has been a godsend. VS Code has a "WSL Remote" mode that works really well (where a vscode server runs in Linux and the windows GUI access it "remotely"). I even use the Windows Github app for the occasional GUI-assisted commit, and apart from being slow its fine. I've had only two problems with this set up: - Occasionally VS Cod…

Oh you need to fucking disable Window's Defender though, or add exclusions for your Linux distro/WSL2 folder, because when installing "node_modules" it will attempt to do realtime scans for threat-protection which absolutely cripples the speed. https://www.cicoria.com/improving-windows-subsystem-for-linu... https://www.reddit.com/r/bashonubuntuonwindows/comments/eok7... "I noticed a significant performance difference…

This is nothing specific to WSL though, Windows has always had this problem. I expect there are many Windows developers who have no idea how much time they spend waiting for their code to be virus scanned every day.

Re: WSL2 corrupting Git repositories and shell history

#267

WSL2 was promised as a good working extension for a Linux dev environment on windows by my peers. Sadly, a whole host of issues specific to my dev environment meant that it was useless as I’d spend more time fixing it than getting any valuable use out of it. More importantly, this became the very reason I switched to arch full time, and haven’t looked back since. I still hope that it becomes what it was promised to b…

Opposite anecdata - I got a gaming PC and i migrated all my development to it and WSL(2) has been a godsend. VS Code has a "WSL Remote" mode that works really well (where a vscode server runs in Linux and the windows GUI access it "remotely"). I even use the Windows Github app for the occasional GUI-assisted commit, and apart from being slow its fine. I've had only two problems with this set up: - Occasionally VS Cod…

[deleted]

Re: WSL2 corrupting Git repositories and shell history

#268
post #67
post #45

Earlier quoted context omitted.

Business. For better or worse, there are plenty of places where the policy and tech allow WSL but installing a hypervisor on your machine is much more challenging. WSL2 is basically just a Linux VM, though (I think it actually uses Hyper-V containers which seem to occupy some weird space between Linux container and VMs)

Hyper-V is VMs not containers. When you enable Hyper-V it's actually the 'operating system' and Windows is a guest VM believe it or not.

Sure but, afaik, the docs originally called the "light weight" isolation mode Hyper-V Containers vs the traditional Hyper-V VM with more features exposed

Re: WSL2 corrupting Git repositories and shell history

#269

Important I think to point out that these are (numerous) user reports of files "corrupted". There isn't afaics any confirmation yet as to exactly what's happening nor the underlying cause.

Acked by the MSFT folk: https://github.com/microsoft/WSL/issues/5026#event-416012748...

Are you sure this person is MSFT? There is zero information about them on GitHub.

Re: WSL2 corrupting Git repositories and shell history

#270

Earlier quoted context omitted.

What is inadequate about Libre Office ?

Calc is really not an adequate substitute for Excel if you need to use VBA macros - which might be coming from your customers! And in the wild I see plenty of older Excel documents (before 97) which I don’t think are compatible with LibreOffice. Obviously this isn’t an ideal situation but historical data around prices/etc from the 90s are often stored as old Excel binaries. In general I think using Calc (or Google Sh…

Not sure about Calc, but 'modern' Excel doesn't even seem to be able to deal with text (UTF-8) in CSV properly :

https://news.ycombinator.com/item?id=25015679

(And I know from experience that 2003- versions of Excel don't.)

Post reply on HN