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

[build] Integrate backward_cpp to test targets for enabling C++ stack trace #6697

Merged
merged 6 commits into from
Nov 28, 2022

Conversation

jim19930609
Copy link
Contributor

@jim19930609 jim19930609 commented Nov 22, 2022

Issue: #

Brief Summary

When building with -DTI_BUILD_TESTS=ON, taichi_cpp_tests,taichi_c_api_tests, taichi_python.so will link to an external library: https://github.com/bombela/backward-cpp, which enables C++ stack trace upon test failures.

Segfault with python tests

python3 test.py

image

Segfault with cpp tests

./build/taichi_cpp_tests

image

Segfault with c_api tests

./build/taichi_c_api_tests

image

@netlify
Copy link

netlify bot commented Nov 22, 2022

Deploy Preview for docsite-preview ready!

Name Link
🔨 Latest commit 43be80a
🔍 Latest deploy log https://app.netlify.com/sites/docsite-preview/deploys/63807f8d48f9bd0008f6623d
😎 Deploy Preview https://deploy-preview-6697--docsite-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Contributor

@ailzhang ailzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jim19930609 instead of coupling with TI_BUILD_TESTS, shall we add a new toggle for backward-cpp itself to make it cleaner?
For example:

  • if in CI we just set TI_WITH_BT on by default, and whatever targets (whether they're tests or not) can be built with backward-cpp.

The main reason I'm asking for it is that we may want to build a taichi in debug mode (with backtrace) and it's a bit weird to say we need to turn on TI_BUILD_TESTS which is supposed to only toggle on/off of build test targets?

@jim19930609 jim19930609 requested a review from ailzhang November 24, 2022 01:42
@jim19930609
Copy link
Contributor Author

/rebase

@jim19930609 jim19930609 requested a review from ailzhang November 25, 2022 08:40
Copy link
Contributor

@ailzhang ailzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ailzhang ailzhang merged commit 13ce3f0 into taichi-dev:master Nov 28, 2022
quadpixels pushed a commit to quadpixels/taichi that referenced this pull request May 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants