8000 Fix MANIFOLD_DEBUG guards for Read/Write OBJ api by starseeker · Pull Request #1226 · elalish/manifold · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix MANIFOLD_DEBUG guards for Read/Write OBJ api #1226

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

Merged
merged 1 commit into from
Apr 13, 2025

Conversation

starseeker
Copy link
Contributor

No description provided.

Copy link
codecov bot commented Apr 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.19%. Comparing base (b8dd573) to head (c15c787).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1226   +/-   ##
=======================================
  Coverage   92.19%   92.19%           
=======================================
  Files          31       31           
  Lines        5985     5985           
=======================================
  Hits         5518     5518           
  Misses        467      467           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

static Manifold ReadOBJ(std::istream& stream);
bool WriteOBJ(std::ostream& stream) const;
#endif
Copy link
Owner
@elalish elalish Apr 12, 2025

Choose a reason for hiding this comment

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

I'm honestly curious, from a consumer's perspective - is this more convenient? This way if you write code that uses these and then change your CMake flag, it'll suddenly stop compiling. The old way it would just fail to run. Which do we think is better behavior?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Good question. I am a PL guy, so I want more static guarantees. But from a user perspective, failing the compilation may not be the best way...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the headers are going to be behind the MANIFOLD_DEBUG guard, don't these methods need to be too? Otherwise user code might not compile anyway due to not having the necessary includes?

Copy link
Owner

Choose a reason for hiding this comment

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

Oh right, the point is to not include the stream definitions, so we do have to guard them this way. I suppose finding out about problems earlier (compilation) is better than later (runtime).

static Manifold ReadOBJ(std::istream& stream);
bool WriteOBJ(std::ostream& stream) const;
#endif
Copy link
Owner

Choose a reason for hiding this comment

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

Oh right, the point is to not include the stream definitions, so we do have to guard them this way. I suppose finding out about problems earlier (compilation) is better than later (runtime).

@@ -720,7 +720,6 @@ std::ostream& operator<<(std::ostream& stream, const Manifold::Impl& impl) {
* Write function.
*/
Manifold Manifold::ReadOBJ(std::istream& stream) {
Copy link
Owner

Choose a reason for hiding this comment

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

Don't we have to guard the implementations the same way as the headers?

Copy link
Owner

Choose a reason for hiding this comment

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

Maybe pull master and check - I feel like this won't compile as is with MANIFOLD_DEBUG=OFF, or else I'm missing something about how these compilers work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes we do - there is an ifdef MANIFOLD_DEBUG guarding the whole block on line 685. I forgot to remove it when I added the method internal versions in the previous commit, so I didn't need to re-add it here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Come to think of it - do all the CI tests have MANIFOLD_DEBUG=ON?

Copy link
Owner
@elalish elalish left a comment

Choose a reason for hiding this comment

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

Ah, got it, thanks!

@elalish elalish merged commit 4ba67b8 into elalish:master Apr 13, 2025
27 checks passed
@elalish elalish mentioned this pull request May 14, 2025
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.

3 participants
0