BobBuildTool/bob

bob rebuilds everytime if environment changed by bob -c

Closed this issue · 3 comments

hi, we are using bob with -c argument to set configurations like:

debug.yaml:

environment:
    # default compile flags
    BASEMENT_OPTIMIZE: "0"      # compiler optimization level (0/1/2/s)
    BASEMENT_DEBUG: "1"         # generate debug symbols (0/1)
    BUILDENV_ENABLE_RPATH: "ON" # add rpath flags

and release.yaml:

environment:
    # default compile flags
    BASEMENT_OPTIMIZE: "2" # compiler optimization level (0/1/2/s)
    BASEMENT_DEBUG: "1"    # generate debug symbols (0/1)

everytime if we switch the used config, bob has to rebuild everything. for the first build, that is reasonable, but if there was already a finished build, it would be cool, if that could be reused instead of rebuilding everything.
each rebuild will take 20 minutes.

we also tried the bob out-of-tree functionality, but there we have the sources twice, which is also not comfortable to use.

You could use your own workspace name formatter plugin or change the one in basement (plugins/paths.py). If you add the content of the BASEMENT_OPTIMIZE variable to the path then builds for the different profiles will end up in different paths too. This way the build won't overwrite each other.

❤️ why this is no default ;)

I would consider this a special case. For me debugging with -O2 was not an issue. In fact, I never thought that anyone would actually change BASEMENT_OPTIMIZE for debugging. But I guess this really depends on the kind of software and I have to admit that debugging C++ on O2 is not the most pleasant experience. BTW, there is the g optimization level that might be more suited for your case. This enables basic optimizations that do not conflict with debugging.

Anyway, I'm closing the question because it's more related to the basement repository than for Bob itself.