Discussion:
[Scons-users] qt4 tool and scons 3.0
Pierre-Luc Boily
2017-10-03 13:52:39 UTC
Permalink
I did not yet investigate that much, but I want to know if some people
experience same thing as me.

So, I switched to python 3.6.2 and scons 3.0. I had to use python 3 tool
that migrates my files to 2.x to 3.x. I had to do the same thing for qt4
tool files.

Then, my compilation is not working anymore, it looks like that the moc is
no longer being generated by qt4.

Anyone had encounter that problem?

thx



--
Sent from: http://scons.1086193.n5.nabble.com/Users-f16930.html
Bill Deegan
2017-10-03 13:56:32 UTC
Permalink
Can you provide some more information?
Which OS?
A snippet of your build log showing the issue?
Output of scons --tree=prune <target which is not getting built>
Post by Pierre-Luc Boily
I did not yet investigate that much, but I want to know if some people
experience same thing as me.
So, I switched to python 3.6.2 and scons 3.0. I had to use python 3 tool
that migrates my files to 2.x to 3.x. I had to do the same thing for qt4
tool files.
Then, my compilation is not working anymore, it looks like that the moc is
no longer being generated by qt4.
Anyone had encounter that problem?
thx
--
Sent from: http://scons.1086193.n5.nabble.com/Users-f16930.html
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Pierre-Luc Boily
2017-10-03 15:12:51 UTC
Permalink
windows 7.

Paste bin from scons 3.0 with python 3.6.2 : https://pastebin.com/6LrJknRj
Paste bin from scons 2.5.1 with python 2.7.13 :
https://pastebin.com/GNmcr1QX

moc file is not even part of the tree from scons 3.0 tree

I'll have to take a look what C:\\Python36\\Tools\\scripts\\2to3.py did to
qt4_tool files. I guess it is where the problem is.

thx



--
Sent from: http://scons.1086193.n5.nabble.com/Users-f16930.html
Bill Deegan
2017-10-03 15:40:40 UTC
Permalink
Can you pastebin the 2to3'd qt4_tool files?
Post by Pierre-Luc Boily
windows 7.
Paste bin from scons 3.0 with python 3.6.2 : https://pastebin.com/6LrJknRj
https://pastebin.com/GNmcr1QX
moc file is not even part of the tree from scons 3.0 tree
I'll have to take a look what C:\\Python36\\Tools\\scripts\\2to3.py did to
qt4_tool files. I guess it is where the problem is.
thx
--
Sent from: http://scons.1086193.n5.nabble.com/Users-f16930.html
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Pierre-Luc Boily
2017-10-03 15:55:52 UTC
Permalink
Only 3 files have been modified by 2to3 :

Changes look minor for me, maybe I am wrong:

__init__.py : https://pastebin.com/4LRdbtaS
sconstest-copied-env.py : https://pastebin.com/LFCG6QTj
create_scons_tests.py : https://pastebin.com/Uu0S9ccB



--
Sent from: http://scons.1086193.n5.nabble.com/Users-f16930.html
Bill Deegan
2017-10-03 17:23:45 UTC
Permalink
Can you pastebin the diffs for each (before and after you ran 2to3)?
Post by Pierre-Luc Boily
__init__.py : https://pastebin.com/4LRdbtaS
sconstest-copied-env.py : https://pastebin.com/LFCG6QTj
create_scons_tests.py : https://pastebin.com/Uu0S9ccB
--
Sent from: http://scons.1086193.n5.nabble.com/Users-f16930.html
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Pierre-Luc Boily
2017-10-03 18:04:26 UTC
Permalink
Sure !

__init__.py : https://pastebin.com/VwBm1DCU
sconstest-copied-env.py : https://pastebin.com/T64K3sWu
create_scons_tests.py : https://pastebin.com/axf9zwHm

thx



--
Sent from: http://scons.1086193.n5.nabble.com/Users-f16930.html
Bill Deegan
2017-10-03 18:34:15 UTC
Permalink
I think if you change .get_contents() to .get_text_contents() in the
__init__.py (it occurs several places), it may work.

get_contents() returns bytes, get_text_contents() returns strings
Post by Bill Deegan
Can you pastebin the diffs for each (before and after you ran 2to3)?
On Tue, Oct 3, 2017 at 8:55 AM, Pierre-Luc Boily <
Post by Pierre-Luc Boily
__init__.py : https://pastebin.com/4LRdbtaS
sconstest-copied-env.py : https://pastebin.com/LFCG6QTj
create_scons_tests.py : https://pastebin.com/Uu0S9ccB
--
Sent from: http://scons.1086193.n5.nabble.com/Users-f16930.html
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Bill Deegan
2017-10-03 18:36:11 UTC
Permalink
Would this bit at the end which is commented out affect your build?

