Skip to content

[BUG][BLD] revert DEF component of #21878 #21919

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

Merged
merged 1 commit into from
Jul 15, 2018

Conversation

jbrockmendel
Copy link
Member

#21878 introduced a subtle build problem that is not caught by the CI. Running python setup.py build_ext --inplace followed by python3 setup.py build_ext --inplace causes compile-time errors in py3 (or if running these in the opposite order, errors in py2). These are fixed by running python setup.py clean in between.

This reverts the relevant changes.

For anyone curious: cython supports syntax:

DEF foo = [...]

IF foo:
    [...]
ELSE:
    [...]

and these IF/ELSE conditions get evaluated at compile-time. #21878 incorrectly assumed that "compile-time" in this context meant ".c -> .so" time, not ".pyx -> .c" time. In this we used:

DEF PY2 = str == bytes

IF PY2:
    [...]
ELSE:
    [...]

so after running setup.py build_ext --inplace in py2, the ".c" file we end up with has already gotten rid of the PY3 branches. When we run python3 setup.py build_ext --inplace cython uses the existing .c file, tries to compile it to .so, and breaks.

@codecov
Copy link

codecov bot commented Jul 15, 2018

Codecov Report

Merging #21919 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #21919   +/-   ##
=======================================
  Coverage   91.96%   91.96%           
=======================================
  Files         166      166           
  Lines       50323    50323           
=======================================
  Hits        46281    46281           
  Misses       4042     4042
Flag Coverage Δ
#multiple 90.36% <ø> (ø) ⬆️
#single 42.23% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 63eff04...d939bde. Read the comment docs.

@jbrockmendel
Copy link
Member Author

@jreback @WillAyd quick take before I merge?

@jreback
Copy link
Contributor

jreback commented Jul 15, 2018

lgtm

yeah ideally these would be compile time checks

@jbrockmendel jbrockmendel merged commit b2305ea into pandas-dev:master Jul 15, 2018
@jbrockmendel jbrockmendel deleted the frak branch July 15, 2018 17:59
aeltanawy pushed a commit to aeltanawy/pandas that referenced this pull request Jul 20, 2018
Sup3rGeo pushed a commit to Sup3rGeo/pandas that referenced this pull request Oct 1, 2018
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

Successfully merging this pull request may close these issues.

2 participants