-
Notifications
You must be signed in to change notification settings - Fork 2k
Fixed Python version support. #3283
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
Changes from 9 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
f4f08e6
Fixed a bug with Python version selection and library loading.
GvozdevLeonid bf4737a
Fixed Python version support.
GvozdevLeonid c787f27
Fixed Python version support.
GvozdevLeonid 4f7e6a6
fixed typo
GvozdevLeonid a870db2
Fix issue
GvozdevLeonid 285c0a8
fixed issue
GvozdevLeonid bdb5e05
Simplify configuration arguments
GvozdevLeonid 4325bb8
Merge branch 'develop' into develop
GvozdevLeonid 02e65ae
Merge branch 'develop' into develop
GvozdevLeonid 81f185e
fixed flake8 issues
GvozdevLeonid c681ef9
Increased the minimum python version to 3.8
GvozdevLeonid 89bb823
simple solution to remove duplicates from patches and configure_args
GvozdevLeonid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,7 +55,6 @@ class Python3Recipe(TargetPythonRecipe): | |
| ''' | ||
|
|
||
| version = '3.14.2' | ||
| _p_version = Version(version) | ||
| url = 'https://github.com/python/cpython/archive/refs/tags/v{version}.tar.gz' | ||
| name = 'python3' | ||
|
|
||
|
|
@@ -64,28 +63,6 @@ class Python3Recipe(TargetPythonRecipe): | |
| 'patches/reproducible-buildinfo.diff', | ||
| ] | ||
|
|
||
| if _p_version.major == 3 and _p_version.minor == 7: | ||
| patches += [ | ||
| 'patches/py3.7.1_fix-ctypes-util-find-library.patch', | ||
| 'patches/py3.7.1_fix-zlib-version.patch', | ||
| ] | ||
|
|
||
| if 8 <= _p_version.minor <= 10: | ||
| patches.append('patches/py3.8.1.patch') | ||
|
|
||
| if _p_version.minor >= 11: | ||
| patches.append('patches/cpython-311-ctypes-find-library.patch') | ||
|
|
||
| if _p_version.minor >= 14: | ||
| patches.append('patches/3.14_armv7l_fix.patch') | ||
| patches.append('patches/3.14_fix_remote_debug.patch') | ||
|
|
||
| if shutil.which('lld') is not None: | ||
| if _p_version.minor == 7: | ||
| patches.append("patches/py3.7.1_fix_cortex_a8.patch") | ||
| elif _p_version.minor >= 8: | ||
| patches.append("patches/py3.8.1_fix_cortex_a8.patch") | ||
GvozdevLeonid marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| depends = ['hostpython3', 'sqlite3', 'openssl', 'libffi'] | ||
| # those optional depends allow us to build python compression modules: | ||
| # - _bz2.so | ||
|
|
@@ -116,11 +93,6 @@ class Python3Recipe(TargetPythonRecipe): | |
| 'ac_cv_header_bzlib_h=no', | ||
| ] | ||
|
|
||
| if _p_version.minor >= 11: | ||
| configure_args.extend([ | ||
| '--with-build-python={python_host_bin}', | ||
| ]) | ||
|
|
||
| '''The configure arguments needed to build the python recipe. Those are | ||
| used in method :meth:`build_arch` (if not overwritten like python3's | ||
| recipe does). | ||
|
|
@@ -210,6 +182,32 @@ def link_version(self): | |
| flags=flags | ||
| ) | ||
|
|
||
| def apply_patches(self, arch, build_dir=None): | ||
|
|
||
| _p_version = Version(self.version) | ||
| if _p_version.major == 3 and _p_version.minor == 7: | ||
| self.patches += [ | ||
| 'patches/py3.7.1_fix-ctypes-util-find-library.patch', | ||
| 'patches/py3.7.1_fix-zlib-version.patch', | ||
| ] | ||
GvozdevLeonid marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| if 8 <= _p_version.minor <= 10: | ||
| self.patches.append('patches/py3.8.1.patch') | ||
|
|
||
| if _p_version.minor >= 11: | ||
| self.patches.append('patches/cpython-311-ctypes-find-library.patch') | ||
|
|
||
| if _p_version.minor >= 14: | ||
| self.patches.append('patches/3.14_armv7l_fix.patch') | ||
| self.patches.append('patches/3.14_fix_remote_debug.patch') | ||
|
|
||
| if shutil.which('lld') is not None: | ||
| if _p_version.minor == 7: | ||
| self.patches.append("patches/py3.7.1_fix_cortex_a8.patch") | ||
|
Comment on lines
+205
to
+206
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: probably not needed anymore since we dropped that version |
||
| elif _p_version.minor >= 8: | ||
| self.patches.append("patches/py3.8.1_fix_cortex_a8.patch") | ||
| super().apply_patches(arch, build_dir) | ||
|
|
||
| def include_root(self, arch_name): | ||
| return join(self.get_build_dir(arch_name), 'Include') | ||
|
|
||
|
|
@@ -317,7 +315,11 @@ def add_flags(include_flags, link_dirs, link_libs): | |
| env['ZLIB_VERSION'] = line.replace('#define ZLIB_VERSION ', '') | ||
| add_flags(' -I' + zlib_includes, ' -L' + zlib_lib_path, ' -lz') | ||
|
|
||
| if self._p_version.minor >= 13 and self.disable_gil: | ||
| _p_version = Version(self.version) | ||
| if _p_version.minor >= 11: | ||
| self.configure_args.append('--with-build-python={python_host_bin}') | ||
|
|
||
| if _p_version.minor >= 13 and self.disable_gil: | ||
| self.configure_args.append("--disable-gil") | ||
|
|
||
| return env | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.