From 528e3753f792465f73095b65b47ae45061720d95 Mon Sep 17 00:00:00 2001 From: jefferydeng Date: Tue, 22 Aug 2023 18:04:18 +0800 Subject: [PATCH 1/5] fix version compare error when gcc version >= 10 --- src/blade/cc_targets.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/blade/cc_targets.py b/src/blade/cc_targets.py index 0a67d778..9f018fdb 100644 --- a/src/blade/cc_targets.py +++ b/src/blade/cc_targets.py @@ -17,6 +17,8 @@ import os from string import Template +from distutils.version import LooseVersion + from blade import build_manager from blade import build_rules from blade import config @@ -1321,7 +1323,7 @@ def _get_rpath_links(self): def _generate_cc_binary_link_flags(self, dynamic_link): linkflags = [] toolchain = self.blade.get_build_toolchain() - if not dynamic_link and toolchain.cc_is('gcc') and toolchain.get_cc_version() > '4.5': + if not dynamic_link and toolchain.cc_is('gcc') and LooseVersion(toolchain.get_cc_version()) > LooseVersion('4.5'): linkflags += ['-static-libgcc', '-static-libstdc++'] if self.attr.get('export_dynamic'): linkflags.append('-rdynamic') From cf8ad7cb814f5cd983b28a517d44c68592108fbf Mon Sep 17 00:00:00 2001 From: jefferydeng Date: Tue, 22 Aug 2023 19:42:18 +0800 Subject: [PATCH 2/5] fix python ci config and compatibility to python3 --- .github/workflows/python-package.yml | 2 +- src/blade/cc_targets.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 3840c8fc..d53bd671 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: ["2.7", "3.6", "3.9", "3.10"] + python-version: ["3.6", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v2 diff --git a/src/blade/cc_targets.py b/src/blade/cc_targets.py index 9f018fdb..9299bc73 100644 --- a/src/blade/cc_targets.py +++ b/src/blade/cc_targets.py @@ -17,7 +17,11 @@ import os from string import Template -from distutils.version import LooseVersion +try: + from packaging.version import parse as version_parse +except ImportError: + from distutils.version import LooseVersion as version_parse + from blade import build_manager from blade import build_rules @@ -1323,7 +1327,7 @@ def _get_rpath_links(self): def _generate_cc_binary_link_flags(self, dynamic_link): linkflags = [] toolchain = self.blade.get_build_toolchain() - if not dynamic_link and toolchain.cc_is('gcc') and LooseVersion(toolchain.get_cc_version()) > LooseVersion('4.5'): + if not dynamic_link and toolchain.cc_is('gcc') and version_parse(toolchain.get_cc_version()) > version_parse('4.5'): linkflags += ['-static-libgcc', '-static-libstdc++'] if self.attr.get('export_dynamic'): linkflags.append('-rdynamic') From ed1e43e40ead4e1701fee60a1b5f624e6cc45639 Mon Sep 17 00:00:00 2001 From: jefferydeng Date: Tue, 22 Aug 2023 20:11:27 +0800 Subject: [PATCH 3/5] image update --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index d53bd671..636237a4 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -12,7 +12,7 @@ on: jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: matrix: python-version: ["3.6", "3.9", "3.10", "3.11"] From 8461d4d35942b8b91b0b39608a1fe679485580b2 Mon Sep 17 00:00:00 2001 From: jefferydeng Date: Tue, 22 Aug 2023 20:19:09 +0800 Subject: [PATCH 4/5] change ci config --- .github/workflows/python-package.yml | 2 +- .travis.yml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 636237a4..d53bd671 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -12,7 +12,7 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 strategy: matrix: python-version: ["3.6", "3.9", "3.10", "3.11"] diff --git a/.travis.yml b/.travis.yml index c5b8750d..3c0c028b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,10 @@ dist: bionic language: python python: - - "2.7" - "3.6" - "3.9" + - "3.10" + - "3.11" before_install: true From c82b48b96b450185c472bd43f3ecb8df0c6ce8c9 Mon Sep 17 00:00:00 2001 From: jefferydeng Date: Tue, 22 Aug 2023 20:26:57 +0800 Subject: [PATCH 5/5] revert travis-ci config --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3c0c028b..c5b8750d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,9 @@ dist: bionic language: python python: + - "2.7" - "3.6" - "3.9" - - "3.10" - - "3.11" before_install: true