Skip to content

Support build 37 and 38 rebased #257

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

Conversation

jcfr
Copy link
Contributor

@jcfr jcfr commented Aug 6, 2019

@dbrnz @dand-oss This PR includes you respective set of changes 🙏 and is based on current master.

I will post here comment and questions.

Ultimately, some more commit may be squashed. Also to give credit, relevant Co-authored-by: ... git message trailer will be added.

jcfr and others added 16 commits August 6, 2019 09:24
* Rename "Modules/random.c" to "Modules/bootstrap_hash.c"
  See python/cpython@6b4be19
      bpo-22257: Small changes for PEP 432. (#1728)
      PEP 432 specifies a number of large changes to interpreter startup code,
      including exposing a cleaner C-API. The major changes depend on a number
      of smaller changes. This patch includes all those smaller changes.

* Remove bundled copy of libffi (Closes #27979)
  See python/cpython@f40d4dd
      An installed copy of libffi is now required for building _ctypes on
      any platform but OSX and Windows.
@jcfr
Copy link
Contributor Author

jcfr commented Aug 6, 2019

@dbrnz when integrating the change of @dand-oss in #256, you reverted python uses external libffi now, was this intentional ?

@dbrnz
Copy link
Contributor

dbrnz commented Aug 7, 2019

@jcfr reverting libffi changes wasn't intentional, so please unrevert as applicable...

@dbrnz
Copy link
Contributor

dbrnz commented Aug 8, 2019

Hmm @jcfr , commit c59e3d1 of @dand-oss (rebased as commit 77d11f7 and which I did merge), resulted in:

# get libffi
find_path(FFI_INCLUDE_DIR ffi.h)
find_library(FFI_LIBRARY NAMES ffi libffi)
add_python_extension(_ctypes
    SOURCES ${ctypes_COMMON_SOURCES}
    INCLUDEDIRS ${FFI_INCLUDE_DIR}
    LIBRARIES ${FFI_LIBRARY}
)

when not APPLE. This code is now missing as a result of commit 3554d50. Shouldn't the above apply for Python 3.7, so we end up with:

if(PY_VERSION VERSION_LESS "3.7")
    set(_libffi_sources)
    set(_libffi_include_dirs)
      .
      .
      .
    add_python_extension(_ctypes
        SOURCES ${ctypes_COMMON_SOURCES} ${_libffi_sources}
        ${_libffi_include_dirs}
    )
else()
    find_path(FFI_INCLUDE_DIR ffi.h)
    find_library(FFI_LIBRARY NAMES ffi libffi)
    add_python_extension(_ctypes
       SOURCES ${ctypes_COMMON_SOURCES}
       INCLUDEDIRS ${FFI_INCLUDE_DIR}
       LIBRARIES ${FFI_LIBRARY}
    )
endif()

@jcfr
Copy link
Contributor Author

jcfr commented Aug 9, 2019 via email

@dand-oss
Copy link
Contributor

Wow, you guys have done a lot!

Anything you need me to add here?

Since python/cpython@f40d4ddff (Closes python/cpython#27979: Remove
bundled copy of libffi), external version of libffi is required
on linux.
@jcfr jcfr force-pushed the support-build-37-and-38-rebased branch from 3554d50 to facfdcb Compare August 20, 2019 19:34
@jcfr
Copy link
Contributor Author

jcfr commented Aug 20, 2019

reverting libffi changes wasn't intentional, so please unrevert as applicable...

@dbrnz Thanks for the review, this last commit should do it.

@jcfr
Copy link
Contributor Author

jcfr commented Aug 20, 2019

Wow, you guys have done a lot!

Thanks 😄

Anything you need me to add here?

@dand-oss doing some local testing of the branch would be helpful.

@jcfr jcfr mentioned this pull request Aug 20, 2019
@jcfr jcfr added the Type: Enhancement Improvement to functionality label Aug 20, 2019
@dand-oss
Copy link
Contributor

dand-oss commented Aug 28, 2019

@dand-oss doing some local testing of the branch would be helpful.

Here is how I "checked out a local branch"
for those contributors who like me are "less than git wizards"
its not difficult!

I had a forked repo of python-cmake-buildsystem cloned to my local
with a remote and a branch named "upstream"
I regular rebased my "master" branch upon

# get the remote branch as a local branch
git remote add jcfr git@github.com:jcfr/python-cmake-buildsystem.git
git fetch jcfr
git checkout -b support-build-37-and-38-rebased jcfr/support-build-37-and-38-rebased

# get support-build-37-and-38-rebased
git rebase -i upstream

# get my master branch on top of the trial branch
# - custom cmake, ability to build debug, my own scripts to set up venv after build
git checkout master
git rebase -i support-build-37-and-38-rebased

Then I built on windows and Linux, and all was good!

@jcfr
Copy link
Contributor Author

jcfr commented Sep 24, 2019

Then I built on windows and Linux, and all was good!

Great. Thanks for taking the time to test 🙏

@jamesobutler
Copy link
Contributor

Based on the title of this PR “ Support build 37 and 38 rebased“, is this PR waiting on Python 3.8.0 support to be added? It doesn’t currently appear to be in this PR.

@dand-oss
Copy link
Contributor

Python 3.8 will not build - requires more work

CMake Error at cmake/libpython/CMakeLists.txt:450 (add_executable):
Cannot find source file:

build-64/Python-3.8.0/Parser/bitset.c

Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
.hpp .hxx .in .txx

CMake Error at cmake/libpython/CMakeLists.txt:477 (add_library):
Cannot find source file:

build-64/Python-3.8.0/Modules/zipimport.c

Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
.hpp .hxx .in .txx
Call Stack (most recent call first):
cmake/libpython/CMakeLists.txt:513 (add_libpython)

CMake Error at cmake/libpython/CMakeLists.txt:450 (add_executable):
No SOURCES given to target: pgen

CMake Error at cmake/libpython/CMakeLists.txt:477 (add_library):
No SOURCES given to target: libpython-shared
Call Stack (most recent call first):
cmake/libpython/CMakeLists.txt:513 (add_libpython)

CMake Error at cmake/libpython/CMakeLists.txt:406 (add_executable):
No SOURCES given to target: _freeze_importlib

@jamesobutler
Copy link
Contributor

jamesobutler commented Nov 10, 2019

Testing Python 3.7 support

  • I'm having trouble generating the solution for the default configuration in this PR for 3.7.4.
CMake Error at cmake/libpython/CMakeLists.txt:493 (add_library):
  Cannot find source file:

    C:/D/Python-3.7.4/Modules/zlib/adler32.c

This appears to be because zlib (only used for Windows) was removed from the cpython repository to be in cpython-source-deps as specified in python/cpython@d01db1c starting with python 3.7.0.

Testing Python 3.8 support

CMake Error at cmake/libpython/CMakeLists.txt:450 (add_executable):
Cannot find source file:

build-64/Python-3.8.0/Parser/bitset.c
CMake Error at cmake/libpython/CMakeLists.txt:450 (add_executable):
No SOURCES given to target: pgen

Bitset.c and pgen were removed in python 3.8.0 as part of python/cpython@1f24a71.

CMake Error at cmake/libpython/CMakeLists.txt:477 (add_library):
Cannot find source file:

build-64/Python-3.8.0/Modules/zipimport.c

Zipimport was rewritten in pure python for 3.8.0. It is now at Lib/zipimport.py. See python/cpython@79d1c2e

@dand-oss
Copy link
Contributor

Status

I am using cmake-buildystem with Python 3.7.6 on Windows and Linux

python 3.8 will take significant work - much has changed...

I put a few hours in on 3.8, worked around some problems, but more problems remain.

@dand-oss dand-oss mentioned this pull request Jan 29, 2020
@gongminmin
Copy link
Contributor

I have changes to adapt 3.7 and 3.8. It's not a general enough change, only works for my scenario. Feel free to pick useful lines from them.

3.7: gongminmin@7d97c1d
3.8: gongminmin@d4818e7

@jcfr
Copy link
Contributor Author

jcfr commented Jan 9, 2022

Closing. This pull-request is superseded by #289 and #292

@jcfr jcfr closed this Jan 9, 2022
@jcfr jcfr deleted the support-build-37-and-38-rebased branch January 19, 2022 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Improvement to functionality
Development

Successfully merging this pull request may close these issues.

5 participants