Bug 196041 - [patch] unbreak x11/gnome-shell stage-qa on FreeBSD 8
Summary: [patch] unbreak x11/gnome-shell stage-qa on FreeBSD 8
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-gnome (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-16 23:08 UTC by Don Lewis
Modified: 2015-04-28 17:29 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (gnome)


Attachments
patch to unbreak x11/gnome-shell on FreeBSD 8 by using bash for CONFIGURE_SHELL (485 bytes, patch)
2014-12-16 23:11 UTC, Don Lewis
no flags Details | Diff
escape } (448 bytes, patch)
2014-12-16 23:59 UTC, Jan Beich
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Don Lewis freebsd_committer freebsd_triage 2014-12-16 23:08:56 UTC
Attempting to build x11/gnome-shell on FreeBSD 8 fails with this error in stage-qa:

gmake[1]: Leaving directory '/wrkdirs/usr/ports/x11/gnome-shell/work/gnome-shell-3.14.2'
/bin/mkdir -p /wrkdirs/usr/ports/x11/gnome-shell/work/stage/usr/local/lib/browser_plugins/symlinks/gecko
/bin/ln -sf /usr/local/lib//libgnome-shell-browser-plugin.so /wrkdirs/usr/ports/x11/gnome-shell/work/stage/usr/local/lib/browser_plugins/symlinks/gecko/
/bin/mkdir -p /wrkdirs/usr/ports/x11/gnome-shell/work/stage/usr/local/lib/browser_plugins/symlinks/opera
/bin/ln -sf /usr/local/lib//libgnome-shell-browser-plugin.so /wrkdirs/usr/ports/x11/gnome-shell/work/stage/usr/local/lib/browser_plugins/symlinks/opera/
/bin/mkdir -p /wrkdirs/usr/ports/x11/gnome-shell/work/stage/usr/local/lib/browser_plugins/symlinks/opera-devel
/bin/ln -sf /usr/local/lib//libgnome-shell-browser-plugin.so /wrkdirs/usr/ports/x11/gnome-shell/work/stage/usr/local/lib/browser_plugins/symlinks/opera-devel/
/bin/mkdir -p /wrkdirs/usr/ports/x11/gnome-shell/work/stage/usr/local/lib/browser_plugins/symlinks/webkit-gtk2
/bin/ln -sf /usr/local/lib//libgnome-shell-browser-plugin.so /wrkdirs/usr/ports/x11/gnome-shell/work/stage/usr/local/lib/browser_plugins/symlinks/webkit-gtk2/
====> Compressing man pages (compress-man)
===========================================================================
====> Running Q/A tests (stage-qa)
====> Checking for pkg-plist issues (check-plist)
===> Parsing plist
===> Checking for items in STAGEDIR missing from pkg-plist
Error: Orphaned: %%WEBPLUGIN_DIR%%mozilla/plugins}/libgnome-shell-browser-plugin.so
===> Checking for items in pkg-plist which are not in STAGEDIR
Error: Missing: %%WEBPLUGIN_DIR%%libgnome-shell-browser-plugin.so
===> Error: Plist issues found.
*** Error code 1

Stop in /usr/ports/x11/gnome-shell.
====>> Error: check-plist failures detected
=======================<phase: Interactive    >============================


The actual error is much earlier, during configure.  Due to a bug in /bin/sh in FreeBSD 8, BROWSER_PLUGIN_DIR gets set to '/usr/local/lib//mozilla/plugins}' instead of '/usr/local/lib'.  This line in configure gives an incorrect result
when run in the FreeBSD 8 version of /bin/sh:
 BROWSER_PLUGIN_DIR="${BROWSER_PLUGIN_DIR:-"\${libdir}/mozilla/plugins"}"

# /bin/sh
# BROWSER_PLUGIN_DIR="${BROWSER_PLUGIN_DIR:-"\${libdir}/mozilla/plugins"}"
# echo $BROWSER_PLUGIN_DIR
${libdir/mozilla/plugins}

or if BROWSER_PLUGIN_DIR is already set:

env BROWSER_PLUGIN_DIR=/usr/local/lib /bin/sh
# BROWSER_PLUGIN_DIR="${BROWSER_PLUGIN_DIR:-"\${libdir}/mozilla/plugins"}"
# echo $BROWSER_PLUGIN_DIR
/usr/local/lib/mozilla/plugins}

