unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#18612: [platform-testers] Emacs pretest 24.3.94
       [not found] <d57g0ji88z.fsf@fencepost.gnu.org>
@ 2014-10-02 19:22 ` Assaf Gordon
  2014-10-02 19:47   ` Eli Zaretskii
  2014-10-02 22:33   ` bug#18612: non-portable shell substitution in configure.ac Paul Eggert
  0 siblings, 2 replies; 8+ messages in thread
From: Assaf Gordon @ 2014-10-02 19:22 UTC (permalink / raw)
  To: 18612

Hello,

On 10/01/2014 09:13 PM, Glenn Morris wrote:
> The next (and hopefully final) pretest for what will be the 24.4 release
> of Emacs (the extensible text editor) is available at
>
>    ftp://alpha.gnu.org/gnu/emacs/pretest/emacs-24.3.94.tar.xz
>
> Please give it as much testing as you can.

I tested it on few systems, builds OK on all the followings (amd64, with only curses support, no X):
   Debian 7.6
   gNewSense 3.1 (based on Debian 6)
   Ubuntu 14.04.1
   Trisquel 6.0.1 (based on Ubuntu 12.04 LTS)
   OpenSUSE 13.1
   CentOS 6.5
   CentOS 7
   FreeBSD 10
   FreeBSD 9.3
   OpenBSD 5.5
   NetBSD 6.1.4
   DilOS 1.3.7 (OpenSolaris/Illumos-based)
   GNU Hurd/Debian 0.5 (i386)

"./configure" fails on MINIX R3.3.0/i386, but MINIX is not officially supported.

On thing I noticed, is that "configure.ac" (and thus "./configure")
has the following statement (line 38):
     srcdir="/${srcdir:0:1}${srcdir:2}"

I believe these are bash-specific variable expansions, not posix-compatible.

This appears in an MINGW-related "if" block, so I guess most of the time it is not encountered.
But in one instance, I got:
     $ ./configure
     ./configure: 3564: Syntax error: Bad substitution

Regards,
  - Assaf





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#18612: [platform-testers] Emacs pretest 24.3.94
  2014-10-02 19:22 ` bug#18612: [platform-testers] Emacs pretest 24.3.94 Assaf Gordon
@ 2014-10-02 19:47   ` Eli Zaretskii
  2014-10-02 20:09     ` Glenn Morris
  2014-10-02 22:33   ` bug#18612: non-portable shell substitution in configure.ac Paul Eggert
  1 sibling, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2014-10-02 19:47 UTC (permalink / raw)
  To: Assaf Gordon; +Cc: 18612

> Date: Thu, 02 Oct 2014 15:22:41 -0400
> From: Assaf Gordon <assafgordon@gmail.com>
> 
> On thing I noticed, is that "configure.ac" (and thus "./configure")
> has the following statement (line 38):
>      srcdir="/${srcdir:0:1}${srcdir:2}"
> 
> I believe these are bash-specific variable expansions, not posix-compatible.
> 
> This appears in an MINGW-related "if" block, so I guess most of the time it is not encountered.

MinGW uses only Bash.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#18612: [platform-testers] Emacs pretest 24.3.94
  2014-10-02 19:47   ` Eli Zaretskii
@ 2014-10-02 20:09     ` Glenn Morris
  2014-10-02 21:07       ` Dani Moncayo
  0 siblings, 1 reply; 8+ messages in thread
From: Glenn Morris @ 2014-10-02 20:09 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 18612, Assaf Gordon

Eli Zaretskii wrote:

>>      srcdir="/${srcdir:0:1}${srcdir:2}"
>> 
>> I believe these are bash-specific variable expansions, not posix-compatible.
>> 
>> This appears in an MINGW-related "if" block, so I guess most of the
>> time it is not encountered.
>
> MinGW uses only Bash.

But other platforms may still try to parse (?) those lines, even if they
don't execute them. Presumably that explains:

