2

I would like to be able to use cleartool commands on files that are symbolic links to files in a snapshot view on linux.

>cd /my/build/area/
>ls -l file.c
lrwxrwxrwx 1 sword none       123 Jun 19 16:57 file.c -> /my/snapshot/view/file.c
>cleartool co file.c
cleartool: Error: Not an object in a vob: "file.c".

Similarly, when I try to do cleartool update to do this I get

cleartool: Error: Unable to determine version for VOB root directory element
cleartool: Error: Unable to access "/my/build/area/file.c" No such file or directory."

I can cd to the view and use cleartool on a file no problem. But cleartool operations on the symlinks to the files in the view give me the error.

The reason I ask is my build environment consists of a local directory consisting of symlinks of each file to the snapshot view. Is there a way I can do this without having to cd to the snapshot view?

Note : I am using the ln -s command within the cshell to create the files in my build area. I am not using cleartool ln. I am not trying to symlink a file with a vob or to another vob.

Edit: Worth noting, the attempt to 'cleartool update' a symlink does write to the view .updt file, so while the cleartool command on the symlink does fail, some part of the tool has the view context.

swordfish45
  • 121
  • 2
  • I have updated my answer to address your comment. What kind of project are you developing within your snapshot views (Java/maven? C#, ...?) – VonC Jun 22 '17 at 18:41

2 Answers2

0

Is there a way I can do this without having to cd to the snapshot view?

Probably not: making a wrapper script which would resolve the symlink and do the appropriate checkout would be easier than trying to make cleartool co work directly on the symlink itself.


Snapshot views are stored in a common network drive that we don't want cluttered with build artifacts, and we don't need build traffic over network. Currently, we work in the 'build area' and do clearcase operations within the view. I want to make it so all operation can be done in the build area

That is a build configuration issue: you should be able to work in your ClearCase View while configuring the build for the binary to be generated in a separate folder (outside the view): no symlink should be needed.

Details:

As I mentioned in "clearcase symbolic link file not visible from a snapshot view", you can check out "Symbolic links in snapshot views":

In the context of loading a snapshot view, links are treated as VOB links (those that point to objects inside the VOB) and non-VOB links (those that point outside the VOB).

  • Hard VOB links are followed; symbolic links are copy-created. If a VOB link cannot be resolved, an error results.
  • Non-VOB links are resolved, if possible, but it is not an error if they cannot be resolved.

On Linux or the UNIX system, if a load rule selects a symbolic link, the link and the link target are copied into the snapshot view (regardless of whether a load rule selects the link target).
As with dynamic views, you cannot check out a symbolic link; you must check out the symbolic link target.

So you need to check that:

  • your symlink (not cleartool ln) can be resolved
  • your snapshot config spec has a rule loading that symlink

But in your case, you are outside a ClearCase snaphot view.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

ClearCase needs the view context to determine what the object you're pointing it at is. Since you're not in a view, it can't resolve thi link to find the actual file element.

Is there any reason you can't work IN the view?

Brian Cowan
  • 1,048
  • 6
  • 7
  • Snapshot views are stored in a common network drive that we don't want cluttered with build artifacts, and we don't need build traffic over network. Currently, we work in the 'build area' and do clearcase operations within the view. I want to make it so all operation can be done in the build area. – swordfish45 Jun 22 '17 at 17:46
  • Given the way ClearCase handles determining snapshot view contexts, you cant follow a non-ClearCase symlink into the view to execute a ClearCase command. Is there soe reason you can't use Dynamic views, which would eliminate the "clutter" issue and possibly reduce your storage requirements? Or Automatic views? – Brian Cowan Jun 29 '17 at 15:42