Shopify / liquid-c

Liquid performance extension in C.
MIT License
120 stars 25 forks source link

Support for ruby 2.7.4p191 [x86_64-darwin21] #164

Open iain opened 3 years ago

iain commented 3 years ago

I'm having trouble installing liquid-c on Ruby 2.7.4 on macOS Monterey.

It installs correctly on Ruby 3.0.2 on the same machine.

I've tried switching to using the main branch on github as a source in bundler and that works too.

I have completely reinstalled xcode, homebrew and ruby (via asdf), hoping that would help, but to no avail.

Some output from gem env:

RubyGems Environment:
  - RUBYGEMS VERSION: 3.2.29
  - RUBY VERSION: 2.7.4 (2021-07-07 patchlevel 191) [x86_64-darwin21]
  - INSTALLATION DIRECTORY: /Users/iain/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0
  - USER INSTALLATION DIRECTORY: /Users/iain/.gem/ruby/2.7.0
  - RUBY EXECUTABLE: /Users/iain/.asdf/installs/ruby/2.7.4/bin/ruby
  - GIT EXECUTABLE: /usr/local/bin/git
  - EXECUTABLE DIRECTORY: /Users/iain/.asdf/installs/ruby/2.7.4/bin
  - SPEC CACHE DIRECTORY: /Users/iain/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /Users/iain/.asdf/installs/ruby/2.7.4/etc
  - RUBYGEMS PLATFORMS:
     - ruby
     - x86_64-darwin-21

Below is the full output of gem install liquid-c:

Building native extensions. This could take a while...
ERROR:  Error installing liquid-c:
    ERROR: Failed to build gem native extension.

    current directory: /Users/iain/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/liquid-c-4.0.0/ext/liquid_c
/Users/iain/.asdf/installs/ruby/2.7.4/bin/ruby -I /Users/iain/.asdf/installs/ruby/2.7.4/lib/ruby/site_ruby/2.7.0 -r ./siteconf20211027-38778-123e3iq.rb extconf.rb
creating Makefile

current directory: /Users/iain/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/liquid-c-4.0.0/ext/liquid_c
make DESTDIR\= clean

current directory: /Users/iain/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/liquid-c-4.0.0/ext/liquid_c
make DESTDIR\=
compiling block.c
block.c:128:48: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    intern_raise_missing_variable_terminator = rb_intern("raise_missing_variable_terminator");
                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                      ^
block.c:128:48: note: '{' token is here
    intern_raise_missing_variable_terminator = rb_intern("raise_missing_variable_terminator");
                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^
block.c:128:48: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    intern_raise_missing_variable_terminator = rb_intern("raise_missing_variable_terminator");
                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    }
    ^
block.c:128:48: note: ')' token is here
    intern_raise_missing_variable_terminator = rb_intern("raise_missing_variable_terminator");
                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                                                       ^
block.c:129:43: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    intern_raise_missing_tag_terminator = rb_intern("raise_missing_tag_terminator");
                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                      ^
block.c:129:43: note: '{' token is here
    intern_raise_missing_tag_terminator = rb_intern("raise_missing_tag_terminator");
                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^
block.c:129:43: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    intern_raise_missing_tag_terminator = rb_intern("raise_missing_tag_terminator");
                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    }
    ^
block.c:129:43: note: ')' token is here
    intern_raise_missing_tag_terminator = rb_intern("raise_missing_tag_terminator");
                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                                                       ^
block.c:130:23: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    intern_nodelist = rb_intern("@nodelist");
                      ^~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                      ^
block.c:130:23: note: '{' token is here
    intern_nodelist = rb_intern("@nodelist");
                      ^~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^
block.c:130:23: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    intern_nodelist = rb_intern("@nodelist");
                      ^~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    }
    ^
block.c:130:23: note: ')' token is here
    intern_nodelist = rb_intern("@nodelist");
                      ^~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                                                       ^
block.c:131:20: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    intern_blank = rb_intern("@blank");
                   ^~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                      ^
block.c:131:20: note: '{' token is here
    intern_blank = rb_intern("@blank");
                   ^~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^
block.c:131:20: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    intern_blank = rb_intern("@blank");
                   ^~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    }
    ^
block.c:131:20: note: ')' token is here
    intern_blank = rb_intern("@blank");
                   ^~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                                                       ^
block.c:132:23: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    intern_is_blank = rb_intern("blank?");
                      ^~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                      ^
block.c:132:23: note: '{' token is here
    intern_is_blank = rb_intern("blank?");
                      ^~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^
block.c:132:23: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    intern_is_blank = rb_intern("blank?");
                      ^~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    }
    ^
block.c:132:23: note: ')' token is here
    intern_is_blank = rb_intern("blank?");
                      ^~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                                                       ^
block.c:133:20: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    intern_clear = rb_intern("clear");
                   ^~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                      ^
block.c:133:20: note: '{' token is here
    intern_clear = rb_intern("clear");
                   ^~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^
block.c:133:20: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    intern_clear = rb_intern("clear");
                   ^~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    }
    ^
block.c:133:20: note: ')' token is here
    intern_clear = rb_intern("clear");
                   ^~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                                                       ^
block.c:134:30: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    intern_registered_tags = rb_intern("registered_tags");
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                      ^
block.c:134:30: note: '{' token is here
    intern_registered_tags = rb_intern("registered_tags");
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^
block.c:134:30: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    intern_registered_tags = rb_intern("registered_tags");
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    }
    ^
block.c:134:30: note: ')' token is here
    intern_registered_tags = rb_intern("registered_tags");
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                                                       ^
block.c:135:20: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    intern_parse = rb_intern("parse");
                   ^~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                      ^
block.c:135:20: note: '{' token is here
    intern_parse = rb_intern("parse");
                   ^~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^
block.c:135:20: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    intern_parse = rb_intern("parse");
                   ^~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    }
    ^
block.c:135:20: note: ')' token is here
    intern_parse = rb_intern("parse");
                   ^~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                                                       ^
block.c:136:30: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    intern_square_brackets = rb_intern("[]");
                             ^~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                      ^
block.c:136:30: note: '{' token is here
    intern_square_brackets = rb_intern("[]");
                             ^~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^
block.c:136:30: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    intern_square_brackets = rb_intern("[]");
                             ^~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    }
    ^
block.c:136:30: note: ')' token is here
    intern_square_brackets = rb_intern("[]");
                             ^~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                                                       ^
block.c:137:30: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    intern_set_line_number = rb_intern("line_number=");
                             ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                      ^
block.c:137:30: note: '{' token is here
    intern_set_line_number = rb_intern("line_number=");
                             ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iain/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [block.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/iain/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/liquid-c-4.0.0 for inspection.
Results logged to /Users/iain/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/extensions/x86_64-darwin-21/2.7.0/liquid-c-4.0.0/gem_make.out
ianeli1 commented 2 years ago

Issue appears to be related to https://github.com/ruby/ruby/pull/4504

Switching to llvm@11 solved it.

ankit-prajapati-26 commented 2 years ago

Getting same issue, I am able to install liquid-c with following command

gem install liquid-c -- --with-cflags="-Wno-compound-token-split-by-macro"