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

[question] Incremental builds #417

Open
tylerjw opened this issue Dec 22, 2020 · 4 comments
Open

[question] Incremental builds #417

tylerjw opened this issue Dec 22, 2020 · 4 comments
Labels
question Further information is requested

Comments

@tylerjw
Copy link

tylerjw commented Dec 22, 2020

This is partially related to colcon/colcon-package-selection#25. I am trying to understand when a we wouldn't be able to depend on cmake/make/ninja to handle the situation of the incremental building and would need more control over when to clean (start over) on specific targets and their dependencies. I'd like to be able to use incremental builds in CI, caching the whole workspace.

@mikepurvis
Copy link
Contributor

colcon has no visibility into what must be rebuilt— its policy is simply to call the appropriate build command for every workspace package in the proper topological order according to the build-dependency information available to it. So the baseline behaviour is that packages which are unchanged have their build command be a no-op based on whatever the internal logic of the buildsystem is (so in the make/ninja case, it's running all over the filesystem checking a bunch of timestamps). This will be much faster than an actual build, but obviously not zero time.

In a CI setting, it's possible you have more information than colcon does, and you may know (from your vcs diffs or whatever else) that particular packages have experienced no change at all since your last build. In that case, you could use colcon's various package selection capabilities to tell it to skip those ones, and then they're a true no-op.

We use a scheme like this at Clearpath to get fast incremental builds, but unfortunately it's pretty tied to a bunch of internal details on our end, so it's not really something we can open up in its present state.

@tylerjw
Copy link
Author

tylerjw commented Dec 25, 2020

How would the approach of updating the repos and running colcon build work if the dependencies changed or repos were added or removed from the workspace?

I'm wondering if the case where a repo is removed from a workspace would be particularly bad because any packages it contained would still be in the build folder and other packages could be built on top of those build products when you instead intend them to be built on Debian installed packages.

@mikepurvis
Copy link
Contributor

Adding packages to the workspace may require manually forcing CMake to rerun (--cmake-clean-cache/--cmake-force-configure) as CMake will otherwise have cached that its dep location is in the underlay rather than the workspace.

Changed deps will be picked up automatically as the timestamp on the package.xml file moves forward, which I believe signals to the CMake logic that it needs to reconfigure.

Removing packages is definitely the trickiest case; I would imagine that your safest path there would be to a clean build of any package that's down the dependency tree from a removed one.

@dirk-thomas dirk-thomas added the question Further information is requested label Dec 31, 2020
@tylerjw
Copy link
Author

tylerjw commented Jan 7, 2021

I'm curious if this would be something colcon should try to handle nicely (through some sort of statefulness from build/tests) or if we should look to build external tooling for deciding when to do what. This is related to knowing when things have changed in repositories. In this case, since the last build. In my other use-case, since the last test run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Development

No branches or pull requests

3 participants