4 ms·
Bash + coreutils/busybox/etc are everywhere, I can take them for granted. I will have to jump through hoops to deploy Powershell outside of Windows. I also hav
by heavyset_go 2y ago
Bash + coreutils/busybox/etc are everywhere, I can take them for granted. I will have to jump through hoops to deploy Powershell outside of Windows.
I also have no desire to use Powershell when I don't need to.
- dangus 2y agoBut they aren’t on windows, so they can’t be taken for granted there. You have to install git bash on windows. What’s the difference between installing git bash on windows and installing powershell on Mac/Linux? I would argue that there is none. And obviously it’s fine that you don’t want to use PowerShell, I don’t want to use it either. But personally I also dislike git bash on windows. It doesn’t feel like it belongs there, just like powershell doesn’t really belong on Linux/Mac. If I had to write a build script for all three platforms I would just write them for their native environments. I wouldn’t be all that willing to add another tool to be installed just to save myself the effort of simple build script.
- heavyset_go 2y agoI can run an MSYS2 installer on a Windows VM once and be done with it. I will have to roll my own containers, for example, if I want to use Powershell elsewhere, versus just using vanilla or vendor-provided images. For my use case, I don't see the need to bend my builds around Powershell just to use Powershell. This plays into my other point about not wanting to dig into Windows fundamentals when I don't need to. > If I had to write a build script for all three platforms I would just write them for their native environments. I wouldn’t be all that willing to add another tool to be installed just to save myself the effort of simple build script. This was my initial approach, but it became too much work to maintain separate build systems, especially when it came to making changes over time. One change becomes three, along with three new opportunities for things to break in three separate ways. For what I'm doing, moving to Unix-y toolchains simplified builds and made it much easier to reason about it.
- dangus 2y agoI totally get that your solution works for you and that is fantastic. I’m only questioning the pure logic behind it when you strip away opinion/preferences. You picking one OS that you’re okay with modifying but the other one you’re not. If we inversed that preference and said that I’m willing to modify my Linux containers but unwilling to install software on my Windows VM, the logic is the same. By the way, Microsoft publishes Linux images that already have PowerShell pre-installed. https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-linux?view=powershell-7.4 https://learn.microsoft.com/en-us/powershell/scripting/insta... So, technically, if your build scripts were 100% PowerShell you could have it where both Windows VMs and Linux docker images could be unmodified. Since your build scripts sound overly complex, they could possibly benefit from a scripting language that’s got support for objects and object data pipelines, more advanced error handling, and more advanced object parsing than tools like sed and awk. Just playing “devil’s advocate” here, the logic checks out.
- MichaelRo 2y ago>> What’s the difference between installing git bash on windows and installing powershell on Mac/Linux? I would argue that there is none. Big, big difference. My Windows laptop is basically a terminal to the Linux development server. I can install anything (within reason) on Windows, can't install shit on the Linux server unless I beg the IT admin for days and eventually he just says "no". He did install the "mc" (Midnight Commander) utility on it though and made my life like 100x easier. If MC were bundled with git bash, that would be something I would cheer for. And yeah, I use git bash too on Windows. For accessing the Linux shell through ssh when I remotely connect to the server and for convenience locally. Main workhorse are the "less" and "grep" utilities to examine logs. What am I goint to use otherwise, Notepad?
- dangus 2y agoJust because you aren’t familiar with Windows commands doesn’t mean they don’t exist. Microsoft actually gives you SSH without the need to install git bash. https://learn.microsoft.com/en-us/windows/terminal/tutorials/ssh https://learn.microsoft.com/en-us/windows/terminal/tutorials... grep on windows is Select-String https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/select-string?view=powershell-7.4 https://learn.microsoft.com/en-us/powershell/module/microsof... More command on windows: https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/more https://learn.microsoft.com/en-us/windows-server/administrat... What will you use to view logs, Notepad? Well, you could use the #1 most popular text editor that Microsoft happens to develop, VSCode. Or a wide array of Windows GUI software that isn’t available on Linux, like Notepad++. The fact that your IT department has those specific policies in place and is inflexible with your developers isn’t really relevant to this discussion. The truth is that if you wanted PowerShell on Linux it is trivial to install. Microsoft even publishes Linux images that already include PowerShell.