After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 738835 - gtk+ does not compile with dash
gtk+ does not compile with dash
Status: RESOLVED WONTFIX
Product: gtk+
Classification: Platform
Component: .General
3.14.x
Other Linux
: Normal minor
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-10-20 02:39 UTC by Maciej (Matthew) Piechotka
Modified: 2015-02-22 00:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Improve portability of ECHO (684 bytes, patch)
2014-10-25 22:07 UTC, Alexander Tsoy
none Details | Review
gtk/Makefile.am: Remove bashisms (1.48 KB, patch)
2015-02-22 00:08 UTC, Rémi Cardona
none Details | Review
gtk/Makefile.am: Remove bashisms (1.53 KB, patch)
2015-02-22 00:23 UTC, Rémi Cardona
none Details | Review

Description Maciej (Matthew) Piechotka 2014-10-20 02:39:52 UTC
After shellshock there was a movement of using simpler shells as /bin/sh (bash is great shell but it has been designed to make the user life easier, not dealing with malicious inputs from dhcp/cgi/...). This caused problem during building gtk+ as it uses -e switch which is bash extension - resulting in each line in gtk.gresource.xml being prefixed by -e and resulting in built failure.
Comment 1 Matthias Clasen 2014-10-23 02:53:47 UTC
I don't see any need to fix this, really.
Comment 2 Pacho Ramos 2014-10-23 09:57:43 UTC
Shouldn't it call directly /bin/bash instead of /bin/sh then?
Comment 3 Alexander Tsoy 2014-10-25 22:07:35 UTC
Created attachment 289325 [details] [review]
Improve portability of ECHO
Comment 4 Mike Frysinger 2014-10-31 19:21:28 UTC
POSIX itself says do not use `echo -e`.  `printf` instead is the correct answer.
Comment 5 Rémi Cardona 2014-11-30 14:35:50 UTC
@Matthias,

You may have never seen the need to fix because dash is not purposefully
compatible with Autoconf's definition of a POSIX shell. So running ./configure
with dash as /bin/sh just triggers autoconf's detection mechanism and
silently re-runs ./configure with bash.

The missing piece (LINENO support) was actually added to dash a few years ago.
And promptly reverted by Debian when build failures started coming in. We
(Gentoo) hit this issue a few weeks ago when upgrading dash, but we started
tracking these bugs instead of just reverting LINENO support.

In the case of Gnome, the issues we've found were due to "echo -e" and parameter
expansion, both are bashisms that are easily rewritten. Let me point out that
Gtk+ is not an isolated case [1] in not being fully POSIX-compliant, as
recommended by the Autoconf manual [2].

If you want to reproduce the breakage locally, you have to run ./configure with
CONFIG_SHELL=/bin/dash to prevent the bash fallback.

Our goal here is not to rid the world of bash (after all, Gentoo ebuilds are
100% bash scripts), but just to enable simpler (and hopefully safer) shells
wherever possible.

I hope this better explains where we're coming from and that you'll reconsider
the patch Alexander posted in attachment #289325 [details], as it implements a safe and
portable alternative to echo [3].

Thanks

1: https://bugs.gentoo.org/showdependencytree.cgi?id=526268&hide_resolved=0
2: https://www.gnu.org/software/automake/faq/autoconf.html#Portable-Shell
3: https://www.gnu.org/software/automake/faq/autoconf.html#echo
Comment 6 Pacho Ramos 2015-02-03 14:02:46 UTC
@Mathias, could this then be reconsidered please? (as explained in previous comments)
Comment 7 Rémi Cardona 2015-02-22 00:08:07 UTC
Created attachment 297538 [details] [review]
gtk/Makefile.am: Remove bashisms

Updated patch for 3.14.8 since 420d7414 added a call to the bash-specific "shopt".
Comment 8 Rémi Cardona 2015-02-22 00:23:13 UTC
Created attachment 297539 [details] [review]
gtk/Makefile.am: Remove bashisms