GNU bug report logs - #24657
Autoconf macro GUILE_PROGS only looks for guile without version suffix even if given version - patch included

Previous Next

Package: guile;

Reported by: Freja Nordsiek <fnordsie <at> gmail.com>

Date: Mon, 10 Oct 2016 15:20:01 UTC

Severity: normal

Done: Andy Wingo <wingo <at> pobox.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Freja Nordsiek <fnordsie <at> gmail.com>
To: Andy Wingo <wingo <at> pobox.com>
Cc: 24657-done <at> debbugs.gnu.org
Subject: bug#24657: Autoconf macro GUILE_PROGS only looks for guile without version suffix even if given version - patch included
Date: Tue, 14 Mar 2017 15:25:42 +0100
[Message part 1 (text/plain, inline)]
Found a bug in the modifications you made. Sorry for not catching this
before it got included into the Guile 2.1.8 release.

When constructing the candidates for the guile executable
(_guile_candidates), the version numbers essentially get reverse. This
is not noticeable for 2.2 since 2.2 reversed is still 2.2. But it is a
major issue for Guile 2.0.x and 1.8.x where 0.2 and 8.1 get generated
meaning the right executables could be missed. For the current version
of GUILE_PROGS, looking for 2.0 results in the following candidates

    guile-0.2 guile0.2 guile-2 guile2 guile

and for 1.8

    guile-8.1 guile8.1 guile-1 guile1 guile


The fix is luckily pretty trivial. A patch is attached.

For convenience of anyone trying to reproduce this bug, here are two
shell scripts that will take the version as the first input argument
and return the generated guile executable candidates.

The version with the bug is

    #!/bin/sh
    _guile_required_version=$1
    _guile_candidates=guile
    _tmp=
    for v in `echo "$_guile_required_version" | tr . ' '`; do
      if test -n "$_tmp"; then _tmp=.$_tmp; fi
      _tmp=$v$_tmp
      _guile_candidates="guile-$_tmp guile$_tmp $_guile_candidates"
    done
    echo $_guile_candidates

And the version with the fix is

    #!/bin/sh
    _guile_required_version=$1
    _guile_candidates=guile
    _tmp=
    for v in `echo "$_guile_required_version" | tr . ' '`; do
      if test -n "$_tmp"; then _tmp=$_tmp.; fi
      _tmp=$_tmp$v
      _guile_candidates="guile-$_tmp guile$_tmp $_guile_candidates"
    done
    echo $_guile_candidates

On Thu, Feb 23, 2017 at 10:43 AM, Andy Wingo <wingo <at> pobox.com> wrote:
> Hi Freja,
>
> Thanks for this bug report and the patch, and sorry for the delay :)
>
> On Mon 10 Oct 2016 11:45, Freja Nordsiek <fnordsie <at> gmail.com> writes:
>
>> While trying to build a package that uses guile with autotools, I
>> found a problem in the provided GUILE_PROGS macro.
>>
>> The macro searches for the executables guile, guild, guile-config, and
>> guile-tools. The problem is that even if the macro is given the
>> version, it only looks for guile, guild, etc. with no version suffix.
>
> Applied your patch with some small modifications; attached.  Let me know
> if it works for you!
>
> Andy
>
[0001-Fixed-reversed-version-order-bug-in-GUILE_PROGS-Auto.patch (text/x-patch, attachment)]

This bug report was last modified 8 years and 133 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.