Skip to content

PART 1: castxml 0.6.11 x86_64 #247

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 2 commits into from
Feb 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 30 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,31 @@ jobs:
include:
# UBUNTU 22.04 - CASTXML EPIC 0
- os: ubuntu-22.04
arch: x86_64
compiler: clang++
clang-version: 13
python-version: "3.13"
castxml-epic: 0
cppstd: "-std=c++98"

- os: ubuntu-22.04
arch: x86_64
compiler: clang++
clang-version: 14
python-version: "3.13"
castxml-epic: 0
cppstd: "-std=c++98"

- os: ubuntu-22.04
arch: x86_64
compiler: clang++
clang-version: 15
python-version: "3.13"
castxml-epic: 0
cppstd: "-std=c++98"

- os: ubuntu-22.04
arch: x86_64
compiler: clang++
clang-version: 15
python-version: "3.13"
Expand All @@ -45,34 +49,39 @@ jobs:

# UBUNTU 24.04 - CASTXML EPIC 0
- os: ubuntu-24.04
arch: x86_64
compiler: clang++
clang-version: 16
python-version: "3.9"
castxml-epic: 0
cppstd: "-std=c++98"

- os: ubuntu-24.04
arch: x86_64
compiler: clang++
clang-version: 16
python-version: "3.10"
castxml-epic: 0
cppstd: "-std=c++98"

- os: ubuntu-24.04
arch: x86_64
compiler: clang++
clang-version: 16
python-version: "3.11"
castxml-epic: 0
cppstd: "-std=c++98"

- os: ubuntu-24.04
arch: x86_64
compiler: clang++
clang-version: 16
python-version: "3.12"
castxml-epic: 0
cppstd: "-std=c++98"

- os: ubuntu-24.04
arch: x86_64
compiler: clang++
clang-version: 16
python-version: "3.13"
Expand All @@ -81,20 +90,23 @@ jobs:

# UBUNTU 24.04 - CASTXML EPIC 0 - c++XX
- os: ubuntu-24.04
arch: x86_64
compiler: clang++
clang-version: 16
python-version: "3.13"
castxml-epic: 0
cppstd: "-std=c++11"

- os: ubuntu-24.04
arch: x86_64
compiler: clang++
clang-version: 16
python-version: "3.13"
castxml-epic: 0
cppstd: "-std=c++14"

- os: ubuntu-24.04
arch: x86_64
compiler: clang++
clang-version: 16
python-version: "3.13"
Expand All @@ -103,13 +115,15 @@ jobs:

# UBUNTU 24.04 - CASTXML EPIC 1
- os: ubuntu-24.04
arch: x86_64
compiler: clang++
clang-version: 16
python-version: "3.13"
castxml-epic: 1
cppstd: "-std=c++98"

- os: ubuntu-24.04
arch: x86_64
compiler: clang++
clang-version: 16
python-version: "3.13"
Expand Down Expand Up @@ -152,14 +166,27 @@ jobs:
echo "compiler_path=/usr/bin/${{ matrix.compiler }}-${{ matrix.clang-version }}" >> tests/xml_generator.cfg
echo "ccflags=${{ matrix.cppstd }}" >> tests/xml_generator.cfg

- name: Setup castxml for Linux
if: contains(matrix.os, 'ubuntu')
# ─── Setup CastXML for Linux x86_64 ──────────────────────────────
- name: Setup CastXML for Linux x86_64 (Ubuntu 24.04)
if: matrix.os == 'ubuntu-24.04' && matrix.arch == 'x86_64'
run: |
wget -q -O ~/castxml-ubuntu-24.04-x86_64.tar.gz https://github.com/CastXML/CastXMLSuperbuild/releases/download/v0.6.11.post1/castxml-ubuntu-24.04-x86_64.tar.gz
tar -xzf ~/castxml-ubuntu-24.04-x86_64.tar.gz -C ~/
chmod +x ~/castxml/bin/castxml

- name: Setup CastXML for Linux x86_64 (Ubuntu 22.04)
if: matrix.os == 'ubuntu-22.04' && matrix.arch == 'x86_64'
run: |
wget -q -O - https://data.kitware.com/api/v1/file/hashsum/sha512/bdbb67a10c5f8d1b738cd19cb074f409d4803e8077cb8c1072ef4eaf738fa871a73643f9c8282d58cae28d188df842c82ad6620b6d590b0396a0172a27438dce/download | tar zxf - -C ~/
wget -q -O ~/castxml-ubuntu-22.04-x86_64.tar.gz https://github.com/CastXML/CastXMLSuperbuild/releases/download/v0.6.11.post1/castxml-ubuntu-22.04-x86_64.tar.gz
tar -xzf ~/castxml-ubuntu-22.04-x86_64.tar.gz -C ~/
chmod +x ~/castxml/bin/castxml

