arthurnn / memcached

A Ruby interface to the libmemcached C client
Academic Free License v3.0
432 stars 125 forks source link

Fix gem install portability by avoiding a shell feature dependency #190

Closed dylanahsmith closed 3 years ago

dylanahsmith commented 3 years ago

Problem

@casperisfine I tried adding bundle exec rake install to CI as you suggested in https://github.com/arthurnn/memcached/pull/186#discussion_r608105670 and it failed. I was able to reproduce the error in on ubuntu and found the source of the problem was the {lib,ext,vendor} shell glob expansion, which didn't work in the shell spawned by ruby.

E.g. in macOS I get

irb(main):001:0> `echo {lib,ext,vendor}`
=> "lib ext vendor\n"

but on Ubuntu I get

irb(main):001:0> `echo {lib,ext,vendor}`
=> "{lib,ext,vendor}\n"

Solution

The gemspec file generated by bundle gem avoids this problem by doing file filtering using ruby, so it doesn't depend on what shell features are available.