How to split a long build into parts

I am building a large project that I don't maintain myself with a CI server to get prebuilt Windows binaries using Appveyor. That works fine, however as the project is growing in size the allowed time for a single build is exceeded (1 hour) and I am not sure how to segment the build somehow to have a project or projects for the library modules that is not run on each build and then a build for the modules in the actual project that will be done each time when a new commit is pushed.

Maybe that is possible using an internal rust repository or to use an external storage folder that is accessed for each build.
The same would also work for client tools for the project that are built with the main application as library, but apparently always build the whole project.

Have you tried using a cargo cache? I could significantly reduce build times because it basically runs an incremental build after the initial caching.
For example GitHub - Swatinem/rust-cache: A GitHub Action that implements smart caching for rust/cargo projects

You can use in a .github workflow like this

# restore cargo cache from previous runs
- name: Rust Cache
  uses: Swatinem/rust-cache@v2
3 Likes

I am currently not using Github CI, so I cannot use Actions, but I have started looking at sccache which seems to work.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.