bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bootstrap symlink dependencies


From: Jim Meyering
Subject: Re: bootstrap symlink dependencies
Date: Fri, 13 May 2011 08:54:01 +0200

Pádraig Brady wrote:
> I've noticed a few times when re-running bootstrap
> within my coreutils directory, that the build will fail because
> it seems that the timestamps of the symlinks in m4/ are used,
> rather than those of the target m4 files.
>
> For example recently, @HAVE_SIGHANDLER_T@ was left unsubstituted in
> lib/signal.h. To workaround this I just removed the m4/signal_h.m4 symlink
> and re-ran bootstrap.
>
> Now it seems like honoring the symlink timestamp might be on purpose,
> since it's a little more awkward to do that, and also I notice
> that bootstrap goes to some efforts to maintain symlink timestamps.
>
> If symlink timestamps shouldn't matter, then the following should work.
> Note it doesn't seem to change my build time after a bootstrap here.
> Note also it updates symlinks in lib/*.[ch] too.
> Also, this would also suggest that whatever is adding significance
> to the symlink timetamps should be fixed too.

If something treats symlink mtime as significant,
then I suspect that it's at fault.

> diff --git a/bootstrap b/bootstrap
> index c45ae48..5ac7f25 100755
> --- a/bootstrap
> +++ b/bootstrap
> @@ -643,10 +643,8 @@ symlink_to_dir()
>          cp -fp "$src" "$dst"
>        }
>      else
> -      test -h "$dst" &&
> -      src_ls=`ls -diL "$src" 2>/dev/null` && set $src_ls && src_i=$1 &&
> -      dst_ls=`ls -diL "$dst" 2>/dev/null` && set $dst_ls && dst_i=$1 &&
> -      test "$src_i" = "$dst_i" || {
> +      rm -f "$dst"
> +      {

That looks like a good change to me, but maybe
Paul (the author of that part, I think) knows more.

Alternatively, avoid a subshell+ls while retaining semantics like this:
(untested)

  inums=`ls -diL "$src" 2>/dev/null` && set $inums &&
  test "$1" = "$3" || {

>          dot_dots=
>          case $src in
>          /*) ;;
>
> If we did want to maintain the symlink timestamps for some reason,
> then I suppose we could do something like the following,
> but I'm unsure as how to do this best portably.
>
> diff --git a/bootstrap b/bootstrap
> index c45ae48..c72d792 100755
> --- a/bootstrap
> +++ b/bootstrap
> @@ -646,6 +646,7 @@ symlink_to_dir()
>        test -h "$dst" &&
>        src_ls=`ls -diL "$src" 2>/dev/null` && set $src_ls && src_i=$1 &&
>        dst_ls=`ls -diL "$dst" 2>/dev/null` && set $dst_ls && dst_i=$1 &&
> +      test `stat -c %Y "$dst"` -ge `stat -c %Y "$src"` &&
>        test "$src_i" = "$dst_i" || {
>          dot_dots=
>          case $src in
>
> cheers,
> Pádraig.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]