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

Make tests optional + fix option declarations #366

Merged
merged 6 commits into from
Mar 14, 2023
Merged

Make tests optional + fix option declarations #366

merged 6 commits into from
Mar 14, 2023

Conversation

geoffder
Copy link
Collaborator

This breaks out the MeshIO from the tests, and makes building the tests optional. In cases where building/re-building the tests is not wanted/needed, this can shorten build times by over 25% on my machine. A major motivator for this is building 3rd party bindings using the C FFI bindings (that include an export function for convenience).

Also included here are descriptors for the option declarations, which I noticed do not actually set the default value as expected if the description argument is omitted (defaults to OFF, rather than ON for _TEST and _PYBIND for example -- on my machine anyway).

@codecov
Copy link

codecov bot commented Mar 13, 2023

Codecov Report

Patch coverage has no change and project coverage change: -4.03 ⚠️

Comparison is base (d82cf06) 89.39% compared to head (cfe8e98) 85.37%.

❗ Current head cfe8e98 differs from pull request most recent head 87d2fc9. Consider uploading reports for the commit 87d2fc9 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #366      +/-   ##
==========================================
- Coverage   89.39%   85.37%   -4.03%     
==========================================
  Files          33       36       +3     
  Lines        3979     4375     +396     
==========================================
+ Hits         3557     3735     +178     
- Misses        422      640     +218     
Impacted Files Coverage Δ
meshIO/include/meshIO.h 100.00% <ø> (ø)
meshIO/src/meshIO.cpp 0.00% <ø> (ø)

... and 14 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@geoffder
Copy link
Collaborator Author

I suspect these windows and mac failures are due to PYBIND11_FINDPYTHON actually being "correctly" set to ON. I'll give changing it explicitly to OFF a try tomorrow.

@pca006132
Copy link
Collaborator

Interesting, I did not pay much attention to the Mac and Windows CI. I think we did not install python headers for those jobs? It would be nice if we can install them and do a test for python binding.
We can also simplify the CI commands for Linux so it does not override the default values.

@geoffder
Copy link
Collaborator Author

Setting -DPYBIND11_FINDPYTHON=OFF fixed the windows build, but interestingly mac is still failing.

@geoffder
Copy link
Collaborator Author

geoffder commented Mar 13, 2023

Investigating the error being hit in the mac build, I found an issue that makes it look like it is due to newer python version deprecations in PyFrameObject. I'm trying to test this out by specifying python 3.10 (though I don't know my way around mac/brew, and so far have not successfully gotten it to use 3.10 over 3.11 from what I can tell going by reading the errors).

I wonder if this is something that has already been remedied in newer pybind11 commits (eventually the default python will increment in the other systems).

@geoffder
Copy link
Collaborator Author

The mac CI is succeeding with PYBIND11_FINDPYTHON=ON now, following update of the pybind11 submodule (#367). From reading some of the commit history since the previous stable version, I'm hopeful that the issues that I believe are stemming from python 3.11 here will be resolved.

Break out the MeshIO from the tests, and make building the tests
optional. In cases where building/re-building the tests is not
wanted/needed, this can shorten build times by over 25% on my machine.
A major motivator for this is building 3rd party bindings.

Also included here are descriptors for the option declarations, which I
noticed do not actually set the default value as expected if the
description argument is omitted (defaults to OFF, rather than ON for
_TEST and _PYBIND for example -- on my machine anyway).
Testing that a deprecation in 3.11 is indeed the source of the
breakage (other CI systems are not on such a recent python). If this
works, we should probably see about updating pybind if they have
corrected for this already.
@geoffder
Copy link
Collaborator Author

🎉 the mac is building

add_subdirectory(bindings)

if(MANIFOLD_EXPORT)
add_subdirectory(meshIO)
Copy link
Owner

Choose a reason for hiding this comment

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

I'm still a bit concerned about promoting meshIO out of the test directory. I really can't stand behind it - export is decent, but import is very shaky. Formats are a lot of work - we need to careful about the promises we make. What do you think our goal should be here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I haven't personally used it (or assimp) for import, so I have not experienced that shakiness, but I still feel having something ready to go to get designs exported is valuable (even if it is an off by default library like meshIO). If people want to try out manifold for making models to 3d print etc, it's a bit of a hurdle to then have to put together their own export solution. Requiring learning more about the library, and springing a leak in the otherwise pretty friendly abstraction that let them build their thing.

I know that you fear the presence of meshIO creating a slipperly slope into being asked to support more and more export features, I'm still of the mind that not having something available and discoverable makes Manifold less approachable. Not having the assimp wrapper of meshIO might even drive more people into the arms of stl (which I know you have a great distaste for 😉) if they decide not to depend on another library, and just write the darn mesh to file in the simplest way possible (the only export I've added to OCADml so far is ASCII and binary STL -- I know, I know).

Copy link
Owner

Choose a reason for hiding this comment

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

Yeah, that's a good point, particularly about driving users into the arms of STL. @hrgdavor I'd say 3MF is probably the best, though I'm considering an extension for glTF that would make it equally good. Maybe what this really means is we should put enough effort into meshIO that it does a decent job.

Let's go ahead with this change and take it as an action to improve the I/O.

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.

Thanks, this is looking great overall; let's discuss meshIO - I'm still not convinced it belongs in our C bindings either.

@hrgdavor
Copy link

let's discuss meshIO - I'm still not convinced it belongs in our C bindings either.

@elalish I am only watching from the side-lines, so I do not know many details. What is the recommendation for most efficient import of meshes (closest to internals for fast, and also reliable import that does not need fixing like STL)?

just a thought as an outsider, .. if meshIO is useful, and used for tests, but is not up-to snuff to be part of manifold, maybe separate it in a lib that has more limited support for issues than manifold. This would make it available to those eager to use it regardless. You would avoid the burden of supporting it too much.

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.

Thank you!

@geoffder geoffder merged commit 7c20077 into elalish:master Mar 14, 2023
@geoffder geoffder deleted the rearrange-test branch March 14, 2023 17:47
cartesian-theatrics pushed a commit to SovereignShop/manifold that referenced this pull request Mar 11, 2024
Break out the MeshIO library from the tests subdirectory, and make building the tests optional. In cases where building/re-building the tests is not wanted/needed, this can shorten build times by over 25% on my machine. A major motivator for this is building 3rd party bindings.

Also included here are descriptors for the option declarations, which I
noticed do not actually set the default value as expected if the
description argument is omitted (defaults to OFF, rather than ON for
`_TEST` and `_PYBIND` for example).
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.

4 participants