[llvm-commits] [PATCH] Fix for DragonEgg build launcher scripts and switch to ScriptedBuilder

Duncan Sands baldrick at free.fr
Tue May 25 04:39:42 PDT 2010


Hi Galina,

> patch07.diff fixes a possible infinite loop linked with ln commands,
> and changes directory before the ln command so it could dial well with
> the relative to the build root pathes.
>
> Both buildbot_self_strap and buildbot_self_strap-32 scripts could make
> infinite loop of links on Linux if the build directories remain
> between builds. This could happen because the second time "form 3 of
> ln command" will be used.

thanks for working on this.  I don't understand what you mean by an infinite
loop of links.  What might happen is that the link gets placed inside the
pre-existing directory.

> -ln -sf $LLVM_SOURCE $BUILD_DIR/llvm
> -ln -sf $DRAGONEGG_SOURCE $BUILD_DIR/dragonegg
> +# Change the current directory to the build root.
> +cd $BUILD_DIR

Moving the "cd" up seems pointless.

> +# Create links only if target directory or link does not exists.

exists -> exist
Also, the comment is wrong, since if the target link exists you do
still create a new link.

> +if [ ! -d $BUILD_DIR/llvm ] ; then
> +   ln -sf $LLVM_SOURCE $BUILD_DIR/llvm
> +fi
> +if [ ! -d $BUILD_DIR/dragonegg ] ; then
> +   ln -sf $DRAGONEGG_SOURCE $BUILD_DIR/dragonegg
> +fi

If the source already exists as a directory, presumably something funny
is going on.  Wouldn't it be better to bail out with an error in this
case?  In fact wouldn't it be better to bail out if the target exists
and is not a symbol link?

Ciao,

Duncan.



More information about the llvm-commits mailing list