>> But in one instance, I got:
>>    $ ./configure
>>    ./configure: 3564: Syntax error: Bad substitution

So can you replace it with something portable, eg sed?





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#18612: [platform-testers] Emacs pretest 24.3.94
  2014-10-02 20:09     ` Glenn Morris
@ 2014-10-02 21:07       ` Dani Moncayo
  2014-10-02 22:06         ` Assaf Gordon
  0 siblings, 1 reply; 8+ messages in thread
From: Dani Moncayo @ 2014-10-02 21:07 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 18612, Assaf Gordon

On Thu, Oct 2, 2014 at 10:09 PM, Glenn Morris <rgm@gnu.org> wrote:
> Eli Zaretskii wrote:
>
>>>      srcdir="/${srcdir:0:1}${srcdir:2}"
>>>
>>> I believe these are bash-specific variable expansions, not posix-compatible.
>>>
>>> This appears in an MINGW-related "if" block, so I guess most of the
>>> time it is not encountered.
>>
>> MinGW uses only Bash.
>
> But other platforms may still try to parse (?) those lines, even if they
> don't execute them. Presumably that explains:
>
>>> But in one instance, I got:
>>>    $ ./configure
>>>    ./configure: 3564: Syntax error: Bad substitution


To find out if that's the case here, Assaf could run the configure
script again, with this patch applied:

--- configure 2014-10-02 22:49:51.808131800 +0200
+++ configure1 2014-10-02 23:05:37.288306300 +0200
@@ -3554,6 +3554,10 @@

 if test "x$MSYSTEM" = "xMINGW32" -o "x$MSYSTEM" = "xMINGW64"
 then
+
+  $as_echo "Too bad.  This should not be executed in this system!.
\$MSYSTEM='$MSYSTEM'" >&2
+  exit 1
+
   . $srcdir/nt/mingw-cfg.site

   case $srcdir in


...and tell us whether the script aborts at that "exit 1", and if so,
the value of $MSYSTEM.

-- 
Dani Moncayo





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#18612: [platform-testers] Emacs pretest 24.3.94
  2014-10-02 21:07       ` Dani Moncayo
@ 2014-10-02 22:06         ` Assaf Gordon
  2014-10-02 22:11           ` Assaf Gordon
  2014-10-02 22:48           ` Dani Moncayo
  0 siblings, 2 replies; 8+ messages in thread
From: Assaf Gordon @ 2014-10-02 22:06 UTC (permalink / raw)
  To: Dani Moncayo, Glenn Morris; +Cc: 18612

On 10/02/2014 05:07 PM, Dani Moncayo wrote:
> On Thu, Oct 2, 2014 at 10:09 PM, Glenn Morris <rgm@gnu.org> wrote:
>>
>> But other platforms may still try to parse (?) those lines, even if they
>> don't execute them. Presumably that explains:

<...>

> To find out if that's the case here, Assaf could run the configure
> script again, with this patch applied:

The patch itself was not enough, because it still contains the offending lines.
However, I think I managed to reduce the case to this:

=== MINIX R3.3.0 ===
$ sh -c 'echo ${a:0:1}'
sh: Syntax error: Bad substitution
$ sh -c 'true && echo ${a:0:1}'
sh: Syntax error: Bad substitution
$ sh -c 'false && echo ${a:0:1}'
sh: Syntax error: Bad substitution

=== Debian 7.6 ===
$ dash -c 'echo ${a:0:1}'
dash: 1: Bad substitution
$ dash -c 'true && echo ${a:0:1}'
dash: 1: Bad substitution
$ dash -c 'false && echo ${a:0:1}'
(no error printed)

=== NetBSD 6.1.4 ====
$ sh -c 'echo ${a:0:1}'
sh: Syntax error: Bad substitution
$ sh -c 'true && echo ${a:0:1}'
sh: Syntax error: Bad substitution
$ sh -c 'false && echo ${a:0:1}'
sh: Syntax error: Bad substitution

but:

$ ksh -c 'echo ${a:0:1}'
ksh: : bad substitution
$ ksh -c 'true && echo ${a:0:1}'
ksh: : bad substitution
$ ksh -c 'false && echo ${a:0:1}'
(no error printed)
====

The "offending" system is MINIX R3.3.0 (which isn't officially supported).
It is supposed to be MINIX kernel + NetBSD user-space,
so I'm not quite sure why "./configure" on NetBSD works while on MINIX it doesn't.
(something to do with re-exec as "ksh" ? though MINIX does have "/bin/ksh" ).

In any case, I think the examples above demonstrate that MINIX's default shell does parse the shell statements regardless of execution or not, unlike 'dash' or 'ksh'.
I don't know if this is POSIX-compliant-behaviour or not.

Regards,
  - Assaf







^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#18612: [platform-testers] Emacs pretest 24.3.94
  2014-10-02 22:06         ` Assaf Gordon
