In our company, we're using ClearCase on Windows. Since dynamic views have proven VERY slow for us, we're primarily using snapshot views.
Today we found a really nasty problem regarding symbolic links in snapshot views on Windows.
As we all know, in a snapshot view (at least on Windows) ClearCase models symlinks not via actual file system symlinks but simply as copies. That is, if your original file is /myVOB/dir/fileA.txt and /myVOB/anotherDir/fileA.txt is a symbolic link to the former, in a snapshot view the former and the latter are simply identical copies of each other. The problem now is that if you checkout and edit the original file (maybe as part of a merge operation), the change is not mirrored in any of the symlinks pointing to that file. Even a view update won't change that ... it will after you've checked-in your changes, but not before, and this is a huge problem because we're using an automated, gated check-in that automatically merges changes from a source branch into a snapshot view, runs the build and any subsequent tests and only proceeds to check-in the changes if the build and all tests were successful.
Due to the above mentioned issue, we've found that it is possible for a gated check-in (i.e. the build and tests) to succeed even though the merged changes should cause it to fail. All it takes for that to happen is the build referencing a changed file or directory not via its true, original path but via a symlink, which will cause it to see the original, unchanged rather than the changed, merged version.
Does anyone have an idea how to work around this problem other than "Just use dynamic views"?
When considering symbolic link on Windows in ClearCase snapshot views, there does not seem to be any magic solution.
One workaround would be to have a list of those symbolic link (assuming that list is relatively static and does not change often) and, before each build/test, copy the original file (if a cleartool diff
shows any difference) to those symbolic links referencing it.
antred adds in the comments:
Here's our final solution:
Perform the merge in a DYNAMIC view, do NOT check in.
Use robocopy to sync the view to a storage location on a hard drive (relatively fast), then run the build / tests from there.
If it succeeds, check-in changes in dynamic view; else undo checkouts. :)