unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Freja Nordsiek <fnordsie@gmail.com>
To: Andy Wingo <wingo@pobox.com>
Cc: 24657-done@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	[thread overview]
Message-ID: <CAOqf98ousRjj=mmP-mvmytq-YxWXyvwhN-KzoORQMrstWiK+Kg@mail.gmail.com> (raw)
In-Reply-To: <87bmttw8cv.fsf@pobox.com>

[-- Attachment #1: Type: text/plain, Size: 2267 bytes --]

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@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@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
>

[-- Attachment #2: 0001-Fixed-reversed-version-order-bug-in-GUILE_PROGS-Auto.patch --]
[-- Type: text/x-patch, Size: 782 bytes --]

From 205f41d41b94f12670394ec526dddeaf1416d740 Mon Sep 17 00:00:00 2001
From: Freja Nordsiek <fnordsie@gmail.com>
Date: Tue, 14 Mar 2017 15:14:47 +0100
Subject: [PATCH] Fixed reversed version order bug in GUILE_PROGS Autoconf
 macro.

---
 meta/guile.m4 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/guile.m4 b/meta/guile.m4
index 4a2e285..501a21c 100644
--- a/meta/guile.m4
+++ b/meta/guile.m4
@@ -234,8 +234,8 @@ AC_DEFUN([GUILE_PROGS],
   _guile_candidates=guile
   _tmp=
   for v in `echo "$_guile_required_version" | tr . ' '`; do
-    if test -n "$_tmp"; then _tmp=.$_tmp; fi
-    _tmp=$v$_tmp
+    if test -n "$_tmp"; then _tmp=$_tmp.; fi
+    _tmp=$_tmp$v
     _guile_candidates="guile-$_tmp guile$_tmp $_guile_candidates"
   done
 
-- 
2.9.3


  parent reply	other threads:[~2017-03-14 14:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-10  9:45 bug#24657: Autoconf macro GUILE_PROGS only looks for guile without version suffix even if given version - patch included Freja Nordsiek
2017-02-23  9:43 ` Andy Wingo
2017-02-23 22:31   ` Freja Nordsiek
2017-03-14 14:25   ` Freja Nordsiek [this message]
2017-03-14 14:44     ` Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOqf98ousRjj=mmP-mvmytq-YxWXyvwhN-KzoORQMrstWiK+Kg@mail.gmail.com' \
    --to=fnordsie@gmail.com \
    --cc=24657-done@debbugs.gnu.org \
    --cc=wingo@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).