all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Should configure fail if pkg-config fails?
@ 2012-01-24 21:58 Jordi Gutiérrez Hermoso
  2012-01-24 22:26 ` Paul Eggert
  0 siblings, 1 reply; 8+ messages in thread
From: Jordi Gutiérrez Hermoso @ 2012-01-24 21:58 UTC (permalink / raw
  To: Emacs development discussions

Today while trying to build the Emacs 24 alpha, I discovered that I
had messed up some things in my local Debian system and pkg-config was
failing. I didn't notice this until I was well into the build system.
The configure script didn't immediately report that something was
wrong, and didn't exit with nonzero status.

Shouldn't the configure script emit a clear warning if pkg-config fails?

Thanks,
- Jordi G. H.



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

* Re: Should configure fail if pkg-config fails?
  2012-01-24 21:58 Should configure fail if pkg-config fails? Jordi Gutiérrez Hermoso
@ 2012-01-24 22:26 ` Paul Eggert
  2012-01-24 22:42   ` Jordi Gutiérrez Hermoso
  0 siblings, 1 reply; 8+ messages in thread
From: Paul Eggert @ 2012-01-24 22:26 UTC (permalink / raw
  To: Jordi Gutiérrez Hermoso; +Cc: Emacs development discussions

On 01/24/2012 01:58 PM, Jordi Gutiérrez Hermoso wrote:
> Shouldn't the configure script emit a clear warning if pkg-config fails?

Could be.  What exactly was the failure?



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

* Re: Should configure fail if pkg-config fails?
  2012-01-24 22:26 ` Paul Eggert
@ 2012-01-24 22:42   ` Jordi Gutiérrez Hermoso
  2012-01-24 22:49     ` Paul Eggert
  0 siblings, 1 reply; 8+ messages in thread
