bschwind / opencascade-rs

Rust bindings to the OpenCascade CAD Kernel
GNU Lesser General Public License v2.1
118 stars 22 forks source link

Start work on excluding unnecessary CMake modules #91

Closed bschwind closed 1 year ago

bschwind commented 1 year ago

Goals of this PR:

I realized we can override opencascade files with the CMake BUILD_PATCH variable. I recreated the adm/MODULES directory in our patch directory and verified that CMake picks it up and uses it instead of the file in OCCT.

Next step is to modify adm/MODULES to cut out things we don't need, as well as editing occt-sys/Cargo.toml to exclude big directories that we don't use anyway.

Here's a reference to some of the CMake stuff in occt.

Depends on #112 being merged first.

strohel commented 1 year ago

I realize that this could also be a work-around for CI caching. Once we publish occt-sys to crates.io, we can depend on it through crates.io, including it in the cache (hopefully).

bschwind commented 1 year ago

Once we publish occt-sys to crates.io, we can depend on it through crates.io, including it in the cache (hopefully).

Ah yeah, if that works well then I'd much prefer that approach.

bschwind commented 1 year ago

Trying hard to cut out all unnecessary files to keep the crate size under the 10MB limit - I think we may need a different approach of splitting up toolkits into different crates. I've gotten fairly good at controlling which "toolkits" (as occt calls them) get built, but getting them all to fit in one crate is looking very difficult and time consuming to accomplish.

strohel commented 1 year ago

Issues linked to https://github.com/rust-lang/crates.io/issues/195 seem to be like a good library of workarounds people do to circumvent the limit.

bschwind commented 1 year ago

cc @mkovaxx

bschwind commented 1 year ago

@strohel if we specify occt-sys as a git dependency, will our cargo cache action cache it properly? I think we wouldn't be able to publish on crates.io with a git dependency, but maybe it would help with the caching situation?

bschwind commented 1 year ago

Merging this for now, there can be some cleanup afterwards but I want to get this in now to get CI build times down.