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

Cannot build 0.2.2 on os x 1.6.8 #740

Closed
askholme opened this issue Mar 6, 2014 · 4 comments
Closed

Cannot build 0.2.2 on os x 1.6.8 #740

askholme opened this issue Mar 6, 2014 · 4 comments

Comments

@askholme
Copy link

askholme commented Mar 6, 2014

Tried to installed 0.2.2 on OS X 10.6.8, however the build is failing due to lack of CommonKeyDeriviation.h. As far as i gather this file is not part of the OS X crypto lib before version 10.8

Is there a strong dependency or would it be possible to build without CommonKeyDeriviation.h? (i.e. do you simply not support OS X versions earlier than 10.8)

See build output below

building '_cffi__x9c102645x21ac8a22' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c -o /Users/ask/.virtualenvs/djangoSuper/build/cryptography/cryptography/hazmat/bindings/__pycache__/cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.o
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:164:46: error: CommonCrypto/CommonKeyDerivation.h: No such file or directory
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:202: error: expected ‘)’ before ‘const’
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:205: error: expected ‘)’ before ‘size_t’
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:209: error: expected declaration specifiers or ‘...’ before ‘CCMode’
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:210: error: expected declaration specifiers or ‘...’ before ‘CCPadding’
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:212: error: expected declaration specifiers or ‘...’ before ‘CCModeOptions’
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c: In function ‘_cffi_e__$enum_$2’:
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:316: error: ‘kCCPBKDF2’ undeclared (first use in this function)
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:316: error: (Each undeclared identifier is reported only once
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:316: error: for each function it appears in.)
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c: In function ‘_cffi_e__$enum_$3’:
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:332: error: ‘kCCPRFHmacAlgSHA1’ undeclared (first use in this function)
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:343: error: ‘kCCPRFHmacAlgSHA224’ undeclared (first use in this function)
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:354: error: ‘kCCPRFHmacAlgSHA256’ undeclared (first use in this function)
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:365: error: ‘kCCPRFHmacAlgSHA384’ undeclared (first use in this function)
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:376: error: ‘kCCPRFHmacAlgSHA512’ undeclared (first use in this function)
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c: In function ‘_cffi_e__$enum_$4’:
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:458: error: ‘kCCAlgorithmBlowfish’ undeclared (first use in this function)
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c: In function ‘_cffi_e__$enum_$7’:
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:583: error: ‘kCCModeOptionCTR_LE’ undeclared (first use in this function)
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:594: error: ‘kCCModeOptionCTR_BE’ undeclared (first use in this function)
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c: In function ‘_cffi_e__$enum_$8’:
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:610: error: ‘kCCModeECB’ undeclared (first use in this function)
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:621: error: ‘kCCModeCBC’ undeclared (first use in this function)
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:632: error: ‘kCCModeCFB’ undeclared (first use in this function)
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:643: error: ‘kCCModeCTR’ undeclared (first use in this function)
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:654: error: ‘kCCModeF8’ undeclared (first use in this function)
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:665: error: ‘kCCModeLRW’ undeclared (first use in this function)
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:676: error: ‘kCCModeOFB’ undeclared (first use in this function)
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:687: error: ‘kCCModeXTS’ undeclared (first use in this function)
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:698: error: ‘kCCModeRC4’ undeclared (first use in this function)
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:709: error: ‘kCCModeCFB8’ undeclared (first use in this function)
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c: In function ‘_cffi_e__$enum_$9’:
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:736: error: ‘ccNoPadding’ undeclared (first use in this function)
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:747: error: ‘ccPKCS7Padding’ undeclared (first use in this function)
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c: In function ‘_cffi_f_CCCalibratePBKDF’:
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:825: warning: implicit declaration of function ‘CCCalibratePBKDF’
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c: In function ‘_cffi_f_CCCryptorCreateWithMode’:
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:1024: warning: passing argument 3 of ‘CCCryptorCreateWithMode’ makes pointer from integer without a cast
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:1024: warning: passing argument 4 of ‘CCCryptorCreateWithMode’ makes pointer from integer without a cast
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:1024: warning: passing argument 5 of ‘CCCryptorCreateWithMode’ makes integer from pointer without a cast
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:1024: warning: passing argument 8 of ‘CCCryptorCreateWithMode’ makes integer from pointer without a cast
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:1024: warning: passing argument 9 of ‘CCCryptorCreateWithMode’ makes pointer from integer without a cast
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:1024: error: too many arguments to function ‘CCCryptorCreateWithMode’
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c: In function ‘_cffi_f_CCKeyDerivationPBKDF’:
cryptography/hazmat/bindings/__pycache__/_cffi__x9c102645x21ac8a22.c:1749: warning: implicit declaration of function ‘CCKeyDerivationPBKDF’
Traceback (most recent call last):
  File "setup.py", line 113, in <module>
    "build": cffi_build,
  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 971, in run_command
    cmd_obj.ensure_finalized()
  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
    self.finalize_options()
  File "setup.py", line 61, in finalize_options
    CommonCryptoBinding().ffi.verifier.get_extension()
  File "/Users/ask/.virtualenvs/djangoSuper/build/cryptography/cryptography/hazmat/bindings/commoncrypto/binding.py", line 37, in __init__
    self._ensure_ffi_initialized()
  File "/Users/ask/.virtualenvs/djangoSuper/build/cryptography/cryptography/hazmat/bindings/commoncrypto/binding.py", line 45, in _ensure_ffi_initialized
    "", "", [])
  File "/Users/ask/.virtualenvs/djangoSuper/build/cryptography/cryptography/hazmat/bindings/utils.py", line 72, in build_ffi
    ext_package="cryptography",
  File "/Users/ask/.virtualenvs/djangoSuper/lib/python2.7/site-packages/cffi/api.py", line 339, in verify
    lib = self.verifier.load_library()
  File "/Users/ask/.virtualenvs/djangoSuper/lib/python2.7/site-packages/cffi/verifier.py", line 74, in load_library
    self._compile_module()
  File "/Users/ask/.virtualenvs/djangoSuper/lib/python2.7/site-packages/cffi/verifier.py", line 139, in _compile_module
    outputfilename = ffiplatform.compile(tmpdir, self.get_extension())
  File "/Users/ask/.virtualenvs/djangoSuper/lib/python2.7/site-packages/cffi/ffiplatform.py", line 25, in compile
    outputfilename = _build(tmpdir, ext)
  File "/Users/ask/.virtualenvs/djangoSuper/lib/python2.7/site-packages/cffi/ffiplatform.py", line 50, in _build
    raise VerificationError('%s: %s' % (e.__class__.__name__, e))
cffi.ffiplatform.VerificationError: CompileError: command 'gcc-4.2' failed with exit status 1
@askholme
Copy link
Author

askholme commented Mar 6, 2014

I managed to build purely against the openssl bindings by changing the is_available function on commoncrypto api so it specifically checks for this header file (kind of a crude hack).

That does the job for me, but it would still be nice if snow leopard was supported. It's not completly phased out yet :-)

@reaperhulk
Copy link
Member

The CC backend is supported only in 10.8+, so your workaround was a good one. @Ayrx has put in a PR to make the CC backend more selective, and once he adds some tests to it we can merge to fix this issue.

On a separate note, be aware that 10.6 is no longer under maintenance (even security releases) from Apple so you should definitely consider moving to a newer release if your hardware supports it.

@askholme
Copy link
Author

askholme commented Mar 6, 2014

Thanks for confirming. I know that 10.6 is old, but one machine is a pure 32-bit 2006 mac mini which cannot go further (and a 2009 MBP doesn't perform to well under 10.7 either)

Should probably just get some new hardware instead :-)

@askholme askholme closed this as completed Mar 6, 2014
@Ivoz
Copy link
Contributor

Ivoz commented Mar 6, 2014

Could always try booting linux on it! :)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants