[Development] RFD: Removing environment variable support from configure

2016-03-19 Thread Thiago Macieira
See below for more details.

Summary: if CXXFLAGS is set on the environment when you run configure, the OS X 
build breaks.

This happened because we don't test the building while those flags are set.

I'm proposing we drop even checking them (configure lines 556 to 580).

If you disagree and you want to keep environment variables supported, we'll 
need a volunteer to test and maintain this functionality, on all OSes in which 
the configure script is run. And don't forget the cross-compilation 
permutations.

--  Forwarded Message  --

Subject: Re: [Interest] [OS X] Qt 5.6.0 minimal build configuration (error 
compiling qlatincodec.cpp)
Date: quinta-feira, 17 de março de 2016, 20:48:19 PDT
From: René J. V. Bertin 
To: inter...@qt-project.org

Thiago Macieira wrote:

> The proper way of adding options is to modify the mkspec's qmake.conf file

qmake.conf or .qmake.conf?

>> Checking my build scripts, I can confirm that CFLAGS and CXXFLAGS are set
>> *through the environment*, not by any direct action of mine.
> 
> Yeah, not tested. This is the cause of your problem.

A bit easy, no? I'd say either you simply ignore settings from the 
environment, 
or else you do things correctly. And that would probably mean adding settings 
from the environment to whatever flags you set yourself as I think that's the 
accepted or at least usual way to do it (even CMake does).

Anyway, I see that I had been missing a qmodule.pri edit. For some reason Qt 
5.5.1 built fine with QMAKE_CXXFLAGS="-O3 -march=native -g". After replacing 
that with QMAKE_CXXFLAGS+=etc the build now appears to be happy.

Shouldn't be too hard to generate that file using += instead of a simple = ?

> On quinta-feira, 17 de março de 2016 11:38:58 PDT Thiago Macieira wrote:
>> > - -stdlib=libc++ appear to be missing only from CXXFLAGS in the Makefiles
>> > under qtbase/src/tools
>> 
>> Hmm... those are "bootstrapped" tools. But I can't find anything that
>> overrides  QMAKE_CXXFLAGS.
> 
> Can you confirm that it *is* present in src/corelib/Makefile?

When is that file supposed to be created? I don't have it immediately after 
running configure (and now of course it *will* contain the option that was 
missing).

R.

___
Interest mailing list
inter...@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

-
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] RFD: Removing environment variable support from configure

2016-03-19 Thread Knoll Lars
Yes, let's drop this. Btw, I'm currently anyway working on changing how 
configuration handling is done for Qt, so there will be some changes in this 
area coming for Qt 5.8.

Cheers,
Lars




On 17/03/16 21:45, "Development on behalf of Thiago Macieira" 
 wrote:

>See below for more details.
>
>Summary: if CXXFLAGS is set on the environment when you run configure, the OS 
>X 
>build breaks.
>
>This happened because we don't test the building while those flags are set.
>
>I'm proposing we drop even checking them (configure lines 556 to 580).
>
>If you disagree and you want to keep environment variables supported, we'll 
>need a volunteer to test and maintain this functionality, on all OSes in which 
>the configure script is run. And don't forget the cross-compilation 
>permutations.
>
>--  Forwarded Message  --
>
>Subject: Re: [Interest] [OS X] Qt 5.6.0 minimal build configuration (error 
>compiling qlatincodec.cpp)
>Date: quinta-feira, 17 de março de 2016, 20:48:19 PDT
>From: René J. V. Bertin 
>To: inter...@qt-project.org
>
>Thiago Macieira wrote:
>
>> The proper way of adding options is to modify the mkspec's qmake.conf file
>
>qmake.conf or .qmake.conf?
>
>>> Checking my build scripts, I can confirm that CFLAGS and CXXFLAGS are set
>>> *through the environment*, not by any direct action of mine.
>> 
>> Yeah, not tested. This is the cause of your problem.
>
>A bit easy, no? I'd say either you simply ignore settings from the 
>environment, 
>or else you do things correctly. And that would probably mean adding settings 
>from the environment to whatever flags you set yourself as I think that's the 
>accepted or at least usual way to do it (even CMake does).
>
>Anyway, I see that I had been missing a qmodule.pri edit. For some reason Qt 
>5.5.1 built fine with QMAKE_CXXFLAGS="-O3 -march=native -g". After replacing 
>that with QMAKE_CXXFLAGS+=etc the build now appears to be happy.
>
>Shouldn't be too hard to generate that file using += instead of a simple = ?
>
>> On quinta-feira, 17 de março de 2016 11:38:58 PDT Thiago Macieira wrote:
>>> > - -stdlib=libc++ appear to be missing only from CXXFLAGS in the Makefiles
>>> > under qtbase/src/tools
>>> 
>>> Hmm... those are "bootstrapped" tools. But I can't find anything that
>>> overrides  QMAKE_CXXFLAGS.
>> 
>> Can you confirm that it *is* present in src/corelib/Makefile?
>
>When is that file supposed to be created? I don't have it immediately after 
>running configure (and now of course it *will* contain the option that was 
>missing).
>
>R.
>
>___
>Interest mailing list
>inter...@qt-project.org
>http://lists.qt-project.org/mailman/listinfo/interest
>
>-
>-- 
>Thiago Macieira - thiago.macieira (AT) intel.com
>  Software Architect - Intel Open Source Technology Center
>
>___
>Development mailing list
>Development@qt-project.org
>http://lists.qt-project.org/mailman/listinfo/development
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] RFD: Removing environment variable support from configure

