[Scons-users] InstallVersionedLibrary sometimes fails when symlinking

Andrew C. Morrow andrew.c.morrow at gmail.com
Thu May 23 13:30:30 EDT 2013


Hi -

I've recently been experimenting with the new versioned shared library
support in SCons 2.3.0, which so far looks really nice, so thanks for that.

I have, I think, found one issue, which is that it appears that if you

- have used InstallVersionedLibrary and produced a target and symlink chain
in your install directory
- update a dependency such that the library is rebuilt
- reinstall

The build fails while attempting to write the symlinks. For my build this
looks like:

scons: done reading SConscript files.
scons: Building targets ...
Install file: "client_build/libfoo.so.2.3.4" as
"/dev/opt/lib/libfoo.so.2.3.4"
scons: *** [/dev/opt/lib/libfoo.so.2.3.4] File exists

Running under strace, it is clear that the attempt to create the symlink is
failing because it already exists in the install directory.

pid 22278] stat("client_build/libfoo.so.2.3.4", {st_mode=S_IFREG|0755,
st_size=20255704, ...}) = 0
[pid 22278] utimes("/dev/opt/lib/libfoo.so.2.3.4", {{1369328366, 0},
{1369328365, 0}}) = 0
[pid 22278] chmod("/dev/opt/lib/libfoo.so.2.3.4", 0755) = 0
[pid 22278] stat("client_build/libfoo.so.2.3.4", {st_mode=S_IFREG|0755,
st_size=20255704, ...}) = 0
[pid 22278] chmod("/dev/opt/lib/libfoo.so.2.3.4", 0755) = 0
[pid 22278] symlink("libfoo.so.2.3.4", "/dev/opt/lib/libfoo.so") = -1
EEXIST (File exists)

I think the same thing can occur in the build directory as well. If I
remove client_build/libfoo.so.2.3.4 and rebuild, I get a similar error and
strace:

scons: Building targets ...
generate_buildinfo(["build/buildinfo.cpp"], ['\n#include <string>\n#include
<boost/version.hpp>\n\n#include "mongo/util/version.h"\n\nnamespace mongo
{\n const char * gitVersion() { return "%(git_version)s"; }\n const
char * compiledJSEngine() { return "%(js_engine)s"; }\n const char *
allocator() { return "%(allocator)s"; }\n const char * loaderFlags() {
return "%(loader_flags)s"; }\n const char * compilerFlags() { return
"%(compiler_flags)s"; }\n std::string sysInfo() { return "%(sys_info)s
BOOST_LIB_VERSION=" BOOST_LIB_VERSION ; }\n} // namespace mongo\n'])
g++ <library-rebuild>
scons: *** [client_build/libfoo.so.2.3.4] File exists

strace shows a similar EEXIST error in a call to symlink.

Thanks,
Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20130523/4649586a/attachment.html>


More information about the Scons-users mailing list