The correct results for these two cases are '${libdir}/mozilla/plugins'
or the value of $BROWSER_PLUGIN_DIR.

The attached patch works around this problem by using bash for $CONFIGURE_SHELL.
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2014-12-16 23:08:56 UTC
Auto-assigned to maintainer gnome@FreeBSD.org
Comment 2 Don Lewis freebsd_committer freebsd_triage 2014-12-16 23:11:21 UTC
Created attachment 150654 [details]
patch to unbreak x11/gnome-shell on FreeBSD 8 by using bash for CONFIGURE_SHELL

Actually add the patch
Comment 3 Jan Beich freebsd_committer freebsd_triage 2014-12-16 23:59:43 UTC
Created attachment 150660 [details]
escape }

Is this caused by base r214492? If so try the attached workaround.
Comment 4 Don Lewis freebsd_committer freebsd_triage 2014-12-17 00:54:58 UTC
(In reply to Jan Beich from comment #3)
> Created attachment 150660 [details]
> escape }
> 
> Is this caused by base r214492? If so try the attached workaround.

Do you mean the lack of the change in r214492?  The revision history of sh/parser.c in stable/8 is:

------------------------------------------------------------------------
r221522 | jilles | 2011-05-06 05:49:32 -0700 (Fri, 06 May 2011) | 12 lines

MFC r220903: sh: Do not word split "${#parameter}".

This is only a problem if IFS contains digits, which is unusual but valid.

Because of an incorrect fix for PR bin/12137, "${#parameter}" was treated
as ${#parameter}. The underlying problem was that "${#parameter}"
erroneously added CTLESC bytes before determining the length. This
was properly fixed for PR bin/56147 but the incorrect fix was not backed
out.

Reported by:    Seeker on forums.freebsd.org

------------------------------------------------------------------------
r214113 | obrien | 2010-10-20 11:25:00 -0700 (Wed, 20 Oct 2010) | 2 lines

MFC r213811: c89 linkage and storage class (also covers r213744, r213760)



Your fix also appears to work.

The graphics/evince port also has this problem, see: <https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195943>
Comment 5 Don Lewis freebsd_committer freebsd_triage 2015-04-11 01:23:10 UTC
Even with this patch the resulting binary dies with SIGSEGV on startup.

This was run under a MATE session, hence the warning about the existing window manager.  It also dies when run by gnome-session, so attempting to start GNOME using either gdm or slim fails.

GNU gdb (GDB) 7.8.2 [GDB v7.8.2 for FreeBSD]
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i386-portbld-freebsd8.4".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from gnome-shell...(no debugging symbols found)...done.
(gdb) run
Starting program: /usr/local/bin/gnome-shell 
[New Thread 36701140 (LWP 100685 initial thread)]
[New Thread 36742140 (LWP 100226)]
[New Thread 3673fd00 (LWP 100245)]
[New Thread 3673fa80 (LWP 100838)]
[New Thread 3673fbc0 (LWP 100852)]
[New Thread 3673e900 (LWP 100991)]
[New Thread 3673e7c0 (LWP 101004)]
Window manager warning: Screen 0 on display ":0.0" already has a window manager; try using the --replace option to replace the current window manager.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 36701140 (LWP 100685 initial thread)]
0x3415f927 in meta_screen_free () from /usr/local/lib/libmutter.so.0
(gdb) bt
#0  0x3415f927 in meta_screen_free () from /usr/local/lib/libmutter.so.0
#1  0x3414b17d in meta_display_close () from /usr/local/lib/libmutter.so.0
#2  0x3414d32c in meta_display_open () from /usr/local/lib/libmutter.so.0
#3  0x34158b55 in meta_run () from /usr/local/lib/libmutter.so.0
#4  0x08049fb0 in ?? ()
#5  0x08049987 in ?? ()
#6  0x080498f8 in ?? ()
#7  0x00000000 in ?? ()
Comment 6 Don Lewis freebsd_committer freebsd_triage 2015-04-28 17:29:03 UTC
The configure script in gnome-shell-3.14.4 works properly with /bin/sh in FreeBSD 8.4.