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

Build fails on macOS 11 #7

Closed
DalenW opened this issue Sep 2, 2020 · 4 comments
Closed

Build fails on macOS 11 #7

DalenW opened this issue Sep 2, 2020 · 4 comments

Comments

@DalenW
Copy link

DalenW commented Sep 2, 2020

Not really an issue right now but it could be one. Right now on macOS Big Sur with CLT 12.0, building this gem fails. The fix is to switch back to CLT 11.6, then re-run bundle install/update. However I think this should be looked at or something before the release.

Here's what the error is, I'm not knowledgable enough with C/C++ to tell you guys what's happening, just that downgrading CLT fixes it. It happens on all ruby versions, I just happened to be one 2.6.4 when I saved this.

current directory: /Users/dalen/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/nokogiri-xmlsec-instructure-0.9.6/ext/nokogiri_ext_xmlsec
make "DESTDIR=" clean

current directory: /Users/dalen/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/nokogiri-xmlsec-instructure-0.9.6/ext/nokogiri_ext_xmlsec
make "DESTDIR="
compiling init.c
compiling nokogiri_decrypt_with_key.c
nokogiri_decrypt_with_key.c:61:7: error: implicit declaration of function 'nokogiri_root_node' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
nokogiri_root_node(encCtx->replacedNodeList);
^
nokogiri_decrypt_with_key.c:21:15: warning: implicit conversion loses integer precision: 'long' to 'unsigned int' [-Wshorten-64-to-32]
keyLength = RSTRING_LEN(rb_key);
~ ^~~~~~~~~~~~~~~~~~~
/Users/dalen/.rbenv/versions/2.6.4/include/ruby-2.6.0/ruby/ruby.h:1000:6: note: expanded from macro 'RSTRING_LEN'
RSTRING_EMBED_LEN(str) :
^~~~~~~~~~~~~~~~~~~~~~
/Users/dalen/.rbenv/versions/2.6.4/include/ruby-2.6.0/ruby/ruby.h:996:6: note: expanded from macro 'RSTRING_EMBED_LEN'
(long)((RBASIC(str)->flags >> RSTRING_EMBED_LEN_SHIFT) &
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nokogiri_decrypt_with_key.c:21:15: warning: implicit conversion loses integer precision: 'long' to 'unsigned int' [-Wshorten-64-to-32]
keyLength = RSTRING_LEN(rb_key);
~ ^~~~~~~~~~~~~~~~~~~
/Users/dalen/.rbenv/versions/2.6.4/include/ruby-2.6.0/ruby/ruby.h:1001:28: note: expanded from macro 'RSTRING_LEN'
RSTRING(str)->as.heap.len)
~~~~~~~~~~~~~~~~~~~~~~^~~
2 warnings and 1 error generated.
make: *** [nokogiri_decrypt_with_key.o] Error 1

make failed, exit code 2

@nasht
Copy link

nasht commented Sep 17, 2020

I also just saw this issue while running Xcode 12 on Catalina.

As Dalen above points out, going back a version and using the previous command line tools fixes it.

  • install Xcode 11.7 and point the command line tools to it.

image

  • ensure that I have run:
    brew install libxmlsec1 postgresql

@DalenW
Copy link
Author

DalenW commented Sep 20, 2020

Yup. That's what I did, as stated in my original post. I'm just worried people are gonna run into this way more often with CLT 12.0 being out now.

@nikoma
Copy link

nikoma commented Oct 3, 2020

I do not have Xcode installed and running 'brew install libxmlsec1' fixed it for me.

@ccutrer
Copy link

ccutrer commented Apr 8, 2021

I just installed this gem with ruby 2.7.2, Big Sur, Command Line Tools 12.0 with no problems. And yes, libxmlsec1 is a prerequisite. This is also against nokogiri 1.11.3, which has changed several of their internal functions.

@ccutrer ccutrer closed this as completed Apr 8, 2021
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

No branches or pull requests

4 participants