Skip to content
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

Bug: Instantiation of a single template type breaks writing of wrapped code #2

Closed
josephsnyder opened this issue Mar 27, 2020 · 0 comments · Fixed by #31
Closed

Bug: Instantiation of a single template type breaks writing of wrapped code #2

josephsnyder opened this issue Mar 27, 2020 · 0 comments · Fixed by #31
Assignees
Labels

Comments

@josephsnyder
Copy link

Hello! The following is a set of steps to reproduce the error of a bug in the writing of the wrapped code that can be reproduced in the "shapes" directory within the repository. The "wrapper_header_collection" template instantiations are not created when the total number of template replacements per substitution is 1.

Steps to reproduce:
rm -rf shapes/src/primatives
Alter shapes/wrapper/package_info.yaml to match the following diff:

diff --git a/shapes/wrapper/package_info.yaml b/shapes/wrapper/package_info.yaml
index f1cace8..d66268d 100644
--- a/shapes/wrapper/package_info.yaml
+++ b/shapes/wrapper/package_info.yaml
@@ -2,7 +2,7 @@ name: pyshapes # Unique name prepended to all modules
smart_ptr_type: std::shared_ptr
template_substitutions:

  • signature:
  • replacement: [[2], [3]]
  • replacement: [[2]]

modules:

  • name: math_funcs # Name of the module
    @@ -13,9 +13,3 @@ modules:
    source_locations:
    classes:
    • name: Point
      -- name: primitives
  • source_locations:
  • classes:
    • name: Shape
    • name: Cuboid
    • name: Rectangle

The run of cppwg

python3 wrapper/generate.py --source_root ~/Work/TRI/cppwg/shapes --wrapper_root ~/Work/TRI/cppwg/shapes/wrapper/ --castxml_binary ~/Work/TRI/CastXML/build/bin/castxml --package_info ~/Work/TRI/cppwg/shapes/wrapper/package_info.yaml --includes ~/Work/TRI/cppwg/shapes/src/

reports the following error:

> INFO: Cleaning Decls > INFO: Optimizing Decls > Generating Wrapper Code for: math_funcs Module. > Generating Wrapper Code for: geometry Module. > Generating Wrapper Code for: Point Class. > Traceback (most recent call last): > File "wrapper/generate.py", line 45, in > args.package_info, all_includes) > File "wrapper/generate.py", line 21, in generate_wrapper_code > generator.generate_wrapper() > File "/home/softhat/Work/TRI/cppwg/cppwg/generators.py", line 200, in generate_wrapper > module_writer.write() > File "/home/softhat/Work/TRI/cppwg/cppwg/writers/module_writer.py", line 112, in write > class_decl = self.source_ns.class_(fullName.replace(" ","")) > File "/home/softhat/.local/lib/python3.6/site-packages/pygccxml/declarations/scopedef.py", line 574, in class_ > recursive=recursive) > File "/home/softhat/.local/lib/python3.6/site-packages/pygccxml/declarations/scopedef.py", line 484, in _find_single > found = matcher.get_single(decl_matcher, decls, False) > File "/home/softhat/.local/lib/python3.6/site-packages/pygccxml/declarations/scopedef.py", line 87, in get_single > raise runtime_errors.declaration_not_found_t(decl_matcher) > pygccxml.declarations.runtime_errors.declaration_not_found_t: Unable to find declaration. Matcher: [(decl type==class_t) and (name==Point< 2 >)]

Thank you for making this code available!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants