Skip to content
This repository has been archived by the owner on Jan 7, 2024. It is now read-only.

godot-cpp fails to build in MSYS2 environment #1

Open
hansemro opened this issue Apr 8, 2022 · 0 comments
Open

godot-cpp fails to build in MSYS2 environment #1

hansemro opened this issue Apr 8, 2022 · 0 comments

Comments

@hansemro
Copy link
Owner

hansemro commented Apr 8, 2022

  • OS: Windows 10 Pro
  • Shell/Environment: MSYS2 downloaded from https://www.msys2.org/
  • MSYS2 packages installed with pacman -S mingw-w64-cross-gcc scons make git:
$ pacman -S mingw-w64-cross-gcc scons make git
resolving dependencies...
looking for conflicting packages...

Packages (45) heimdal-7.7.0-3  isl-0.22.1-1  libcbor-0.9.0-1  libfido2-1.10.0-1
              mingw-w64-cross-binutils-2.37-1
              mingw-w64-cross-crt-git-9.0.0.6158.1c773877-1
              mingw-w64-cross-headers-git-9.0.0.6158.1c773877-1
              mingw-w64-cross-windows-default-manifest-6.4-2
              mingw-w64-cross-winpthreads-git-9.0.0.6158.1c773877-1
              mpc-1.2.1-1  mpdecimal-2.5.0-1  openssh-8.9p1-3
              perl-Authen-SASL-2.16-2  perl-Clone-0.45-2
              perl-Convert-BinHex-1.125-1  perl-Encode-Locale-1.05-1
              perl-Error-0.17029-1  perl-File-Listing-6.14-1
              perl-HTML-Parser-3.76-1  perl-HTML-Tagset-3.20-2
              perl-HTTP-Cookies-6.10-1  perl-HTTP-Daemon-6.12-1
              perl-HTTP-Date-6.05-1  perl-HTTP-Message-6.36-1
              perl-HTTP-Negotiate-6.01-2  perl-IO-HTML-1.004-1
              perl-IO-Socket-SSL-2.074-1  perl-IO-Stringy-2.113-1
              perl-LWP-MediaTypes-6.04-1  perl-MIME-tools-5.509-1
              perl-MailTools-2.21-1  perl-Net-HTTP-6.22-1
              perl-Net-SMTP-SSL-1.04-1  perl-Net-SSLeay-1.90-1
              perl-TermReadKey-2.38-2  perl-TimeDate-2.33-1
              perl-Try-Tiny-0.31-1  perl-URI-5.10-1  perl-WWW-RobotRules-6.02-2
              perl-libwww-6.57-1  python-3.9.9-2  git-2.35.1-3  make-4.3-3
              mingw-w64-cross-gcc-10.2.0-1  scons-3.1.2-7

Issue: godot-cpp/SConstruct fails to recognize MSYS2 environment as a valid platform and raises an error.

In MSYS2-provided python3.9, sys.platform reports cygwin which does not fall under any category to set host_platform in godot-cpp/SConstruct.

Error:

$ make PLATFORM=windows build
cd godot-cpp && scons use_mingw=true platform=windows target=debug generate_bindings=yes -j4
scons: Reading SConscript files ...
ValueError: Could not detect platform automatically, please specify with platform=<platform>:
  File "/c/Users/Hansem Ro/Documents/GDClip/godot-cpp/SConstruct", line 80:
    raise ValueError("Could not detect platform automatically, please specify with platform=<platform>")
make: *** [Makefile:24: godot-cpp/bin/libgodot-cpp.windows.debug.64.a] Error 2

Workaround: Treat cygwin as linux host platform:

Replace if sys.platform.startswith("linux"): (line 71) in godot-cpp/SConstruct with if sys.platform.startswith("linux") or sys.platform == "cygwin":

With this workaround, gdclip library successfully builds and works perfectly in GDClip demo.

Comments

I am unsure why sys.platform reports "cygwin" when other users report "msys".

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant