Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to install gem on Windows 10 #2809

Closed
Tofpu opened this issue May 15, 2024 · 6 comments
Closed

Fails to install gem on Windows 10 #2809

Tofpu opened this issue May 15, 2024 · 6 comments

Comments

@Tofpu
Copy link

Tofpu commented May 15, 2024

I tried to provide as much information as I could with my current limited knowledge of the systems involved. I'm open to providing more information if you could provide me instructions or something that could potentially guide me.

Operating System:

OS Name:                   Microsoft Windows 10 Home
OS Version:                10.0.19045 N/A Build 19045

Ruby: ruby 3.3.1 (2024-04-23 revision c56cd86388) [x64-mingw-ucrt]

Gem: 3.5.10

When attempting to install the latest version of prism via gem:

C:\Users\T>gem i prism -v 0.29.0
Using rubygems directory: C:/Users/T/.local/share/gem/ruby/3.3.0
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR:  Error installing prism:
        ERROR: Failed to build gem native extension.

    current directory: C:/Users/T/.local/share/gem/ruby/3.3.0/gems/prism-0.29.0/ext/prism
C:/tools/ruby33/bin/ruby.exe extconf.rb
checking for prism.h in C:/Users/T/.local/share/gem/ruby/3.3.0/gems/prism-0.29.0/include... yes
checking for prism/extension.h in C:/Users/T/.local/share/gem/ruby/3.3.0/gems/prism-0.29.0/ext... yes
checking for whether -fvisibility=hidden is accepted as CFLAGS... yes
compiling build/static/diagnostic.o
In function 'pm_diagnostic_message',
    inlined from 'pm_diagnostic_list_append' at src/diagnostic.c:737:20:
src/diagnostic.c:713:46: error: array subscript 301 is above array bounds of 'const pm_diagnostic_data_t[301]' [-Werror=array-bounds]
  713 |     const char *message = diagnostic_messages[diag_id].message;
      |                           ~~~~~~~~~~~~~~~~~~~^~~~~~~~~
