[Scons-users] SCons fails to create symlinks (SHLIBVERSION)

Mats Wichmann mats at wichmann.us
Thu Feb 22 07:43:01 EST 2024


On 2/22/24 04:33, Cristian Farcas via Scons-users wrote:
> SCons v4.4.0
> 
> OS: Ubuntu 20
> 
> The following command is used:
> 
> SharedLibrary('libabc', sources, SHLIBVERSION='3')
> 
> Bus SCons fais to create the symlinks:
> 
> Create symlinks for: 'path/to/libabc.so.3'
> 
>          'path/to/libabc.so' -> 'path/to/libabc.so.3'
> 
> scons: *** [path/to/libabc.so.3] libabc.so.3: File exists
> 
> Is this a bug or am I doing something wrong?

Took a quick look, this will happen if the target (libabc.so) exists and 
is not a symlink. If it exists and *is* a symlink, it is removed first 
and things work. This seems to be the planned behavior even if it's a 
little ugly (and the message is deceptive, since it's reporting on the 
SCons target being processed, not the symlink that failed to create 
while processing the target):

         # If a file or directory exists with the same name as link, an 
OSError
         # will be thrown, which should be enough, I think. 

         env.fs.symlink(linktgt, link)

Guess: you previously built without SHLIBVERSION, then added it, 
original shlib still around?


More information about the Scons-users mailing list