Fetching polyscope brings in 325MB #403
Copy link
Copy link
Closed
Description
I'm using
FetchContent_Declare(
polyscope
GIT_REPOSITORY https://github.com/nmwsharp/polyscope.git
GIT_TAG v2.6.1
# shallow
GIT_SHALLOW TRUE
)But GIT_SHALLOW doesn't do much here because of all the submodules (257MB).
Claude recommended:
FetchContent_Declare(
polyscope
GIT_REPOSITORY https://github.com/nmwsharp/polyscope.git
GIT_TAG v2.6.1
GIT_SHALLOW TRUE
GIT_SUBMODULES ""
)
FetchContent_GetProperties(polyscope)
if(NOT polyscope_POPULATED)
FetchContent_Populate(polyscope)
execute_process(
COMMAND git submodule update --init --recursive --depth 1
WORKING_DIRECTORY ${polyscope_SOURCE_DIR}
COMMAND_ERROR_IS_FATAL ANY
)
add_subdirectory(${polyscope_SOURCE_DIR} ${polyscope_BINARY_DIR})
endif()Which brings the total down to 81MB and hopefully isn't missing anything.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
nmwsharp commentedon Sep 6, 2026
This has annoyed me as well... ImGUI and GLM are the big culprits here.
#404 just merged adds the
shallowtag to the git submodules, sogit clonecommands do a shallow submodule checkout by default. (Although some git commands don't respect this)I also updated the docs to recommend a variant the CMake command you suggested. (I think the
PATCH_COMMANDis slightly preferable to the fullexecute_process.)As you say, this at least gets it down to ~80MB. Closing for now because I'm not sure what else to do. But please reopen if you or anyone else has any ideas.
nmwsharp commentedon Sep 7, 2026
I should also say: a more complete solution might be to totally stop using git submodules for our dependencies, and have Polyscope itself also fetch them via CMake. This is appealing in some ways because submodules are endlessly confusing for everyone involved.
However, I also fear it would break builds for users, which I'm really reluctant to risk. I'd at least wait for a major version bump. And I worried it might create more chaos for people who use build systems other than CMake. Happy to hear opinions on that from anyone finding this issue.