skeeto / w64devkit

Portable C and C++ Development Kit for x64 (and x86) Windows
The Unlicense
2.7k stars 185 forks source link

docker for windows or linux and a line ending problem? #9

Closed mikereape closed 2 years ago

mikereape commented 2 years ago

Hi sorry to be so thick. Four questions probably all with obvious answers:

  1. Is the docker container to be built on Windows or Linux? I assumed Windows.
  2. If Windows, in a Windows container or a Linux container?
  3. What if Docker, which I've just re-installed, tells me that it now uses wsl2 for the backend?
  4. If you look at the snippet I've attached it looks to me like an old-fashioned Unix/Linux vs. DOS.Win line endnig problem when it's doing the sha256sum's but what are the '$' signs all about? They''re not in the Dockerfile.

Please forgive a Docker newbie for asking daft questions.

BTW, I'm a fan of your work. I've been folllowinng you for over a year. If you knew anything about me at all you would know that that statement is not a lame attempt to ingratiate myself.

Thanks very much in advance Mike sha256sums log.txt

skeeto commented 2 years ago

I've built w64devkit on both Linux (Docker, Podman) and Windows (Docker Desktop), so either should work. My releases are all built on Linux.

Your issue is caused by Git's fundamentally broken core.autocrlf. The behavior is worst on Windows where it's usually "true" by default. This is not the first time I've run into it corrupting data and breaking builds or tests. The only reasonable setting is "false" (do nothing). Here's how to set it just for w64devkit and fix the damaged files:

$ git config core.autocrlf false $ git reset $ git checkout .

With that fixed the build should work fine.

mikereape commented 2 years ago

HI I just want to thank you for your suggestions. That all worked a treat. I am poised to put it to heavy use immimently. Two comments however. While I am completely sympathetic to static builds only, of late I've come across a bunch of things which in Linuxland build .so files. IIRC neovim does and if you proceed with a static build ultimately it just breaks in the end. Something to think about maybe. Second comment is, again of late, I've come across a lot of projects that use cmake even in Linux projects. Again, neovim is one of them though I suspect they do that precisely because they do cross-platform builds including for Windows. Maybe something else to think about. Very very well done indeed. Thank you