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

Remove a binding causing compilation issues #1635

Closed

Conversation

reaperhulk
Copy link
Member

CRYPTO_malloc_debug_init has caused us quite a bit of heartache (from FreeBSD ports to mysterious OS X issues). We're not using it and pyOpenSSL isn't using it either so I propose we just remove it for now.

This is technically a backwards compatibility break (albeit almost certainly not one that will affect anyone), so arguably we should list it in the changelog.

If others have a better idea for resolving this speak up!

@reaperhulk reaperhulk added this to the Eighth Release milestone Jan 19, 2015
@jenkins-cryptography
Copy link

Test PASSed.
Refer to this link for build results: https://jenkins.cryptography.io/job/cryptography-pr-experimental/2875/

@public
Copy link
Member

public commented Jan 20, 2015

I don't think we can commit to supporting the entire OpenSSL API :)

@Ayrx
Copy link
Contributor

Ayrx commented Jan 20, 2015

I think we should list it in the CHANGELOG. Otherwise +1 on this.

@alex
Copy link
Member

alex commented Jan 26, 2015

I'm not wild about removing something without understanding why. ISTM it's not unlikely that the result is that on these platforms some other binding complains.

@koobs
Copy link
Contributor

koobs commented Jan 27, 2015

@alex It was causing test failures (on FreeBSD), so I couldn't QA recent updates to keep the Port up to date. Happy to provide the errors here if you need more info, I provided @reaperhulk with a login to the machine last week to investigate.

@reaperhulk
Copy link
Member Author

Closing this as the underlying cause isn't the binding.

@reaperhulk reaperhulk closed this Jan 29, 2015
@reaperhulk reaperhulk deleted the remove-malloc-debug-binding branch January 29, 2015 15:46
@alex
Copy link
Member

alex commented Jan 29, 2015

@reaperhulk can you share what the underlying cause was?

@reaperhulk
Copy link
Member Author

@public and @dstufft are probably better equipped to answer this

@dstufft
Copy link
Member

dstufft commented Jan 29, 2015

FreeBSD does it's install in two steps which can be summarized as python setup.py build <build args> && python setup.py install <install args>. In Python calling python setup.py install also calls python setup.py build but generally distutils attempts to detect if it needs to build the .sos again and bails out early if not. However cffi doesn't actually check if it needs to write the file out, it just records that it wrote the file to an in memory location. This means that two successive invocation of setup.py build_ext (implicitly via build and install) will both write the file even if it it's going to just write the exact same data. This causes distutils to see that the .c file is newer than the .so file and will recompile it. Combine that with the fact that FreeBSD only passes the build options to the python setup.py build command when distutils attempts to compile it a second time when running python setup.py install it doesn't get the correct build options and looks in the wrong folders for things.

@Ayrx
Copy link
Contributor

Ayrx commented Jan 29, 2015

Does this explain that reported OS X failure as well?
On Fri, 30 Jan 2015 at 6:14 am Donald Stufft notifications@github.com
wrote:

FreeBSD does it's install in two steps which can be summarized as python
setup.py build && python setup.py install . In
Python calling python setup.py install also calls python setup.py build
but generally distutils attempts to detect if it needs to build the .sos
again and bails out early if not. However cffi doesn't actually check if it
needs to write the file out, it just records that it wrote the file to an
in memory location. This means that two successive invocation of setup.py
build_ext (implicitly via build and install) will both write the file
even if it it's going to just write the exact same data. This causes
distutils to see that the .c file is newer than the .so file and will
recompile it. Combine that with the fact that FreeBSD only passes the build
options to the python setup.py build command when distutils attempts to
compile it a second time when running python setup.py install it doesn't
get the correct build options and looks in the wrong folders for things.


Reply to this email directly or view it on GitHub
#1635 (comment).

@dstufft
Copy link
Member

dstufft commented Jan 29, 2015

No idea.

uqs pushed a commit to freebsd/freebsd-ports that referenced this pull request Feb 11, 2015
Backport upstream pull request #56 [1] which fixes (double) building for
Python packackges that use py-cffi to compile their modules.

This issue manifested itself in the 'install' target (stage) of Python
port building, causing the module that was already built at the 'build'
stage to be built again, except *without* the build arguments provided
in the build stage.

These symptoms were observable in security/py-cryptography [2]

While I'm here:

- Add regression-test target and TEST_DEPENDS

unit tests: 1 failed, 1033 passed, 80 skipped in 70.56 seconds

Note: Failure in test_array_type already exists in current version, and
      has been reported upstream [3]

[1] https://bitbucket.org/cffi/cffi/pull-request/56/
[2] pyca/cryptography#1635
[3] https://bitbucket.org/cffi/cffi/issue/178/

Approved by:	wg (maintainer)


git-svn-id: svn+ssh://svn.freebsd.org/ports/head@378825 35697150-7ecd-e111-bb59-0022644237b5
koobs added a commit to freebsd/freebsd-ports that referenced this pull request Feb 11, 2015
Backport upstream pull request #56 [1] which fixes (double) building for
Python packackges that use py-cffi to compile their modules.

This issue manifested itself in the 'install' target (stage) of Python
port building, causing the module that was already built at the 'build'
stage to be built again, except *without* the build arguments provided
in the build stage.

These symptoms were observable in security/py-cryptography [2]

While I'm here:

- Add regression-test target and TEST_DEPENDS

unit tests: 1 failed, 1033 passed, 80 skipped in 70.56 seconds

Note: Failure in test_array_type already exists in current version, and
      has been reported upstream [3]

[1] https://bitbucket.org/cffi/cffi/pull-request/56/
[2] pyca/cryptography#1635
[3] https://bitbucket.org/cffi/cffi/issue/178/

Approved by:	wg (maintainer)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

None yet

7 participants