jaro_winkler icon indicating copy to clipboard operation
jaro_winkler copied to clipboard

Installation fails on Windows with Github Actions

Open mockdeep opened this issue 4 years ago • 7 comments

I'm trying to install this gem in our Github Action using the windows-latest OS. Unfortunately, I'm getting the error below. I've seen it succeed in some cases, though, so it doesn't seem to be failing consistently.

2020-02-02T22:11:09.1926394Z Installing jaro_winkler 1.5.4 with native extensions
2020-02-02T22:11:18.9463022Z Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
2020-02-02T22:11:18.9463372Z 
2020-02-02T22:11:18.9463581Z current directory:
2020-02-02T22:11:18.9464745Z D:/a/rmagick/rmagick/vendor/bundle/ruby/2.3.0/gems/jaro_winkler-1.5.4/ext/jaro_winkler
2020-02-02T22:11:18.9465020Z D:/ruby-2.3.3-x64-mingw32/bin/ruby.exe -r ./siteconf20200202-3124-1uu8ajq.rb
2020-02-02T22:11:18.9465185Z extconf.rb
2020-02-02T22:11:18.9465340Z creating Makefile
2020-02-02T22:11:18.9465451Z 
2020-02-02T22:11:18.9465601Z current directory:
2020-02-02T22:11:18.9465766Z D:/a/rmagick/rmagick/vendor/bundle/ruby/2.3.0/gems/jaro_winkler-1.5.4/ext/jaro_winkler
2020-02-02T22:11:18.9465907Z make "DESTDIR=" clean
2020-02-02T22:11:18.9466037Z 
2020-02-02T22:11:18.9466189Z current directory:
2020-02-02T22:11:18.9466635Z D:/a/rmagick/rmagick/vendor/bundle/ruby/2.3.0/gems/jaro_winkler-1.5.4/ext/jaro_winkler
2020-02-02T22:11:18.9466793Z make "DESTDIR="
2020-02-02T22:11:18.9466953Z generating jaro_winkler_ext-x64-mingw32.def
2020-02-02T22:11:18.9467108Z compiling adj_matrix.c
2020-02-02T22:11:18.9467263Z adj_matrix.c: In function 'adj_matrix_default':
2020-02-02T22:11:18.9467410Z adj_matrix.c:87:5: warning: ISO C90 forbids mixed declarations and code
2020-02-02T22:11:18.9467574Z [-Wdeclaration-after-statement]
2020-02-02T22:11:18.9467734Z      size_t length = sizeof(DEFAULT_ADJ_TABLE) / sizeof(char *);
2020-02-02T22:11:18.9467894Z      ^~~~~~
2020-02-02T22:11:18.9468025Z compiling codepoints.c
2020-02-02T22:11:18.9468180Z compiling jaro.c
2020-02-02T22:11:18.9468337Z jaro.c: In function 'jaro_distance_from_codes':
2020-02-02T22:11:18.9468500Z jaro.c:41:3: warning: ISO C90 forbids mixed declarations and code
2020-02-02T22:11:18.9468658Z [-Wdeclaration-after-statement]
2020-02-02T22:11:18.9468798Z    int32_t window_size = (int32_t)len2 / 2 - 1;
2020-02-02T22:11:18.9468953Z    ^~~~~~~
2020-02-02T22:11:18.9469109Z jaro.c:45:3: warning: ISO C90 forbids mixed declarations and code
2020-02-02T22:11:18.9469263Z [-Wdeclaration-after-statement]
2020-02-02T22:11:18.9469438Z    char short_codes_flag[len1];
2020-02-02T22:11:18.9469605Z    ^~~~
2020-02-02T22:11:18.9469770Z jaro.c:51:3: warning: ISO C90 forbids mixed declarations and code
2020-02-02T22:11:18.9469908Z [-Wdeclaration-after-statement]
2020-02-02T22:11:18.9470062Z    size_t match_count = 0;
2020-02-02T22:11:18.9470215Z    ^~~~~~
2020-02-02T22:11:18.9470370Z jaro.c:71:3: warning: ISO C90 forbids mixed declarations and code
2020-02-02T22:11:18.9470542Z [-Wdeclaration-after-statement]
2020-02-02T22:11:18.9470678Z    size_t transposition_count = 0, j = 0, k = 0;
2020-02-02T22:11:18.9470834Z    ^~~~~~
2020-02-02T22:11:18.9470995Z jaro.c:86:3: warning: ISO C90 forbids mixed declarations and code
2020-02-02T22:11:18.9471155Z [-Wdeclaration-after-statement]
2020-02-02T22:11:18.9471310Z    size_t similar_count = 0;
2020-02-02T22:11:18.9471440Z    ^~~~~~
2020-02-02T22:11:18.9471597Z jaro.c:98:3: warning: ISO C90 forbids mixed declarations and code
2020-02-02T22:11:18.9471756Z [-Wdeclaration-after-statement]
2020-02-02T22:11:18.9471909Z    double m = (double)match_count;
2020-02-02T22:11:18.9472042Z    ^~~~~~
2020-02-02T22:11:18.9472193Z during RTL pass: final
2020-02-02T22:11:18.9472379Z jaro.c:103:1: internal compiler error: in based_loc_descr, at dwarf2out.c:14318
2020-02-02T22:11:18.9472541Z  }
2020-02-02T22:11:18.9472688Z  ^
2020-02-02T22:11:18.9472819Z libbacktrace could not find executable to open
2020-02-02T22:11:18.9472975Z Please submit a full bug report,
2020-02-02T22:11:18.9473133Z with preprocessed source if appropriate.
2020-02-02T22:11:18.9473335Z See <https://sourceforge.net/projects/msys2> for instructions.
2020-02-02T22:11:18.9473510Z make: *** [Makefile:239: jaro.o] Error 1
2020-02-02T22:11:18.9473622Z 
2020-02-02T22:11:18.9473771Z make failed, exit code 2

