-
Notifications
You must be signed in to change notification settings - Fork 114
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
Use system nanobind if installed #880
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #880 +/- ##
==========================================
- Coverage 91.84% 90.08% -1.77%
==========================================
Files 37 64 +27
Lines 4976 9184 +4208
Branches 0 956 +956
==========================================
+ Hits 4570 8273 +3703
- Misses 406 911 +505 ☔ View full report in Codecov by Sentry. |
I think in general that fewer submodules would be great. Any reason not to remove it from |
It seems that when building using python Re. submodule, I think we can switch to |
Or maybe this is just the case when the build environment is not connected to the internet? We can add the package to nix though, it is already packaged. diff --git a/flake.nix b/flake.nix
index 05677219..3ea2dc1c 100644
--- a/flake.nix
+++ b/flake.nix
@@ -123,6 +123,7 @@
tbb
glm
clipper2
+ nanobind
];
nativeBuildInputs = with pkgs; [
cmake |
flake.nix update worked. I'll have a look at |
Now using FetchContent instead of a submodule/ |
@@ -14,7 +14,25 @@ | |||
|
|||
project(python) | |||
|
|||
add_subdirectory(third_party) | |||
execute_process( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think for nix, there is no python nanobind package. I think we can do find_package(nanobind 1.8.0 CONFIG REQUIRED)
, and if nanobind_FOUND
is not defined we can do the fetch content?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is already trying to FetchContent:
manifold-tbb> -- nanobind not found, downloading from source
manifold-tbb> CMake Error at /nix/store/q1nssraba326p2kp6627hldd2bhg254c-cmake-3.29.2/share/cmake-3.29/Modules/ExternalProject.cmake:2945 (message):
manifold-tbb> error: could not find git for clone of nanobind-populate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like this works:
@@ -35,7 +35,7 @@
cmake
ninja
(python3.withPackages
- (ps: with ps; [ trimesh pytest ]))
+ (ps: with ps; [ nanobind trimesh pytest ]))
gtest
pkg-config
]) ++ build-tools;
but build_nix_python
is still broken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK:
@@ -133,6 +133,7 @@
pkg-config
];
checkInputs = [
+ nanobind
trimesh
pytest
];
I think I saw mention of supporting system nanobind in one of the discussions, it is becoming a thing now.
This uses the recommended approach - with additional version checking.
This still falls back to the third_party directory for now, but obviously that is easily replaced. For pyproject.toml users automatically fetching nanobind is supported.