src/diagnostic.c: In function 'pm_diagnostic_list_append':
src/diagnostic.c:85:35: note: while referencing 'diagnostic_messages'
   85 | static const pm_diagnostic_data_t diagnostic_messages[PM_DIAGNOSTIC_ID_MAX] = {
      |                                   ^~~~~~~~~~~~~~~~~~~
cc1.exe: all warnings being treated as errors
make: *** [Makefile:58: build/static/diagnostic.o] Error 1
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include=${opt-dir}/include
        --without-opt-include
        --with-opt-lib=${opt-dir}/lib
        --without-opt-lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/tools/ruby33/bin/$(RUBY_BASE_NAME)
        --enable-build-debug
        --disable-build-debug
        --enable-build-minimal
        --disable-build-minimal
extconf.rb:51:in `system': Command failed with exit 2: make (RuntimeError)
        from extconf.rb:51:in `block in make'
        from extconf.rb:50:in `chdir'
        from extconf.rb:50:in `make'
        from extconf.rb:136:in `<main>'
Running make build/libprism.a with {"SOEXT"=>"dll", "MAKEDIRS"=>"/usr/bin/mkdir -p", "RMALL"=>"rm -fr"}

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  C:/Users/T/.local/share/gem/ruby/3.3.0/extensions/x64-mingw-ucrt/3.3.0/prism-0.29.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in C:/Users/T/.local/share/gem/ruby/3.3.0/gems/prism-0.29.0 for inspection.
Results logged to C:/Users/T/.local/share/gem/ruby/3.3.0/extensions/x64-mingw-ucrt/3.3.0/prism-0.29.0/gem_make.out

Content of mkmf.log in C:/Users/T/.local/share/gem/ruby/3.3.0/extensions/x64-mingw-ucrt/3.3.0/prism-0.29.0/mkmf.log:

find_header: checking for prism.h in C:/Users/T/.local/share/gem/ruby/3.3.0/gems/prism-0.29.0/include... -------------------- yes

PATH=".;C:/tools/ruby33/lib;C:\tools\ruby33\bin;c:\msys64\ucrt64\bin;c:\msys64\usr\bin;C:\tools\ruby33\bin;C:\Program Files\Eclipse Adoptium\jdk-21.0.2.13-hotspot\bin;C:\Program Files\Eclipse Adoptium\jdk-17.0.10.7-hotspot\bin;C:\Program Files (x86)\jdk/bin;C:\Program Files\Eclipse Adoptium\jre-8.0.382.5-hotspot\bin;C:\Program Files (x86)\Eclipse Adoptium\jre-8.0.382.5-hotspot\bin;C:\Program Files\Eclipse Adoptium\jdk-19.0.2.7-hotspot\bin;C:\Program Files\Eclipse Adoptium\jdk-11.0.20.101-hotspot\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Git\cmd;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\dotnet\;C:\Program Files\Git\usr\bin\;C:\apache-maven-3.9.1\bin;C:\act;C:\Gradle\bin;C:\Program Files\dotnet\;C:\jvms_v2.1.5_386\;C:\Program Files (x86)\Elm\0.19.1\bin;C:\Users\T\AppData\Local\Programs\Python\Python311\Scripts\;C:\Users\T\AppData\Local\Programs\Python\Python311\;C:\Program Files\MySQL\;C:\Users\T\AppData\Roaming\npm;C:\ffmpeg\bin;C:\Program Files\nodejs\;C:\Program Files (x86)\Livestreamer;C:\Program Files\Streamlink\bin;C:\Users\T\Downloads\platform-tools_r34.0.5-windows\platform-tools;;C:\Program Files\Docker\Docker\resources\bin;C:\Program Files\Rancher Desktop\resources\resources\win32\bin\;C:\Program Files\Rancher Desktop\resources\resources\linux\bin\;C:\Program Files\PuTTY\;C:\Users\T\AppData\Roaming\npm;C:\Users\T\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\T\AppData\Local\JetBrains\Toolbox\scripts;C:\Users\T\.dotnet\tools;C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin;C:\Program Files\PostgreSQL\16\pgAdmin 4\runtime;C:\Program Files\PostgreSQL\16\bin;c:\users\t\appdata\local\microsoft\windowsapps;" "gcc -o conftest.exe -IC:/tools/ruby33/include/ruby-3.3.0/x64-mingw-ucrt -IC:/tools/ruby33/include/ruby-3.3.0/ruby/backward -IC:/tools/ruby33/include/ruby-3.3.0 -I. -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -O3 -fno-fast-math -fstack-protector-strong conftest.c  -L. -LC:/tools/ruby33/lib -L. -pipe -s -fstack-protector-strong -Wl,--no-as-needed     -lx64-ucrt-ruby330  -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi -lbcrypt  "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char **argv)
6: {
7:   return !!argv[argc];
8: }
/* end */

PATH=".;C:/tools/ruby33/lib;C:\tools\ruby33\bin;c:\msys64\ucrt64\bin;c:\msys64\usr\bin;C:\tools\ruby33\bin;C:\Program Files\Eclipse Adoptium\jdk-21.0.2.13-hotspot\bin;C:\Program Files\Eclipse Adoptium\jdk-17.0.10.7-hotspot\bin;C:\Program Files (x86)\jdk/bin;C:\Program Files\Eclipse Adoptium\jre-8.0.382.5-hotspot\bin;C:\Program Files (x86)\Eclipse Adoptium\jre-8.0.382.5-hotspot\bin;C:\Program Files\Eclipse Adoptium\jdk-19.0.2.7-hotspot\bin;C:\Program Files\Eclipse Adoptium\jdk-11.0.20.101-hotspot\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Git\cmd;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\dotnet\;C:\Program Files\Git\usr\bin\;C:\apache-maven-3.9.1\bin;C:\act;C:\Gradle\bin;C:\Program Files\dotnet\;C:\jvms_v2.1.5_386\;C:\Program Files (x86)\Elm\0.19.1\bin;C:\Users\T\AppData\Local\Programs\Python\Python311\Scripts\;C:\Users\T\AppData\Local\Programs\Python\Python311\;C:\Program Files\MySQL\;C:\Users\T\AppData\Roaming\npm;C:\ffmpeg\bin;C:\Program Files\nodejs\;C:\Program Files (x86)\Livestreamer;C:\Program Files\Streamlink\bin;C:\Users\T\Downloads\platform-tools_r34.0.5-windows\platform-tools;;C:\Program Files\Docker\Docker\resources\bin;C:\Program Files\Rancher Desktop\resources\resources\win32\bin\;C:\Program Files\Rancher Desktop\resources\resources\linux\bin\;C:\Program Files\PuTTY\;C:\Users\T\AppData\Roaming\npm;C:\Users\T\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\T\AppData\Local\JetBrains\Toolbox\scripts;C:\Users\T\.dotnet\tools;C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin;C:\Program Files\PostgreSQL\16\pgAdmin 4\runtime;C:\Program Files\PostgreSQL\16\bin;c:\users\t\appdata\local\microsoft\windowsapps;" "gcc -IC:/tools/ruby33/include/ruby-3.3.0/x64-mingw-ucrt -IC:/tools/ruby33/include/ruby-3.3.0/ruby/backward -IC:/tools/ruby33/include/ruby-3.3.0 -I. -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -O3 -fno-fast-math -fstack-protector-strong   -c conftest.c"
conftest.c:5:10: fatal error: prism.h: No such file or directory
    5 | #include <prism.h>
      |          ^~~~~~~~~
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <prism.h>
/* end */

PATH=".;C:/tools/ruby33/lib;C:\tools\ruby33\bin;c:\msys64\ucrt64\bin;c:\msys64\usr\bin;C:\tools\ruby33\bin;C:\Program Files\Eclipse Adoptium\jdk-21.0.2.13-hotspot\bin;C:\Program Files\Eclipse Adoptium\jdk-17.0.10.7-hotspot\bin;C:\Program Files (x86)\jdk/bin;C:\Program Files\Eclipse Adoptium\jre-8.0.382.5-hotspot\bin;C:\Program Files (x86)\Eclipse Adoptium\jre-8.0.382.5-hotspot\bin;C:\Program Files\Eclipse Adoptium\jdk-19.0.2.7-hotspot\bin;C:\Program Files\Eclipse Adoptium\jdk-11.0.20.101-hotspot\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Git\cmd;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\dotnet\;C:\Program Files\Git\usr\bin\;C:\apache-maven-3.9.1\bin;C:\act;C:\Gradle\bin;C:\Program Files\dotnet\;C:\jvms_v2.1.5_386\;C:\Program Files (x86)\Elm\0.19.1\bin;C:\Users\T\AppData\Local\Programs\Python\Python311\Scripts\;C:\Users\T\AppData\Local\Programs\Python\Python311\;C:\Program Files\MySQL\;C:\Users\T\AppData\Roaming\npm;C:\ffmpeg\bin;C:\Program Files\nodejs\;C:\Program Files (x86)\Livestreamer;C:\Program Files\Streamlink\bin;C:\Users\T\Downloads\platform-tools_r34.0.5-windows\platform-tools;;C:\Program Files\Docker\Docker\resources\bin;C:\Program Files\Rancher Desktop\resources\resources\win32\bin\;C:\Program Files\Rancher Desktop\resources\resources\linux\bin\;C:\Program Files\PuTTY\;C:\Users\T\AppData\Roaming\npm;C:\Users\T\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\T\AppData\Local\JetBrains\Toolbox\scripts;C:\Users\T\.dotnet\tools;C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin;C:\Program Files\PostgreSQL\16\pgAdmin 4\runtime;C:\Program Files\PostgreSQL\16\bin;c:\users\t\appdata\local\microsoft\windowsapps;" "gcc -IC:/tools/ruby33/include/ruby-3.3.0/x64-mingw-ucrt -IC:/tools/ruby33/include/ruby-3.3.0/ruby/backward -IC:/tools/ruby33/include/ruby-3.3.0 -I. -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -O3 -fno-fast-math -fstack-protector-strong  -IC:/Users/T/.local/share/gem/ruby/3.3.0/gems/prism-0.29.0/include -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <prism.h>
/* end */

--------------------

find_header: checking for prism/extension.h in C:/Users/T/.local/share/gem/ruby/3.3.0/gems/prism-0.29.0/ext... -------------------- yes

PATH=".;C:/tools/ruby33/lib;C:\tools\ruby33\bin;c:\msys64\ucrt64\bin;c:\msys64\usr\bin;C:\tools\ruby33\bin;C:\Program Files\Eclipse Adoptium\jdk-21.0.2.13-hotspot\bin;C:\Program Files\Eclipse Adoptium\jdk-17.0.10.7-hotspot\bin;C:\Program Files (x86)\jdk/bin;C:\Program Files\Eclipse Adoptium\jre-8.0.382.5-hotspot\bin;C:\Program Files (x86)\Eclipse Adoptium\jre-8.0.382.5-hotspot\bin;C:\Program Files\Eclipse Adoptium\jdk-19.0.2.7-hotspot\bin;C:\Program Files\Eclipse Adoptium\jdk-11.0.20.101-hotspot\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Git\cmd;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\dotnet\;C:\Program Files\Git\usr\bin\;C:\apache-maven-3.9.1\bin;C:\act;C:\Gradle\bin;C:\Program Files\dotnet\;C:\jvms_v2.1.5_386\;C:\Program Files (x86)\Elm\0.19.1\bin;C:\Users\T\AppData\Local\Programs\Python\Python311\Scripts\;C:\Users\T\AppData\Local\Programs\Python\Python311\;C:\Program Files\MySQL\;C:\Users\T\AppData\Roaming\npm;C:\ffmpeg\bin;C:\Program Files\nodejs\;C:\Program Files (x86)\Livestreamer;C:\Program Files\Streamlink\bin;C:\Users\T\Downloads\platform-tools_r34.0.5-windows\platform-tools;;C:\Program Files\Docker\Docker\resources\bin;C:\Program Files\Rancher Desktop\resources\resources\win32\bin\;C:\Program Files\Rancher Desktop\resources\resources\linux\bin\;C:\Program Files\PuTTY\;C:\Users\T\AppData\Roaming\npm;C:\Users\T\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\T\AppData\Local\JetBrains\Toolbox\scripts;C:\Users\T\.dotnet\tools;C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin;C:\Program Files\PostgreSQL\16\pgAdmin 4\runtime;C:\Program Files\PostgreSQL\16\bin;c:\users\t\appdata\local\microsoft\windowsapps;" "gcc -IC:/tools/ruby33/include/ruby-3.3.0/x64-mingw-ucrt -IC:/tools/ruby33/include/ruby-3.3.0/ruby/backward -IC:/tools/ruby33/include/ruby-3.3.0 -I. -IC:/Users/T/.local/share/gem/ruby/3.3.0/gems/prism-0.29.0/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -O3 -fno-fast-math -fstack-protector-strong   -c conftest.c"
conftest.c:5:10: fatal error: prism/extension.h: No such file or directory
    5 | #include <prism/extension.h>
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <prism/extension.h>
/* end */

PATH=".;C:/tools/ruby33/lib;C:\tools\ruby33\bin;c:\msys64\ucrt64\bin;c:\msys64\usr\bin;C:\tools\ruby33\bin;C:\Program Files\Eclipse Adoptium\jdk-21.0.2.13-hotspot\bin;C:\Program Files\Eclipse Adoptium\jdk-17.0.10.7-hotspot\bin;C:\Program Files (x86)\jdk/bin;C:\Program Files\Eclipse Adoptium\jre-8.0.382.5-hotspot\bin;C:\Program Files (x86)\Eclipse Adoptium\jre-8.0.382.5-hotspot\bin;C:\Program Files\Eclipse Adoptium\jdk-19.0.2.7-hotspot\bin;C:\Program Files\Eclipse Adoptium\jdk-11.0.20.101-hotspot\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Git\cmd;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\dotnet\;C:\Program Files\Git\usr\bin\;C:\apache-maven-3.9.1\bin;C:\act;C:\Gradle\bin;C:\Program Files\dotnet\;C:\jvms_v2.1.5_386\;C:\Program Files (x86)\Elm\0.19.1\bin;C:\Users\T\AppData\Local\Programs\Python\Python311\Scripts\;C:\Users\T\AppData\Local\Programs\Python\Python311\;C:\Program Files\MySQL\;C:\Users\T\AppData\Roaming\npm;C:\ffmpeg\bin;C:\Program Files\nodejs\;C:\Program Files (x86)\Livestreamer;C:\Program Files\Streamlink\bin;C:\Users\T\Downloads\platform-tools_r34.0.5-windows\platform-tools;;C:\Program Files\Docker\Docker\resources\bin;C:\Program Files\Rancher Desktop\resources\resources\win32\bin\;C:\Program Files\Rancher Desktop\resources\resources\linux\bin\;C:\Program Files\PuTTY\;C:\Users\T\AppData\Roaming\npm;C:\Users\T\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\T\AppData\Local\JetBrains\Toolbox\scripts;C:\Users\T\.dotnet\tools;C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin;C:\Program Files\PostgreSQL\16\pgAdmin 4\runtime;C:\Program Files\PostgreSQL\16\bin;c:\users\t\appdata\local\microsoft\windowsapps;" "gcc -IC:/tools/ruby33/include/ruby-3.3.0/x64-mingw-ucrt -IC:/tools/ruby33/include/ruby-3.3.0/ruby/backward -IC:/tools/ruby33/include/ruby-3.3.0 -I. -IC:/Users/T/.local/share/gem/ruby/3.3.0/gems/prism-0.29.0/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -O3 -fno-fast-math -fstack-protector-strong  -IC:/Users/T/.local/share/gem/ruby/3.3.0/gems/prism-0.29.0/ext -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <prism/extension.h>
/* end */

--------------------

append_cflags: checking for whether -fvisibility=hidden is accepted as CFLAGS... -------------------- yes

PATH=".;C:/tools/ruby33/lib;C:\tools\ruby33\bin;c:\msys64\ucrt64\bin;c:\msys64\usr\bin;C:\tools\ruby33\bin;C:\Program Files\Eclipse Adoptium\jdk-21.0.2.13-hotspot\bin;C:\Program Files\Eclipse Adoptium\jdk-17.0.10.7-hotspot\bin;C:\Program Files (x86)\jdk/bin;C:\Program Files\Eclipse Adoptium\jre-8.0.382.5-hotspot\bin;C:\Program Files (x86)\Eclipse Adoptium\jre-8.0.382.5-hotspot\bin;C:\Program Files\Eclipse Adoptium\jdk-19.0.2.7-hotspot\bin;C:\Program Files\Eclipse Adoptium\jdk-11.0.20.101-hotspot\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Git\cmd;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\dotnet\;C:\Program Files\Git\usr\bin\;C:\apache-maven-3.9.1\bin;C:\act;C:\Gradle\bin;C:\Program Files\dotnet\;C:\jvms_v2.1.5_386\;C:\Program Files (x86)\Elm\0.19.1\bin;C:\Users\T\AppData\Local\Programs\Python\Python311\Scripts\;C:\Users\T\AppData\Local\Programs\Python\Python311\;C:\Program Files\MySQL\;C:\Users\T\AppData\Roaming\npm;C:\ffmpeg\bin;C:\Program Files\nodejs\;C:\Program Files (x86)\Livestreamer;C:\Program Files\Streamlink\bin;C:\Users\T\Downloads\platform-tools_r34.0.5-windows\platform-tools;;C:\Program Files\Docker\Docker\resources\bin;C:\Program Files\Rancher Desktop\resources\resources\win32\bin\;C:\Program Files\Rancher Desktop\resources\resources\linux\bin\;C:\Program Files\PuTTY\;C:\Users\T\AppData\Roaming\npm;C:\Users\T\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\T\AppData\Local\JetBrains\Toolbox\scripts;C:\Users\T\.dotnet\tools;C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin;C:\Program Files\PostgreSQL\16\pgAdmin 4\runtime;C:\Program Files\PostgreSQL\16\bin;c:\users\t\appdata\local\microsoft\windowsapps;" "gcc -IC:/tools/ruby33/include/ruby-3.3.0/x64-mingw-ucrt -IC:/tools/ruby33/include/ruby-3.3.0/ruby/backward -IC:/tools/ruby33/include/ruby-3.3.0 -I. -IC:/Users/T/.local/share/gem/ruby/3.3.0/gems/prism-0.29.0/include -IC:/Users/T/.local/share/gem/ruby/3.3.0/gems/prism-0.29.0/ext -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -O3 -fno-fast-math -fstack-protector-strong  -fvisibility=hidden -Werror -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char **argv)
6: {
7:   return !!argv[argc];
8: }
/* end */

--------------------

@kddnewton
Copy link
Collaborator

Interesting — it looks like your C compiler isn't happy with the enum being used as the index of the array. I'm really not sure why. This looks fixable though.

@kddnewton
Copy link
Collaborator

I need to know the version of your compiler. I'm not entirely sure how to retrieve it on windows (my windows knowledge is very little...). I can see it's MinGW, but I can't tell the version. Maybe gcc --version will do it?

@Tofpu
Copy link
Author

Tofpu commented May 15, 2024

Alright, after a couple of attempts I found it. Had to launch UCRT64 and type gcc -v:

$ gcc -v
Using built-in specs.
COLLECT_GCC=C:\msys64\ucrt64\bin\gcc.exe
COLLECT_LTO_WRAPPER=C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-12.2.0/configure --prefix=/ucrt64 --with-local-prefix=/ucrt64/local --build=
x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --with-native-system-header
-dir=/ucrt64/include --libexecdir=/ucrt64/lib --enable-bootstrap --enable-checking=release --with-ar
ch=x86-64 --with-tune=generic --enable-languages=c,lto,c++,fortran,ada,objc,obj-c++,jit --enable-sha
red --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynam
ic-string --enable-libstdcxx-filesystem-ts --enable-libstdcxx-time --disable-libstdcxx-pch --enable-
lto --enable-libgomp --disable-multilib --disable-rpath --disable-win32-registry --disable-nls --dis
able-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/ucrt64 --with-mpfr=/ucr
t64 --with-mpc=/ucrt64 --with-isl=/ucrt64 --with-pkgversion='Rev4, Built by MSYS2 project' --with-bu
gurl=https://github.com/msys2/MINGW-packages/issues --with-gnu-as --with-gnu-ld --disable-libstdcxx-
debug --with-boot-ldflags=-static-libstdc++ --with-stage1-ldflags=-static-libstdc++
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.0 (Rev4, Built by MSYS2 project)

@nirvdrum
Copy link
Contributor

nirvdrum commented May 15, 2024

@Tofpu I've tried to reproduce this and found the gem installed fine for me. I am on Windows 11 rather than 10, but I don't think that's the issue. You're running an older version of msys. Is this required? I can't say for certain that there's a GCC bug that's been addressed in newer releases, but the gem cleanly installed for me with GCC 13.2. That's the version that was installed by RubyInstaller for both Ruby 3.3.0 and 3.3.1 for me.

PS C:\Ruby33-x64\msys64> ridk version
---
ruby:
  path: C:/Ruby33-x64
  version: 3.3.1
  platform: x64-mingw-ucrt
ruby_installer:
  package_version: 3.3.1-1
  git_commit: 88d8c1f
msys2:
  path: C:\Ruby33-x64\msys64
cc: gcc (Rev6, Built by MSYS2 project) 13.2.0
sh: GNU bash, version 5.2.26(1)-release (x86_64-pc-msys)
os: Microsoft Windows [Version 10.0.22631.3296]
# gcc -v
Using built-in specs.
COLLECT_GCC=C:\Ruby33-x64\msys64\ucrt64\bin\gcc.exe
COLLECT_LTO_WRAPPER=C:/Ruby33-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-13.2.0/configure --prefix=/ucrt64 --with-local-prefix=/ucrt64/local --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --with-native-system-header-dir=/ucrt64/include --libexecdir=/ucrt64/lib --enable-bootstrap --enable-checking=release --with-arch=nocona --with-tune=generic --enable-languages=c,lto,c++,fortran,ada,objc,obj-c++,jit --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-filesystem-ts --enable-libstdcxx-time --disable-libstdcxx-pch --enable-lto --enable-libgomp --disable-libssp --disable-multilib --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/ucrt64 --with-mpfr=/ucrt64 --with-mpc=/ucrt64 --with-isl=/ucrt64 --with-pkgversion='Rev6, Built by MSYS2 project' --with-bugurl=https://github.com/msys2/MINGW-packages/issues --with-gnu-as --with-gnu-ld --disable-libstdcxx-debug --enable-plugin --with-boot-ldflags=-static-libstdc++ --with-stage1-ldflags=-static-libstdc++
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.2.0 (Rev6, Built by MSYS2 project)

I'd be curious to see if the problem goes away for you with a newer msys installation.

@Tofpu
Copy link
Author

Tofpu commented May 15, 2024

Okay, I reinstalled everything with RubyInstaller (which is my first time, the previous installation was from another indirect source I suppose) and tried installing prism and it worked. Thank you guys for the quick assistance!

@kddnewton
Copy link
Collaborator

Okay! As long as the issue is resolved. I think there still might be a MSYS GCC-12 -specific issue, but I'm fine closing for now.

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

No branches or pull requests

3 participants