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 785257 - JHbuild should not pass global configure options if a module's --help doesn't list them
JHbuild should not pass global configure options if a module's --help doesn't...
Status: RESOLVED FIXED
Product: jhbuild
Classification: Infrastructure
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Jhbuild maintainers
Jhbuild QA
Depends on:
Blocks:
 
 
Reported: 2017-07-22 01:27 UTC by Philip Chimento
Modified: 2017-07-24 01:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
autotools: Test autogenargs against configure help (3.83 KB, patch)
2017-07-22 06:48 UTC, Philip Chimento
rejected Details | Review
autotools: Add supports-unknown-configure-options attribute (7.05 KB, patch)
2017-07-23 02:40 UTC, Philip Chimento
committed Details | Review

Description Philip Chimento 2017-07-22 01:27:11 UTC
According to https://github.com/cgwalters/build-api,

"The configure script MUST either ignore unknown options that start with --enable- and --disable-, or accept an argument --help which prints valid options."

JHbuild passes global options like --disable-Werror unconditionally, so this breaks packages (such as SpiderMonkey) that conform to the latter part of the either-or.
Comment 1 Michael Catanzaro 2017-07-22 02:47:35 UTC
In practice, we know any configure script generated by Autoconf is going to ignore the options... I guess SpiderMonkey has its own hand-rolled configure?

But if you want to grep the output of --help to make sure the argument is supported before passing it, that's fine by me. It will eliminate annoying warnings about being called with an invalid argument from other packages, too.
Comment 2 Philip Chimento 2017-07-22 06:10:26 UTC
Not so easy if there is no configure script yet, e.g. in the case of a clean git checkout of a normal Autotools-conforming module. "./autogen.sh --help" will first run autoreconf and libtoolize and all that stuff.

I guess properly we should run autogen.sh with NOCONFIGURE=1 and then run configure, testing any options that are passed automatically to it. But I'll try a simpler patch first...
Comment 3 Philip Chimento 2017-07-22 06:48:46 UTC
Created attachment 356156 [details] [review]
autotools: Test autogenargs against configure help

According to https://github.com/cgwalters/build-api,

"The configure script MUST either ignore unknown options that start with
--enable- and --disable-, or accept an argument --help which prints valid
options."

When the given autogen.sh looks like it's a configure script, try running
it with --help in order to test whether globally passed autogenargs are
supported by the script.
Comment 4 Philip Chimento 2017-07-22 06:53:10 UTC
Not wanting to call "autogen.sh --help", this only works in a very few situations; it's enough for SpiderMonkey though.
Comment 5 Michael Catanzaro 2017-07-22 15:50:34 UTC
Review of attachment 356156 [details] [review]:

Yeah, this is too specific IMO. If we're going to do this we should do it in a more general way.

I'm afraid the next problem we'll run up against is autogen scripts that don't respect the NOCONFIGURE environment variable. I suspect there's going to be way more of these than there will be hand-rolled configure scripts that error out on unexpected arguments. Probably the best thing to do here is just to patch Spidermonkey's configure script to behave sanely and move on.
Comment 6 Philip Chimento 2017-07-22 17:55:06 UTC
(In reply to Michael Catanzaro from comment #5)
> Probably the best thing to do here
> is just to patch Spidermonkey's configure script to behave sanely and move
> on.

Unfortunately they don't want to do that - https://bugzilla.mozilla.org/show_bug.cgi?id=1379540#c6

An example of commonly used packages that won't accept unknown options are zlib, openssl and libvpx.
Comment 7 Michael Catanzaro 2017-07-22 18:32:22 UTC
We can patch it downstream.

Hopefully we never have to build any of that software in JHBuild. :)
Comment 8 Philip Chimento 2017-07-22 18:47:07 UTC
> Hopefully we never have to build any of that software in JHBuild. :)

I already do, when building GNOME on macOS :-/
Comment 9 Philip Chimento 2017-07-22 19:04:00 UTC
How about a supports-unknown-configure-options="no" attribute? Similar to supports-non-srcdir-builds.
Comment 10 Michael Catanzaro 2017-07-22 19:20:35 UTC
Good idea! That's probably the best approach.
Comment 11 Philip Chimento 2017-07-23 02:40:10 UTC
Created attachment 356218 [details] [review]
autotools: Add supports-unknown-configure-options attribute

According to https://github.com/cgwalters/build-api,

"The configure script MUST either ignore unknown options that start with
--enable- and --disable-, or accept an argument --help which prints valid
options."

For packages that choose the latter in hand-rolled configure scripts, add
a module attribute: supports-unknown-configure-options="no". This is
currently used for mozjs, and is also required for building some
dependencies on macOS.
Comment 12 Michael Catanzaro 2017-07-23 13:24:52 UTC
Review of attachment 356218 [details] [review]:

:(
Comment 13 Philip Chimento 2017-07-24 01:04:32 UTC
Attachment 356218 [details] pushed as 0b8f95d - autotools: Add supports-unknown-configure-options attribute