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

Consistent error installing ansible 2.2 #7197

Closed
3 tasks done
halostatue opened this issue Nov 23, 2016 · 14 comments
Closed
3 tasks done

Consistent error installing ansible 2.2 #7197

halostatue opened this issue Nov 23, 2016 · 14 comments

Comments

@halostatue
Copy link

halostatue commented Nov 23, 2016

  • Ran brew update and retried your prior step?
  • Ran brew doctor, fixed as many issues as possible and retried your prior step?
  • If you're seeing permission errors tried running sudo chown -R $(whoami) $(brew --prefix)? (not applicable)

Bug reports:

Cannot install ansible 2.2 (ansible-2.2.0.0.tar.gz). Consistently failing on the step that installs cffi (==> /Users/austin/.brew/Cellar/ansible/2.2.0.0_1/libexec/bin/pip install -v --no-deps --no-binary :all: --ignore-installed /private/tmp/ansible--cffi-20161123-84131-1ww9fzl/cffi-1.8.3). I am using brew-installed Python, built --universal:

☺ 7042 ‣ which python
/Users/austin/.brew/bin/python

I have previously installed Ansible through Homebrew with no problems, and was successfully running Ansible 2.1. Only since Ansible 2.2 have I been unable to upgrade or install, generally failing at this point. pip install ansible seems to work just fine.

The install logs have been gisted.

@tuzla0autopilot4
Copy link

Been seeing same issue for several weeks. gisted files

@mistydemeo
Copy link
Contributor

@tdsmith Looks like a possible Xcode-only problem finding libffi?

@tdsmith
Copy link
Contributor

tdsmith commented Nov 29, 2016

Agreed. For the reporters, you can work around this by installing the CLT package with xcode-select --install. I wonder why this fails?

The failure is

    clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DUSE__THREAD -I/usr/include/ffi -I/usr/include/libffi -I/Users/austin/.brew/opt/python/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c c/_cffi_backend.c -o build/temp.macosx-10.12-intel-2.7/c/_cffi_backend.o
    c/_cffi_backend.c:15:10: fatal error: 'ffi.h' file not found
    #include <ffi.h>

The superenv shim shows

clang called with: -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DUSE__THREAD -I/usr/include/ffi -I/usr/include/libffi -I/Users/austin/.brew/opt/python/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c c/_cffi_backend.c -o build/temp.macosx-10.12-intel-2.7/c/_cffi_backend.o
superenv removed:  -arch i386 -arch x86_64 -g -O3 -Wall -Wstrict-prototypes
superenv added:    -pipe -w -Os -march=native --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -isystem/Users/austin/.brew/include -isystem/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2 -isystem/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/apache2 -isystem/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers -I/Users/austin/.brew/opt/[email protected]/include
superenv executed: clang -pipe -w -Os -march=native -fno-strict-aliasing -fno-common -dynamic -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -fwrapv -DUSE__THREAD -I/usr/include/ffi -I/usr/include/libffi -I/Users/austin/.brew/opt/python/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c c/_cffi_backend.c -o build/temp.macosx-10.12-intel-2.7/c/_cffi_backend.o -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -isystem/Users/austin/.brew/include -isystem/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2 -isystem/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/apache2 -isystem/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers -I/Users/austin/.brew/opt/[email protected]/include

The file exists as /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/ffi/ffi.h.

I would have anticipated that the combination of -I/usr/include/ffi and --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk would successfully locate the header.

@tdsmith
Copy link
Contributor

tdsmith commented Nov 29, 2016

It looks like I misunderstood the interaction of -I and --sysroot; the gcc behavior (which I assume clang is emulating?) is:

-I dir
Add the directory dir to the list of directories to be searched for header files. Directories named by -I are searched before the standard system include directories. If the directory dir is a standard system include directory, the option is ignored to ensure that the default search order for system directories and the special treatment of system headers are not defeated . If dir begins with =, then the = will be replaced by the sysroot prefix; see --sysroot and -isysroot.

This seems like something superenv should be aware of.

@tuzla0autopilot4
Copy link

Installing CLT per @tdsmith worked, and I now have ansible 2.2.0.0 installed. Thanks.

@tdsmith
Copy link
Contributor

tdsmith commented Nov 29, 2016

Adding this to the shim breaks the cffi build on my machine with a clang "can't find ffi.h" error, heh:

sysroot_search = val.start_with?("/usr/include/") ? "=" : ""
args << "-I#{sysroot_search}#{val}" if keep?(path) && @iset.add?(path)

@tdsmith
Copy link
Contributor

tdsmith commented Nov 29, 2016

sysroot_search = val.start_with?("/usr/include/") ? "#{sysroot}/" : "" works on a CLT-ful system, anyway.

@jbcpollak
Copy link

@tdsmith your proposed work around seemed to help. I uninstalled ansible, ran xcode-select --install, and reinstalled ansible, and it worked.

@MikeMcQuaid
Copy link
Member

@ilovezfs Any thoughts here?

@ilovezfs
Copy link
Contributor

It is definitely not an "acceptable" workaround to require CLT given all the needed files are in Xcode.app's SDK

iMac-TMP:~ joe$ find /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk|grep 'ffi/'|grep -E '\.h$'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ffi/ffi.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ffi/ffi_common.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ffi/fficonfig.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ffi/ffitarget.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ffi/ppc-darwin.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ffi/ppc-ffitarget.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ffi/x86-ffitarget.h

@tdsmith
Copy link
Contributor

tdsmith commented Dec 19, 2016

I think there is universal agreement on that point.

@ilovezfs
Copy link
Contributor

@tdsmith I wouldn't be so sure: Homebrew/brew#965.

@ilovezfs
Copy link
Contributor

It seems the only thing needed to fix this is

    ENV.prepend "CPPFLAGS", "-I#{MacOS.sdk.path}/usr/include/ffi"

since the include is #include <ffi.h> not #include <ffi/ffi.h>

@ilovezfs
Copy link
Contributor

Closed via #8992.

@ilovezfs ilovezfs reopened this Jan 20, 2017
@Homebrew Homebrew locked and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants