Skip to content

PRSS#2

Closed
mrjackv wants to merge 8 commits into
revng:basefrom
mrjackv:feature/prss
Closed

PRSS#2
mrjackv wants to merge 8 commits into
revng:basefrom
mrjackv:feature/prss

Conversation

@mrjackv
Copy link
Copy Markdown

@mrjackv mrjackv commented Apr 24, 2026

Note: this is just a rebase on top of the base branch, no changes have been made

@mrjackv mrjackv mentioned this pull request Apr 24, 2026
mrjackv added 8 commits May 11, 2026 13:41
Add an additional `CMakeLists.txt` file which allows building nanobind
as a standalone project, installing `libnanobind.so` under `/lib` and
headers under `/include`.
Drop the use of `typeid` and `std::type_info` from the codebase, they
are now replaced with a thin shim through `shimTypeid<T>` and
`shim::type_info`.
Search and replace all uses of uses of `std::type_info` and
`typeid(...)` from the codebase and replace them with the shimmed
functions/classes implemented in the previous commit. This commit can
be regenerated during a rebase by running the following command:

```
find src include -type f \
    \( -name '*.h' -or -name '*.cpp' \) \
    -exec sed -i \
        -e 's;std::type_info;shim::type_info;g' \
        -e 's;typeid(\*ptr);typeidShim(*ptr);g' \
        -e 's;typeid(\([^)]\+\));typeidShim<\1>();g' {} \;
```
Drop the use of exceptions from the codebase. Where needed add an
`abort`.
Search and replace all exception-related code (`try`, `catch`, `throw`)
and replace their use with functions/classes implemented in the previous
commit. This commit can be regenerated during a rebase by running the
following command:

```
find src include -type f \
    \( -name '*.h' -or -name '*.cpp' \) \
    -exec sed -i \
        -e 's|try {|if (true) {|g' \
        -e 's|catch (.*&\s*\(.\+\)) {|if (false) { shim::exception_placeholder \1;|g' \
        -e 's|catch (.*) {|if (false) {|g' \
        -e 's|throw \(.*\);$|throwShim(\1);|g' {} \;
```
Add extra compiler flags that make the compiler stricter.
Remove the `hidden` attribute from the nanobind namespace, as it was
causing linking problems.
@mrjackv
Copy link
Copy Markdown
Author

mrjackv commented May 21, 2026

Closing as this PR was merged as part of feature/python-3.14

@mrjackv mrjackv closed this May 21, 2026
@mrjackv mrjackv deleted the feature/prss branch May 22, 2026 09:29
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 this pull request may close these issues.

2 participants