I used WSL2 on Windows 10 to compile the WSL2 kernel with additional flags supporting wireguard. So I'm pretty sure compiling works, maybe it was an issue with WSL1?
I concede technically yes it can compile some things but there is such a large catalog of software which fails to compile in WSL2 itβs frustrating. A great example is the many Python modules with c extensions.