NatLabRockies / NatLabRockies/OpenStudio
Update to latest SWIG so we can use std_string_view.i
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 646
- Forks
- 237
- Avg merge
- 3d 11h
- Merged PRs (30d)
- 10
Description
Enhancement Request
While working on:
I realized we have missing typemaps for std::string_view in Utilities, for getSharedModulePrefix() for eg
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/utilities/core/ApplicationPathHelpers.hpp around getSharedModulePrefix() and inspect the current SWIG and Conan configuration. Check how SWIG 4.2.0 provides std_string_view.i, then verify the Python binding returns a string without the reported Swig object or memory-leak warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100