# ─── Setup CastXML for MacOS ──────────────────────────────
- name: Setup castxml for Mac
if: contains(matrix.os, 'macos')
run: |
wget -q -O - https://data.kitware.com/api/v1/file/hashsum/sha512/5d937e938f7b882a3a3e7941e68f8312d0898aaf2082e00003dd362b1ba70b98b0a08706a1be28e71652a6a0f1e66f89768b5eaa20e5a100592d5b3deefec3f0/download | tar zxf - -C ~/

- name: Run tests
run: |
export PATH=~/castxml/bin:$PATH
Expand Down
12 changes: 3 additions & 9 deletions src/pygccxml/declarations/container_traits.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ def __init__(self, unordered_maps_and_sets):
def normalize(self, type_str):
return type_str.replace(' ', '')

def replace_basic_string(self, cls_name):
@staticmethod
def replace_basic_string(cls_name):
strings = {
"std::string": string_equivalences,
"std::wstring": wstring_equivalences
Expand All @@ -48,7 +49,6 @@ def replace_basic_string(self, cls_name):
for short_name, long_names in strings.items():
for lname in long_names:
new_name = new_name.replace(lname, short_name)

return new_name

def decorated_call_prefix(self, cls_name, text, doit):
Expand Down Expand Up @@ -99,7 +99,6 @@ def erase_recursive(self, cls_name):
return self.no_end_const(cls_name)

def erase_allocator(self, cls_name, default_allocator='std::allocator'):
cls_name = self.replace_basic_string(cls_name)
c_name, c_args = templates.split(cls_name)
if len(c_args) != 2:
return
Expand All @@ -116,7 +115,6 @@ def erase_allocator(self, cls_name, default_allocator='std::allocator'):
c_name, [self.erase_recursive(value_type)])

def erase_container(self, cls_name, default_container_name='std::deque'):
cls_name = self.replace_basic_string(cls_name)
c_name, c_args = templates.split(cls_name)
if len(c_args) != 2:
return
Expand All @@ -132,7 +130,6 @@ def erase_container_compare(
cls_name,
default_container_name='std::vector',
default_compare='std::less'):
cls_name = self.replace_basic_string(cls_name)
c_name, c_args = templates.split(cls_name)
if len(c_args) != 3:
return
Expand All @@ -152,7 +149,6 @@ def erase_compare_allocator(
cls_name,
default_compare='std::less',
default_allocator='std::allocator'):
cls_name = self.replace_basic_string(cls_name)
c_name, c_args = templates.split(cls_name)
if len(c_args) != 3:
return
Expand All @@ -175,7 +171,6 @@ def erase_map_compare_allocator(
cls_name,
default_compare='std::less',
default_allocator='std::allocator'):
cls_name = self.replace_basic_string(cls_name)
c_name, c_args = templates.split(cls_name)
if len(c_args) != 4:
return
Expand Down Expand Up @@ -205,7 +200,6 @@ def erase_map_compare_allocator(
self.erase_recursive(mapped_type)])

def erase_hash_allocator(self, cls_name):
cls_name = self.replace_basic_string(cls_name)
c_name, c_args = templates.split(cls_name)
if len(c_args) < 3:
return
Expand Down Expand Up @@ -243,7 +237,6 @@ def erase_hash_allocator(self, cls_name):
c_name, [self.erase_recursive(value_type)])

def erase_hashmap_compare_allocator(self, cls_name):
cls_name = self.replace_basic_string(cls_name)
c_name, c_args = templates.split(cls_name)

if self.unordered_maps_and_sets:
Expand Down Expand Up @@ -523,6 +516,7 @@ def remove_defaults(self, type_or_string):
name = type_or_string
if not isinstance(type_or_string, str):
name = self.class_declaration(type_or_string).name
name = defaults_eraser.replace_basic_string(name)
if not self.remove_defaults_impl:
return name
no_defaults = self.remove_defaults_impl(name)
Expand Down