From: Jordi Gutiérrez Hermoso @ 2012-01-24 22:42 UTC (permalink / raw
  To: Paul Eggert; +Cc: Emacs development discussions

2012/1/24 Paul Eggert <eggert@cs.ucla.edu>:
> On 01/24/2012 01:58 PM, Jordi Gutiérrez Hermoso wrote:
>> Shouldn't the configure script emit a clear warning if pkg-config fails?
>
> Could be.  What exactly was the failure?

One of the .pc files relevant to GTK+ was in the wrong location
because I stupidly mixed Debian packages from different Debian
releases. Newer packages put the the .pc files in a different
location. pkg-config produced an error message to stderrr and exited
with nonzero status, but the configure script didn't pick this up.

- Jordi G. H.



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

* Re: Should configure fail if pkg-config fails?
  2012-01-24 22:42   ` Jordi Gutiérrez Hermoso
@ 2012-01-24 22:49     ` Paul Eggert
  2012-01-25  2:15       ` Jordi Gutiérrez Hermoso
  0 siblings, 1 reply; 8+ messages in thread
From: Paul Eggert @ 2012-01-24 22:49 UTC (permalink / raw
  To: Jordi Gutiérrez Hermoso; +Cc: Emacs development discussions

On 01/24/2012 02:42 PM, Jordi Gutiérrez Hermoso wrote:
> pkg-config produced an error message to stderrr and exited
> with nonzero status

Which invocation of pkg-config was it, exactly?
What arguments were passed to pkg-config?
What was the diagnostic message? and the exit status?
Those of the sorts of things we'd need to look at,
to avoid this problem in the future.

'configure' can't simply exit whenever pkg-config returns
a nonzero exit status; sometimes pkg-config is *supposed*
to return a nonzero exit status.



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

* Re: Should configure fail if pkg-config fails?
  2012-01-24 22:49     ` Paul Eggert
@ 2012-01-25  2:15       ` Jordi Gutiérrez Hermoso
  2012-01-28  9:07         ` bug#10626: " Paul Eggert
  0 siblings, 1 reply; 8+ messages in thread
From: Jordi Gutiérrez Hermoso @ 2012-01-25  2:15 UTC (permalink / raw
  To: Paul Eggert; +Cc: Emacs development discussions

2012/1/24 Paul Eggert <eggert@cs.ucla.edu>:
> On 01/24/2012 02:42 PM, Jordi Gutiérrez Hermoso wrote:
>> pkg-config produced an error message to stderrr and exited
>> with nonzero status
>
> Which invocation of pkg-config was it, exactly?
> What arguments were passed to pkg-config?

pkg-config --cflags --libs gtk+-2.0

> What was the diagnostic message?

Package pixman-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `pixman-1.pc'
to the PKG_CONFIG_PATH environment variable
Package 'pixman-1', required by 'cairo', not found

> and the exit status?

1

> 'configure' can't simply exit whenever pkg-config returns
> a nonzero exit status; sometimes pkg-config is *supposed*
> to return a nonzero exit status.

No, but it shouldn't assume that GTK+ is working correctly if
pkg-config returns nonzero exit status.

- Jordi G. H.



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

* bug#10626: Should configure fail if pkg-config fails?
  2012-01-25  2:15       ` Jordi Gutiérrez Hermoso
@ 2012-01-28  9:07         ` Paul Eggert
  2012-03-21 19:54           ` Jordi Gutiérrez Hermoso
  0 siblings, 1 reply; 8+ messages in thread
From: Paul Eggert @ 2012-01-28  9:07 UTC (permalink / raw
  To: Jordi Gutiérrez Hermoso; +Cc: 10626

On 01/24/2012 06:15 PM, Jordi Gutiérrez Hermoso wrote:
> it shouldn't assume that GTK+ is working correctly if
> pkg-config returns nonzero exit status.

True enough.  Here's a proposed patch, which I'd like to
install into the trunk.  I'm CC'ing this to bug-gnu-emacs
instead of to emacs-devel, so that it has a proper bug number.


=== modified file 'ChangeLog'
--- ChangeLog	2012-01-19 07:21:25 +0000
+++ ChangeLog	2012-01-28 09:04:13 +0000
@@ -1,3 +1,11 @@
+2012-01-28  Paul Eggert  <eggert@cs.ucla.edu>
+
+	Check pkg-config exit status when configuring.
+	* configure.in (PKG_CHECK_MODULES): Do not assume that pkg-config
+	works; check its exit status.  Problem reported by Jordi Gutiérrez
+	Hermoso in
+	<http://lists.gnu.org/archive/html/emacs-devel/2012-01/msg00787.html>.
+
 2012-01-16  Juanma Barranquero  <lekktu@gmail.com>
 
 	* .bzrignore: Ignore etc/__pycache__.

=== modified file 'configure.in'
--- configure.in	2012-01-19 07:21:25 +0000
+++ configure.in	2012-01-28 09:04:13 +0000
@@ -1124,17 +1124,14 @@
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
         AC_MSG_CHECKING(for $2)
 
-        if $PKG_CONFIG --exists "$2" 2>&AS_MESSAGE_LOG_FD; then
-            AC_MSG_RESULT(yes)
+        if $PKG_CONFIG --exists "$2" 2>&AS_MESSAGE_LOG_FD &&
+	   $1_CFLAGS=`$PKG_CONFIG --cflags "$2" 2>&AS_MESSAGE_LOG_FD` &&
+	   $1_LIBS=`$PKG_CONFIG --libs "$2" 2>&AS_MESSAGE_LOG_FD`; then
+
+	    $1_CFLAGS=`AS_ECHO(["$$1_CFLAGS"]) | sed -e 's,///*,/,g'`
+	    $1_LIBS=`AS_ECHO(["$$1_LIBS"]) | sed -e 's,///*,/,g'`
+            AC_MSG_RESULT([yes CFLAGS='$$1_CFLAGS' LIBS='$$1_LIBS'])
             succeeded=yes
-
-            AC_MSG_CHECKING($1_CFLAGS)
-            $1_CFLAGS=`$PKG_CONFIG --cflags "$2"|sed -e 's,///*,/,g'`
-            AC_MSG_RESULT($$1_CFLAGS)
-
-            AC_MSG_CHECKING($1_LIBS)
-            $1_LIBS=`$PKG_CONFIG --libs "$2"|sed -e 's,///*,/,g'`
-            AC_MSG_RESULT($$1_LIBS)
         else
             AC_MSG_RESULT(no)
             $1_CFLAGS=""






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

* bug#10626: Should configure fail if pkg-config fails?
  2012-01-28  9:07         ` bug#10626: " Paul Eggert
@ 2012-03-21 19:54           ` Jordi Gutiérrez Hermoso
  2012-04-07 20:48             ` Paul Eggert
  0 siblings, 1 reply; 8+ messages in thread
From: Jordi Gutiérrez Hermoso @ 2012-03-21 19:54 UTC (permalink / raw
  To: Paul Eggert; +Cc: 10626

Hi, sorry for the late reply.

2012/1/28 Paul Eggert <eggert@cs.ucla.edu>:
> On 01/24/2012 06:15 PM, Jordi Gutiérrez Hermoso wrote:
>> it shouldn't assume that GTK+ is working correctly if
>> pkg-config returns nonzero exit status.
>
> True enough.  Here's a proposed patch, which I'd like to
> install into the trunk.  I'm CC'ing this to bug-gnu-emacs
> instead of to emacs-devel, so that it has a proper bug number.
>
>
> === modified file 'ChangeLog'
> --- ChangeLog   2012-01-19 07:21:25 +0000
> +++ ChangeLog   2012-01-28 09:04:13 +0000
> @@ -1,3 +1,11 @@
> +2012-01-28  Paul Eggert  <eggert@cs.ucla.edu>
> +
> +       Check pkg-config exit status when configuring.
> +       * configure.in (PKG_CHECK_MODULES): Do not assume that pkg-config
> +       works; check its exit status.  Problem reported by Jordi Gutiérrez
> +       Hermoso in
> +       <http://lists.gnu.org/archive/html/emacs-devel/2012-01/msg00787.html>.
> +
>  2012-01-16  Juanma Barranquero  <lekktu@gmail.com>
>
>        * .bzrignore: Ignore etc/__pycache__.
>
> === modified file 'configure.in'
> --- configure.in        2012-01-19 07:21:25 +0000
> +++ configure.in        2012-01-28 09:04:13 +0000
> @@ -1124,17 +1124,14 @@
>      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
>         AC_MSG_CHECKING(for $2)
>
> -        if $PKG_CONFIG --exists "$2" 2>&AS_MESSAGE_LOG_FD; then
> -            AC_MSG_RESULT(yes)
> +        if $PKG_CONFIG --exists "$2" 2>&AS_MESSAGE_LOG_FD &&
> +          $1_CFLAGS=`$PKG_CONFIG --cflags "$2" 2>&AS_MESSAGE_LOG_FD` &&
> +          $1_LIBS=`$PKG_CONFIG --libs "$2" 2>&AS_MESSAGE_LOG_FD`; then
> +
> +           $1_CFLAGS=`AS_ECHO(["$$1_CFLAGS"]) | sed -e 's,///*,/,g'`
> +           $1_LIBS=`AS_ECHO(["$$1_LIBS"]) | sed -e 's,///*,/,g'`
> +            AC_MSG_RESULT([yes CFLAGS='$$1_CFLAGS' LIBS='$$1_LIBS'])
>             succeeded=yes
> -
> -            AC_MSG_CHECKING($1_CFLAGS)
> -            $1_CFLAGS=`$PKG_CONFIG --cflags "$2"|sed -e 's,///*,/,g'`
> -            AC_MSG_RESULT($$1_CFLAGS)
> -
> -            AC_MSG_CHECKING($1_LIBS)
> -            $1_LIBS=`$PKG_CONFIG --libs "$2"|sed -e 's,///*,/,g'`
> -            AC_MSG_RESULT($$1_LIBS)
>         else
>             AC_MSG_RESULT(no)
>             $1_CFLAGS=""
>

This patch no longer applies today (sigh, Changelog conflicts), and
I'm a bit lazy about figuring out how to rebase this.

I trust your good judgement, so I say you just push this.

Thanks,
- Jordi G. H.





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

* bug#10626: Should configure fail if pkg-config fails?
  2012-03-21 19:54           ` Jordi Gutiérrez Hermoso
@ 2012-04-07 20:48             ` Paul Eggert
  0 siblings, 0 replies; 8+ messages in thread
From: Paul Eggert @ 2012-04-07 20:48 UTC (permalink / raw
  To: Jordi Gutiérrez Hermoso; +Cc: 10626-done

On 03/21/2012 12:54 PM, Jordi Gutiérrez Hermoso wrote:
> I trust your good judgement, so I say you just push this.

Thanks, I waited until the trunk was open for small
non-regression fixes like this, and just now pushed
it as bzr 107794 in the trunk.  I'm marking the bug as done.

http://bzr.savannah.gnu.org/lh/emacs/trunk/revision/107794





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

end of thread, other threads:[~2012-04-07 20:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-24 21:58 Should configure fail if pkg-config fails? Jordi Gutiérrez Hermoso
2012-01-24 22:26 ` Paul Eggert
2012-01-24 22:42   ` Jordi Gutiérrez Hermoso
2012-01-24 22:49     ` Paul Eggert
2012-01-25  2:15       ` Jordi Gutiérrez Hermoso
2012-01-28  9:07         ` bug#10626: " Paul Eggert
2012-03-21 19:54           ` Jordi Gutiérrez Hermoso
2012-04-07 20:48             ` Paul Eggert

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.