Skip to content

Update to latest SWIG so we can use std_string_view.i #5393

@jmarrec

Description

@jmarrec

Enhancement Request

While working on:

I realized we have missing typemaps for std::string_view in Utilities, for getSharedModulePrefix() for eg

https://github.com/NREL/OpenStudio/blob/a882f64d0989414b26e18dc071415740ee92c43c/src/utilities/core/ApplicationPathHelpers.hpp#L54-L60

This is also the same thing for Python mind you.

In [1]: import openstudio
ope
In [2]: openstudio.getSharedModulePrefix()
Out[2]: <Swig Object of type 'std::string_view *' at 0x7664d3189d40>

In [3]: print(openstudio.getSharedModulePrefix())
<Swig Object of type 'std::string_view *' at 0x7664ba3ccd50>
swig/python detected a memory leak of type 'std::string_view *', no destructor found.

Detailed Description

Swig 4.2.0 added a std_string_view.i (which is NOT in stl.i by default I think).

Possible Implementation

I am diffing the conan-center-index recipe that is currently used upstream with the custom one I used to upload to NREL's artifactory, and I'm not seeing minimal diffs, so there's a good chance it'll work right out of the box.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions