prometheus-client-mmap-0.7.0.beta36 gem does not compile on CentOS 6 and Raspberry Pi
Caused by https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/15558
On CentOS 6
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/prometheus-client-mmap-0.7.0.beta36/ext/fast_mmaped_file
/opt/gitlab/embedded/bin/ruby -r ./siteconf20171124-21560-13r47qw.rb extconf.rb
creating Makefile
current directory:
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/prometheus-client-mmap-0.7.0.beta36/ext/fast_mmaped_file
make "DESTDIR=" clean
current directory:
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/prometheus-client-mmap-0.7.0.beta36/ext/fast_mmaped_file
make "DESTDIR="
compiling fast_mmaped_file.c
cc1: error: unrecognized command line option "-std=c11"
make: *** [fast_mmaped_file.o] Error 1
make failed, exit code 2
Gem files will remain installed in
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/prometheus-client-mmap-0.7.0.beta36
for inspection.
Results logged to
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/extensions/x86_64-linux/2.3.0/prometheus-client-mmap-0.7.0.beta36/gem_make.out
An error occurred while installing prometheus-client-mmap (0.7.0.beta36), and
Bundler cannot continue.
Make sure that `gem install prometheus-client-mmap -v '0.7.0.beta36'` succeeds
before bundling.
Failed build https://dev.gitlab.org/gitlab/omnibus-gitlab/-/jobs/1733228
On the PI:
fast_mmaped_file.c: In function ‘open_and_extend_file’:
fast_mmaped_file.c:24:9: error: format ‘%lu’ expects argument of type ‘long
unsigned int’, but argument 3 has type ‘size_t’ [-Werror=format=]
rb_raise(rb_eIOError, "Can't lseek %lu", len - i_mm->t->len - 1);
^
fast_mmaped_file.c: In function ‘method_add_entry’:
fast_mmaped_file.c:136:26: error: comparison between signed and unsigned integer
expressions [-Werror=sign-compare]
if (RSTRING_LEN(key) > UINT32_MAX) {
^
fast_mmaped_file.c: In function ‘method_get_double’:
fast_mmaped_file.c:162:9: error: format ‘%ld’ expects argument of type ‘long
int’, but argument 3 has type ‘size_t’ [-Werror=format=]
rb_raise(rb_eIndexError, "index %ld out of string", idx);
^
cc1: all warnings being treated as errors
Makefile:238: recipe for target 'fast_mmaped_file.o' failed
make: *** [fast_mmaped_file.o] Error 1
Failing Build: https://dev.gitlab.org/gitlab/omnibus-gitlab/-/jobs/1733898
/cc @joshlambert @pchojnacki @stanhu @DouweM
Edited by DJ Mountney