- changed title to cmake.local fails for inadmissible branch names
cmake.local fails for inadmissible branch names
Not sure it's a bug, but I cannot do this
git checkout dolfin-1.3.0
./cmake.local
where dolfin-1.3.0 is the detached release (tag). The checkout is fine, but this line in cmake.local fails
BRANCH=`git branch | grep '*' | cut -d' ' -f2 | sed s:/:.:g`
I currently get around it by hardcoding $BRANCH in cmake.local. Perhaps cmake.local should be hardcoded for releases?
Comments (14)
-
-
We need to check that $BRANCH is an admissible name for the filesystem.
-
- changed milestone to 1.4
-
-
assigned issue to
-
assigned issue to
-
I use my own build script, where I map all branch names other than master and next to "wip" (work in progress). Avoids this problem and avoids buildup of ridiculous amounts of build directories. Together with ccache I think this is sufficient.
The bottleneck in my workflow is anyway the need to figure out manually when running cmake scripts is necessary, and the fact that the results of these scripts are not in the build directories.
-
Is it more efficient to have a common
wip
directory than using per-branch directories? (In terms of speed of recompilation, when ccache is used.) -
I use master, next and wip. So I build in wip while working on a topic branch, checkout next and build in next, merge, build again in next, and then I can switch back to wip without rebuilding. So multiple build dirs is useful.
But the question is, are you switching back and forth between multiple topic branches a lot? If not the savings of having a build dir for each branch are minimal. With cmake.local, every new fix-issue-nnn etc. gives a new build dir which eats away disk space and has to be manually removed. I prefer a bit slower builds over having to manually check things like that all the time.
-
In other words it's more efficient with one build dir per branch in terms of compilation time but it scales poorly in terms of disk usage and adds manual maintenance work.
-
ok, thanks. I have a lot of disk space (a couple of TB) so that is not a problem. And I occasionally run git clean -fdx anyway so those directories get cleaned out semi-automatically.
-
I am not sure how to fix this in
cmake.local
. However, instead of doing thisgit checkout dolfin-1.3.0
you can do this
git checkout -b mikaem/dolfin-1.3.0 dolfin-1.3.0
-
You could use:
git symbolic-ref --short HEAD 2> /dev/null || git describe HEAD
Which produces the branch name when on a branch, the tag name if on a checked out tag, or something like:
dolfin-1.3.0-977-g41c5bcc
If on a detached head that isn't tagged.
-
- changed milestone to 1.5
-
- changed status to resolved
Fixed in 1c320a2.
-
- removed milestone
Removing milestone: 1.5 (automated comment)
- Log in to comment