-#Last edited : Bilal Itani - Fix to variant dir issue with qrc generated
in source tree rather than being generated in build tree
-#according to
https://bitbucket.org/dirkbaechle/scons_qt4/issues/10/qt4-generates-qrc_cc-files-in-the-wrong
def __qrc_path(head, prefix, tail, suffix):
- if head:
- if tail:
- return os.path.join(head, "%s%s%s" % (prefix, tail, suffix))
- else:
- return "%s%s%s" % (prefix, head, suffix)
- else:
- return "%s%s%s" % (prefix, tail, suffix)
+ if head:
+ if tail:
+ return "%s%s%s" % (prefix, tail, suffix)#os.path.join(head,
"%s%s%s" % (prefix, tail, suffix))
+ # else:
+ # return "%s%s%s" % (prefix, head, suffix)
+ #else:
+ # return "%s%s%s" % (prefix, tail, suffix)
Post by Bill Deegan
I think if you change .get_contents() to .get_text_contents() in the
__init__.py (it occurs several places), it may work.
get_contents() returns bytes, get_text_contents() returns strings
Post by Bill Deegan
Can you pastebin the diffs for each (before and after you ran 2to3)?
On Tue, Oct 3, 2017 at 8:55 AM, Pierre-Luc Boily <
Post by Pierre-Luc Boily
__init__.py : https://pastebin.com/4LRdbtaS
sconstest-copied-env.py : https://pastebin.com/LFCG6QTj
create_scons_tests.py : https://pastebin.com/Uu0S9ccB
--
Sent from: http://scons.1086193.n5.nabble.com/Users-f16930.html
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Pierre-Luc Boily
2017-10-03 19:16:16 UTC
Permalink
Thx, get_text_contents() resolved the problem. Moc files are properly
generated now.

As for the fix that you were wondering if it might affect my build, I
decided to remove the fix and see. Everything builds fine and is generated
where it needs to.

Otherwise, I was wondering why going from scons 2 to 3 broke the moc
feature? I am not sure to understand...

thx a lot for your help, really appreciated!
Post by Bill Deegan
Would this bit at the end which is commented out affect your build?
-#Last edited : Bilal Itani - Fix to variant dir issue with qrc generated
in source tree rather than being generated in build tree
-#according to https://bitbucket.org/dirkbaechle/scons_qt4/issues/
10/qt4-generates-qrc_cc-files-in-the-wrong
- return os.path.join(head, "%s%s%s" % (prefix, tail, suffix))
- return "%s%s%s" % (prefix, head, suffix)
- return "%s%s%s" % (prefix, tail, suffix)
+ return "%s%s%s" % (prefix, tail, suffix)#os.path.join(head,
"%s%s%s" % (prefix, tail, suffix))
+ # return "%s%s%s" % (prefix, head, suffix)
+ # return "%s%s%s" % (prefix, tail, suffix)
Post by Bill Deegan
I think if you change .get_contents() to .get_text_contents() in the
__init__.py (it occurs several places), it may work.
get_contents() returns bytes, get_text_contents() returns strings
Post by Bill Deegan
Can you pastebin the diffs for each (before and after you ran 2to3)?
On Tue, Oct 3, 2017 at 8:55 AM, Pierre-Luc Boily <
Post by Pierre-Luc Boily
__init__.py : https://pastebin.com/4LRdbtaS
sconstest-copied-env.py : https://pastebin.com/LFCG6QTj
create_scons_tests.py : https://pastebin.com/Uu0S9ccB
--
Sent from: http://scons.1086193.n5.nabble.com/Users-f16930.html
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Thomas Berg
2017-10-04 17:30:52 UTC
Permalink
Post by Pierre-Luc Boily
Thx, get_text_contents() resolved the problem. Moc files are properly
generated now.
As for the fix that you were wondering if it might affect my build, I
decided to remove the fix and see. Everything builds fine and is generated
where it needs to.
Otherwise, I was wondering why going from scons 2 to 3 broke the moc
feature? I am not sure to understand...
Judging from what fixed it, I guess it was the python version change from 2
to 3, rather than the scons version change, that broke moc in your case.
I've been using scons-3.0.0 with our version of the qt tool without any
modification, using python-2.7.

If you run into more problems, it could be a good idea to change only one
thing at a time: in this case, it's possible to first upgrade to
scons-3.0.0 but stay at python-2.7, then upgrade to python 3 in a separate
step. That helps narrow down the cause of any issues.

- Thomas
Bill Deegan
2017-10-04 17:42:17 UTC
Permalink
+1 Thomas.

But also going forward any logic which needs the text content of a Node
should use get_text_contents() as it will work with either python.

-Bill
On Tue, Oct 3, 2017 at 9:16 PM, Pierre-Luc Boily <
Post by Pierre-Luc Boily
Thx, get_text_contents() resolved the problem. Moc files are properly
generated now.
As for the fix that you were wondering if it might affect my build, I
decided to remove the fix and see. Everything builds fine and is generated
where it needs to.
Otherwise, I was wondering why going from scons 2 to 3 broke the moc
feature? I am not sure to understand...
Judging from what fixed it, I guess it was the python version change from
2 to 3, rather than the scons version change, that broke moc in your case.
I've been using scons-3.0.0 with our version of the qt tool without any
modification, using python-2.7.
If you run into more problems, it could be a good idea to change only one
thing at a time: in this case, it's possible to first upgrade to
scons-3.0.0 but stay at python-2.7, then upgrade to python 3 in a separate
step. That helps narrow down the cause of any issues.
- Thomas
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Loading...