2016-03-19 Thread Oswald Buddenhagen
On Fri, Mar 18, 2016 at 04:02:22PM +0100, Marc Mutz wrote:
> On Friday 18 March 2016 15:44:14 Oswald Buddenhagen wrote:
> > instead, configure needs to be fed these options explicitly. after all,
> > we already do it for a bunch of specific options: -I/-L/-l/-F/-fw. we
> > could add some more options like that, or alternatively parse variable
> > assignments like CXXFLAGS= and HOST_CXXFLAGS= on the command line - the
> > windows configure already does (or at least did) it for some things
> > (openssl paths, etc).
> 
> Why parse CXXFLAGS= on the command line if you can do
> 
>   MY_CXXFLAGS="$CXXFLAGS"
>   unset CXXFLAGS
> 
> ?
> 
because using real env variables for that is just plain wrong, no matter
how they are named.
the variable assignment syntax is "inspired" by what you can do with
qmake itself.
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] RFD: Removing environment variable support from configure

2016-03-19 Thread Marc Mutz
On Friday 18 March 2016 15:44:14 Oswald Buddenhagen wrote:
> instead, configure needs to be fed these options explicitly. after all,
> we already do it for a bunch of specific options: -I/-L/-l/-F/-fw. we
> could add some more options like that, or alternatively parse variable
> assignments like CXXFLAGS= and HOST_CXXFLAGS= on the command line - the
> windows configure already does (or at least did) it for some things
> (openssl paths, etc).

Why parse CXXFLAGS= on the command line if you can do

  MY_CXXFLAGS="$CXXFLAGS"
  unset CXXFLAGS

?

Thanks,
Marc


-- 
Marc Mutz  | Senior Software Engineer
KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
Tel: +49-30-521325470
KDAB - The Qt Experts
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] RFD: Removing environment variable support from configure

2016-03-19 Thread Olivier Goffart
Am Donnerstag, 17. März 2016, 21:31:27 CET schrieb Knoll Lars:
> Yes, let's drop this. Btw, I'm currently anyway working on changing how
> configuration handling is done for Qt, so there will be some changes in
> this area coming for Qt 5.8.
 
How then are we going to insert custom compiler flags?

Inserting custom compiler flags is usefull tu test new compiler features or 
such. For example testing C++11 before it was supported by Qt, testing 
analyzer toolr. Using clang plugin such as clazy or other ctatic analyzers. Or 
trying out afl (the fuzzer, ok, IIRC this was only changing $CXX and $CC).

There should be an alternative. And i don't think editing the configure script 
is a good one.
(Unless there is already an alternative which I don't know of.)

-- 
Olivier 

Woboq - Qt services and support - https://woboq.com - https://code.woboq.org

___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] RFD: Removing environment variable support from configure

2016-03-19 Thread Oswald Buddenhagen
On Thu, Mar 17, 2016 at 01:45:44PM -0700, Thiago Macieira wrote:
> Summary: if CXXFLAGS is set on the environment when you run configure, the OS 
> X 
> build breaks.
> 
> This happened because we don't test the building while those flags are set.
> 
> I'm proposing we drop even checking them (configure lines 556 to 580).
> 
we (that is, you and me) already decided that we should drop that code.
i was just reluctant to proceed now, knowing that users will see major
buildsystem-related changes soonish anyway.

https://bugreports.qt.io/browse/QTBUG-42962 is closest to a direct
indictment of this misfeature, though there are other tasks where this
is mentioned peripherally.

https://bugreports.qt.io/browse/QTBUG-32530 shows that it is implemented
incorrectly as well. https://codereview.qt-project.org/151857 forms the
basis for fixing this.

there are also some tasks which stem from this not taking cross-builds
into account.

On Fri, Mar 18, 2016 at 09:51:38AM +0100, Olivier Goffart wrote:
> How then are we going to insert custom compiler flags?
> 
as always: fork/hack the makespec.

well, actually ...
as it happens, that (mis-)feature was implemented a long time ago upon
my explicit request - unsurprisingly, to solve some very real problems.
back then, there was no git to make hacking the makespec as painless as
it can be now. not to mention that the approach isn't all that nice to
start with. so the idea was to be autoconf-like, as that's customary on
unix systems. however, it turns out that it has "side effect" ...

instead, configure needs to be fed these options explicitly. after all,
we already do it for a bunch of specific options: -I/-L/-l/-F/-fw. we
could add some more options like that, or alternatively parse variable
assignments like CXXFLAGS= and HOST_CXXFLAGS= on the command line - the
windows configure already does (or at least did) it for some things
(openssl paths, etc).

note that the approach still doesn't mix that well with the makespec
concept, which tries to be somewhat property-based (specialized
variables for particular purposes). there isn't much we can do about
that with qmake.
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development