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

Windows mswin build - failing #41

Open
MSP-Greg opened this issue Feb 13, 2020 · 2 comments · May be fixed by #43
Open

Windows mswin build - failing #41

MSP-Greg opened this issue Feb 13, 2020 · 2 comments · May be fixed by #43

Comments

@MSP-Greg
Copy link
Contributor

Although most people using Ruby on Windows use MSYS2/MinGW builds, ruby/ruby has been testing on mswin (msvc) builds for quite a while. The build does pass all tests, so all the extension stdlib/default gems included with Ruby compile.

While trying to compile Puma with it, Puma uses RuboCop in CI, and it wouldn't compile jaro_winkler when running bundle install. Below is the log. I ran this locally, so happy to test anything. Using VS 2019. FYI, Puma compiled on mswin with OpenSSL.

mkdir -p tmp/x64-mswin64_140/jaro_winkler_ext/2.8.0
cd tmp/x64-mswin64_140/jaro_winkler_ext/2.8.0
C:/Greg/Ruby99-x64m/bin/ruby.exe -I. ../../../../ext/jaro_winkler/extconf.rb
creating Makefile
cd -
cd tmp/x64-mswin64_140/jaro_winkler_ext/2.8.0
nmake

Microsoft (R) Program Maintenance Utility Version 14.24.28314.0
Copyright (C) Microsoft Corporation.  All rights reserved.

generating jaro_winkler_ext-x64-mswin64_140.def
compiling ../../../../ext/jaro_winkler/adj_matrix.c
cl : Command line warning D9002 : ignoring unknown option '-std=c99'
adj_matrix.c
compiling ../../../../ext/jaro_winkler/codepoints.c
cl : Command line warning D9002 : ignoring unknown option '-std=c99'
codepoints.c
compiling ../../../../ext/jaro_winkler/jaro.c
cl : Command line warning D9002 : ignoring unknown option '-std=c99'
jaro.c
../../../../ext/jaro_winkler/jaro.c(30): error C2146: syntax error: missing ';' before identifier 'SWAP'
../../../../ext/jaro_winkler/jaro.c(30): error C2065: 'SWAP': undeclared identifier
../../../../ext/jaro_winkler/jaro.c(30): error C4047: '=': 'int' differs in levels of indirection from 'uint32_t *'
../../../../ext/jaro_winkler/jaro.c(30): error C4047: '=': 'uint32_t *' differs in levels of indirection from 'int'
../../../../ext/jaro_winkler/jaro.c(31): error C2146: syntax error: missing ';' before identifier 'SWAP'
../../../../ext/jaro_winkler/jaro.c(31): error C2065: 'SWAP': undeclared identifier
../../../../ext/jaro_winkler/jaro.c(45): error C2057: expected constant expression
../../../../ext/jaro_winkler/jaro.c(45): error C2466: cannot allocate an array of constant size 0
../../../../ext/jaro_winkler/jaro.c(45): error C2133: 'short_codes_flag': unknown size
../../../../ext/jaro_winkler/jaro.c(46): error C2057: expected constant expression
../../../../ext/jaro_winkler/jaro.c(46): error C2466: cannot allocate an array of constant size 0
../../../../ext/jaro_winkler/jaro.c(46): error C2133: 'long_codes_flag': unknown size
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.24.28314\bin\HostX64\x64\cl.EXE"' : return code '0x2'
Stop.
rake aborted!
Command failed with status (2): [nmake...]

Note: Puma has been running CI against Ruby Windows MSYS2/MinGW builds for quite while with no problem (compiling jaro_winkler or Puma). MSYS2 is using gcc 9.2.0.

@MSP-Greg
Copy link
Contributor Author

MSP-Greg commented Mar 1, 2020

I didn't mention that I'm not really a c type, so I'm not comfortable trying to fix this on the c side.

I could submit a PR forcing mswin platform to run in 'pure ruby' mode?

@jmarrec
Copy link

jmarrec commented Mar 25, 2020

I implemented a fix in #43 (and found this issue afterwards)

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

Successfully merging a pull request may close this issue.

2 participants