I cloned the repo, tried to compile the source using the provided script, but I get:
error: ‘_O_BINARY’ undeclared (first use in this function); did you mean ‘O_BINARY’?
1222 | _setmode(T1_, _O_BINARY);
PS: I have opened an issue on Github: https://github.com/nim-lang/Nim/issues/15090
Everything is ok in my sys2+mingw64 on no matter win7 64bits or win 10 64bits just 3 steps
git clone https://github.com/nim-lang/Nim
cd nim
./build_all.sh
I have also installed : sys2+mingw64 (from: https://www.msys2.org/wiki/MSYS2-introduction/), but when I test the version of gcc, I get the message hereunder, which is not the right target, apparently:
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-msys/9.3.0/lto-wrapper.exe
Target: x86_64-pc-msys
Configured with: /msysdev/gcc/src/gcc-9.3.0/configure --build=x86_64-pc-msys --prefix=/usr --libexecdir=/usr/lib --enable-bootstrap --enable-shared --enable-shared-libgcc --enable-static --enable-version-specific-runtime-libs --with-arch=x86-64 --with-tune=generic --disable-multilib --enable-__cxa_atexit --with-dwarf2 --enable-languages=c,c++,fortran,lto --enable-graphite --enable-threads=posix --enable-libatomic --enable-libgomp --disable-libitm --enable-libquadmath --enable-libquadmath-support --disable-libssp --disable-win32-registry --disable-symvers --with-gnu-ld --with-gnu-as --disable-isl-version-check --enable-checking=release --without-libiconv-prefix --without-libintl-prefix --with-system-zlib --enable-linker-build-id --with-default-libstdcxx-abi=gcc4-compatible --enable-libstdcxx-filesystem-ts
Thread model: posix
gcc version 9.3.0 (GCC)
Problem solved:
1. Version of mingw used:
http://repo.msys2.org/distrib/x86_64/msys2-x86_64-20200720.exe
2. Version of gcc installed (with pacman):
pacman -S mingw-w64-x86_64-openssl
https://packages.msys2.org/base/mingw-w64-gcc
3. Version of openSSL installed (necessary for "Nimble"):
https://packages.msys2.org/package/mingw-w64-x86_64-openssl
I had the same issue yesterday and solved it differently.
I used Mingw from mingw-builds (GCC 8.1.0)
And I used the OpenSSL, PCRE and related DLL's from Nim's website. This is a nice prepackaged zip archive with all the dependencies Nim needs on Windows: https://nim-lang.org/download/dlls.zip
The install instructions from the Nim website still apply when building from source: https://nim-lang.org/install_windows.html
@narimiran and @araq: There was another older github issue about this as well. Including myself, that makes at least 3 times people have had trouble figuring this out. It might be a good idea to add an FAQ to the github readme or somewhere more visible.
@Araq, it's not about stupid. it's about you being too familiar.... You have too look at it from the point of view of a new user.
A person who goes to github to build from source is not going to necessarily go the download page on the main website. Why would they? They don't want the official release, they want to build from source...and they definitely aren't going to read a random github issue from months ago in which you state, "cygwin is not supported." Tell me, where else do you state cygwin is not supported? I don't see it on the github wiki either... I only found it because I happen to have experience. Github issues are not documentation.
Sometimes good documenation must be redundant.
@araq, also, You like to talk about empirical evidence. 3 isn't a huge number of cases, but given the size of the Nim community, it's way more statistically significant than a single isolated case.
That's pretty strong evidence that the docs are broken for this case imo.
But yeah, I am not fan of documenting all the unsupported ways of installing Nim because that's impossible. Why would Cygwin be supported? We also don't support DJGPP on DOSBox.
Cygwin is much more commonly used on Windows than either of those (by a large margin.)
Your approach is too rigid.
Obviously you can't document all possible unsupported setups. I'm not suggesting that. I am suggesting that you should account for the common mistakes (especially when presented with empirical evidence that a mistake is common.)