redjack/buzzy — pull request #23 by dcreager (2013-07-26 19:04:10+00:00)
Title: Use separate build directories for dependency builds and "real" builds

"Real" build might not be the best word. I'm using that to refer to a build for the package defined in the current directory when you run `buzzy build` and friends. A dependent build is one that Buzzy does on its own to satisfy some other package's dependency. The two different types of build have different source directories: respectively, the current directory when you run `buzzy`, and some buzzy-specific clone in ~/.cache/buzzy/repos.

Why is this an issue? Buzzy constructs a build directory name from the package name and version, but there might be overlap between a dependent build and a real build. And if that happens, you end up with a cryptic error message such as:

> CMake Error: The source "/home/vagrant/.cache/buzzy/repos/taconic-3e9f1b7d/CMakeLists.txt" does not match the source "/home/vagrant/git/taconic/CMakeLists.txt" used to generate cache. Re-run cmake with a different source directory.

The workaround to this error is to remove your ~/.cache/buzzy/build directory and rerun the `buzzy build` command. But that's an ugly hack. If we use separate build directories for real and dependent builds, we should (hopefully) never run into this problem.