mockdeep avatar Feb 02 '20 22:02 mockdeep

Having a similar? issue on Windows 10. Note that this is only for v 1.5.4, I am able to successfully install v 1.5.3.

Fetching jaro_winkler 1.5.4
Installing jaro_winkler 1.5.4 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jaro_winkler-1.5.4/ext/jaro_winkler
C:/Ruby26-x64/bin/ruby.exe -I C:/Ruby26-x64/lib/ruby/2.6.0 -r
./siteconf20200202-23604-2wsc9q.rb extconf.rb
creating Makefile

current directory:
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jaro_winkler-1.5.4/ext/jaro_winkler
make "DESTDIR=" clean

current directory:
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jaro_winkler-1.5.4/ext/jaro_winkler
make "DESTDIR="
generating jaro_winkler_ext-x64-mingw32.def
compiling adj_matrix.c
compiling codepoints.c
compiling jaro.c
compiling jaro_winkler.c
linking shared-object jaro_winkler/jaro_winkler_ext.so

current directory:
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jaro_winkler-1.5.4/ext/jaro_winkler
make "DESTDIR=" install
/usr/bin/install -c -m 0755 jaro_winkler_ext.so
./.gem.20200202-23604-14dbh3e/jaro_winkler

Permission denied @ apply2files -
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jaro_winkler-1.5.4/lib/jaro_winkler/jaro_winkler_ext.so

Gem files will remain installed in
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jaro_winkler-1.5.4 for inspection.
Results logged to
C:/Ruby26-x64/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/jaro_winkler-1.5.4/gem_make.out

An error occurred while installing jaro_winkler (1.5.4), and Bundler cannot
continue.
Make sure that `gem install jaro_winkler -v '1.5.4' --source
'https://rubygems.org/'` succeeds before bundling.

tyjet avatar Feb 03 '20 02:02 tyjet

@mockdeep @tyjet

Puma uses RuboCop in its CI, which uses jaro_winkler. You might have a look at a workflow I just did a PR for there, which has the most recent actions that are best used with Ruby:

https://github.com/puma/puma/pull/2114

MSP-Greg avatar Feb 13 '20 01:02 MSP-Greg

Thanks for the recommendation @MSP-Greg. For now we disabled installation of rubocop in windows. Do you know what exactly you did to get it installing correctly?

mockdeep avatar Feb 13 '20 04:02 mockdeep

@mockdeep

Well, you said 'we', so I looked to see who we might be. Is this for RMagick? I'll get there, probably tomorrow.

Do you know what exactly you did to get it installing correctly?

Simply put, connected 'devkit'.

What I think you need to do there is install Ruby with the following step:

- name: setup Ruby, gcc, install MSYS2 imagemagick
  uses: MSP-Greg/actions-ruby@v1
  with:
    base:  update
    mingw: imagemagick
    ruby-version: ${{ matrix.ruby }}

Until it's working, start with Ruby >= 2.4

MSP-Greg avatar Feb 13 '20 05:02 MSP-Greg

@MSP-Greg Yeah, on RMagick. If you're game to get it working for us, it would be much appreciated. Otherwise, I'll try poking around in the near future. I think we had devkit when it was on TravisCI, but for some reason it didn't work for us when transitioning to Github Actions.

mockdeep avatar Feb 13 '20 06:02 mockdeep

@mockdeep

Re Actions, depending on how one loads Rubies, devkit may need to be required, and PATH may need to be cleaned up...

See https://github.com/rmagick/rmagick/pull/1042.

quoting from that PR:

  1. At present, the MSYS2 installation(s) on Actions are 'messy'. When using the latest Rubies, the gcc tools need to be updated due to a breaking change in gcc (addition of ssp). The MSYS2 installation(s) on Actions may change, but GitHub/MSFT is taking their sweet time deciding what to do...

MSP-Greg avatar Feb 13 '20 17:02 MSP-Greg

@mockdeep

Summing up re Actions, Windows, and extension gems:

  1. One must 'activate' MSYS2 some way or another, whether with a Ruby/Windows specific action, or in one's workflow steps.

  2. At present, Actions has an embedded MYS2 install in all three of its installed Ruby builds, The issue is that these installs need updating, and that can be tricky, especially if one is using a Ruby that isn't one of the current releases, ie. 2.5.7, 2.6.5, or 2.7.0. The MSYS2 issue should have been dealt with in the Actions beta, but...

I think that sums it up. Fell free to close unless you feel this is a jaro_winkler issue. I hate seeing "can't <Ruby problem> on Windows" issues...

MSP-Greg avatar Feb 15 '20 17:02 MSP-Greg