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

Cristian Farcas Cristian.Farcas at synopsys.com
Fri Feb 23 01:01:28 EST 2024


It works after I cleaned the old lib, built without SHLIBVERSION. Thanks!

It’s really ugly to switch from normal to versioned lib. I cannot request the whole team to do a clean everytime they checkout over my commit. So I have to ensure at each build that libabc.so is deleted if it’s not a symlink. Also, when increasing the version, untracked old version libs remain on the disk. These require special deletion as well...

From: Scons-users <scons-users-bounces at scons.org> On Behalf Of Bill Deegan
Sent: Thursday, February 22, 2024 7:05 PM
To: SCons users mailing list <scons-users at scons.org>
Subject: Re: [Scons-users] SCons fails to create symlinks (SHLIBVERSION)

try building as :scons -c, then build again.
Does that resolve the issue?

On Thu, Feb 22, 2024 at 4:43 AM Mats Wichmann <mats at wichmann.us<mailto:mats at wichmann.us>> wrote:
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?
_______________________________________________
Scons-users mailing list
Scons-users at scons.org<mailto:Scons-users at scons.org>
https://pairlist4.pair.net/mailman/listinfo/scons-users<https://urldefense.com/v3/__https:/pairlist4.pair.net/mailman/listinfo/scons-users__;!!A4F2R9G_pg!e9o5aTWE77KLugybB_2m41ZsRaDnpwLFxZQ2aSsJu0ouACWtS6OGNUUdw4jeozQwMVe2uZPr946EU-xG-fSa-WtVruk$>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20240223/eb210b20/attachment-0001.htm>


More information about the Scons-users mailing list