@ 2014-10-02 22:11           ` Assaf Gordon
  2014-10-02 22:48           ` Dani Moncayo
  1 sibling, 0 replies; 8+ messages in thread
From: Assaf Gordon @ 2014-10-02 22:11 UTC (permalink / raw)
  To: Dani Moncayo, Glenn Morris; +Cc: 18612

On 10/02/2014 06:06 PM, Assaf Gordon wrote:
> The "offending" system is MINIX R3.3.0 (which isn't officially supported).

Just to put things in perspective, even after fixing/avoiding this issue, emacs doesn't build on MINIX as-is,
so this issue shouldn't delay a release...







^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#18612: non-portable shell substitution in configure.ac
  2014-10-02 19:22 ` bug#18612: [platform-testers] Emacs pretest 24.3.94 Assaf Gordon
  2014-10-02 19:47   ` Eli Zaretskii
@ 2014-10-02 22:33   ` Paul Eggert
  1 sibling, 0 replies; 8+ messages in thread
From: Paul Eggert @ 2014-10-02 22:33 UTC (permalink / raw)
  To: 18612-done

Unfortunately POSIX doesn't allow that construction, even in non-executed code, 
so a strict shell is within its rights to reject it.  I installed a simple and 
localized workaround as emacs-24 bzr 117537.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#18612: [platform-testers] Emacs pretest 24.3.94
  2014-10-02 22:06         ` Assaf Gordon
  2014-10-02 22:11           ` Assaf Gordon
@ 2014-10-02 22:48           ` Dani Moncayo
  1 sibling, 0 replies; 8+ messages in thread
From: Dani Moncayo @ 2014-10-02 22:48 UTC (permalink / raw)
  To: Assaf Gordon; +Cc: 18612

>> To find out if that's the case here, Assaf could run the configure
>> script again, with this patch applied:
>
>
> The patch itself was not enough, because it still contains the offending
> lines.

Of course, because I wanted to determine whether the error was
triggered (a) at parsing time (the shell parses more code than
strictly necessary) or (b) at execution time (some problem with the
test of $MSYSTEM, which provokes the unwanted execution of
MinGW-specific code).

(It seems now clear that the answer is "a".  Thank you)

-- 
Dani Moncayo





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-10-02 22:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <d57g0ji88z.fsf@fencepost.gnu.org>
2014-10-02 19:22 ` bug#18612: [platform-testers] Emacs pretest 24.3.94 Assaf Gordon
2014-10-02 19:47   ` Eli Zaretskii
2014-10-02 20:09     ` Glenn Morris
2014-10-02 21:07       ` Dani Moncayo
2014-10-02 22:06         ` Assaf Gordon
2014-10-02 22:11           ` Assaf Gordon
2014-10-02 22:48           ` Dani Moncayo
2014-10-02 22:33   ` bug#18612: non-portable shell substitution in configure.ac Paul Eggert

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).