QtCreator shadow build directory structure



  • Hi,

    I am a bit confused with the directory structure created by QtCreator while shadow build is turned on.

    Example:

    C:\Projects\MyProject-build-Desktop_Qt_5_0_1_MSVC2010_32bit-Release\debug
    C:\Projects\MyProject-build-Desktop_Qt_5_0_1_MSVC2010_32bit-Release\release
    

    What is the purpuse of /debug and /release under -Release or -Debug folder ?

    I am running QtCreator 4.2.1 and Qt Qt 5.8.0 on Windows.


  • Moderators

    @enmaniac said in QtCreator shadow build directory structure:

    What is the purpuse of /debug and /release under -Release or -Debug folder ?

    This is not Qt's doing. MSVC compiler automatically adds these subfolders. Qt only creates the MyProject-build-Desktop_Qt_5_0_1_MSVC2010_32bit-Release part. The \debug and \release subfolders are not created on any other platform.



  • Hmm, I need to check the output later today to see if there is any compiler call made but I dont think thats it.
    Those folders are created once I hit: run qmake from context menu in Qt Creator not during the build itself.

    EDIT: made quick check on the Linux box and it seems those folders are not created there. So in the end maybe this is MSVC thing...ehh


  • Qt Champions 2016

    @enmaniac
    Hi,
    I use shadow build to a ramdrive (for speed) so i used this feature a lot.
    ( even if it warns me it might break stuff )

    Not seen the extra folders with with linux + gcc or
    mingw on windows. ( to be checked )


  • Lifetime Qt Champion

    Hi,

    Like @sierdzio wrote, this is specific to MSVC. Their project management system always create these two directories.

    What Qt Creator does is that it creates one shadow build folder per type of build which is what is needed on all platforms to keep both build types cleanly separated. On the other hand, MSVC also does this internally, that's why you get these subfolders in both shadow build directories but it's nothing you have to worry about.


  • Moderators

    Sorry to interrupt the thought trails that this is an MSVC issue.

    The directory structure is similar when using Qt creator with MinGW. I believe it has something to do with Qt creator on windows. At least I remember some discussions in the past along this lines.

    I got a a folder
    c:\Source\Shadows\build-SLFGui-Desktop_Qt_5_4_2_MinGW_32bit3-Release\release
    and aside
    c:\Source\Shadows\build-SLFGui-Desktop_Qt_5_4_2_MinGW_32bit3-Release\debug

    c:\Source\Shadows\build-SLFGui-Desktop_Qt_5_4_2_MinGW_32bit3-Release
    contains the makefiles for debug and release and as far as I know you have a similar duplication for *-Debug folder.


  • Qt Champions 2016

    @koahnig
    Ok. super input.
    What version of Creator are you on ?
    Im behind on windows.



  • @mrjj
    I can confirm @koahnig statement,

    I do get an unused Debug/Release folder for mingw builds on windows,

    QtCreator 4.3.0 - based on Qt 5.80 and MSVC 2015, 64 Bit

    Using Qt 5.9 build( not yet 5.9.1) and 5.8


  • Moderators

    @mrjj

    Unfortunately updated to most recent version of creator 4.3.1.
    Sorry, a bit frustrated at the moment, since something has been mixed up with this update.

    However, I believe the structure is nothing new and is like that since creator version 3 or even 2. It came with the shadow setup.
    Just had a quick look, it is also with Qt5.9.0 with this creator version.
    Unfortunately, I have removed my shadow folder last week. Therefore, I cannot check for older setups.


  • Qt Champions 2016

    @koahnig
    Ok, Ill check when I get home but most likely i remember wrong then.

    Update:
    Yes mingw/Creator 4.2.1 does in fact make empty folder even project was never build for release.

    but i can do it with qmake alone so its a qmake thing it seems

    alt text



  • I have also run qmake on my Windows machine and it on its won creates those directories. Perhaps thats some weird Windows version behavior ?


  • Moderators

    @mrjj

    Do not nail me down on this.
    However, I think the debug and release you are showing is certainly coming from qmake and was even the case before qt creator.
    You see also in the folder that there is a Makefile.Debug and a Makefile.Release.

    The shadow folder came into the game with creator at some point. For complete logical separation two complete different path' containing Release and Debug respectively had been introduced. For some compatibility reason it could not be changed.

    There is a reason for this on windows. There has been an answer by @tobias.hunger on this a couple of years back in the forum. I was looking for it today, but the search functionality here is useless or at least really strange and not intuitive.


  • Qt Champions 2016

    @koahnig
    That would make sense. Yep Google ruined me. (too)
    There have been reports over time
    https://bugreports.qt.io/browse/QTCREATORBUG-13807


  • Moderators

    And here is direct link to the report for qmake https://bugreports.qt.io/browse/QTBUG-52347

    Thanks for the investigation :-) So indeed it is a "Windows" thing, but not MSVC's fault - that's a "feature" of qmake.



  • So it seems that this is for the sake of being like this ? Or did I miss some real cause between the lines ?


  • Moderators

    @enmaniac said in QtCreator shadow build directory structure:

    So it seems that this is for the sake of being like this ? Or did I miss some real cause between the lines ?

    Quoting Ossi:

    debug_and_release is set on windows, because the builds are binary incompatible and thus must be kept separate consistently. on unix, that problem doesn't exists - you can mix and match as you like. still, you can make debug_and_release framework builds for mac. in other cases, the problem is the lack of any system support or even naming convention to support such a feature.
    in fact, this is messy enough that we still don't know exactly what we want to do in qbs, where we can mostly decide from scratch what to do.

    So, there is a reason for this. Only I guess most people (including myself) are totally not convinced by this "solution" ;-) especially since shadow builds exist.



  • Exactly my point.
    I understand the statement. However, in shadow build mode, there is no danger of mixing things up since there are separate directories provided already, thus, problem is avioded.

    I can understand the need for those for non shadow build mode. But even then, documentation is clear that you should use it only when you need single type of build so mixing debug and release should be considered a violiation of use.


  • Moderators

    @enmaniac @sierdzio

    If you see the solution it is for sure more than strange. No doubt about this. For users without creator and shadow builds, it does not look as strange. Both folders are created simultaneously. At least 90% have to debug anyway before they create a release version.

    With creator and having already some debug respectively it starts to look strange, because of the stupid duality.
    I think tobias wrote something about shared code between creator and qmake. The part is repsonsible for the duality. Tobias answered a bit frustrated that everybody is beating onto this duality, but there had to be a real deep change in qmake for getting away from this. Since we are all developers we some kind understand that real deep changes in running applications may mean that a can of worms will be opened. Therefore, be gentle.

    In any case the shadowing through creator is a great thing!!

    I am using it in a slightly different approach by using it with a central shadow folder. This helps when you have numerous projects. Once in a while I am deleting this central shadow folder. I did not consider the parallel shadow folder within project folders as helpful, since I had to scan through all projects manually.


  • Qt Champions 2016

    @koahnig

    I have all projects on ram drive. It was a huge mess allowing it to
    make build-xxx all over the drive. :)
    Also it turned out for bigger projects the 6000/6000 MB/s speed was also
    beneficial.


  • Moderators

    @mrjj

    What kind of ram drive are you using?

    Did not follow that issue for some time.


  • Qt Champions 2016

    @koahnig
    Hi
    this one
    https://sourceforge.net/projects/imdisk-toolkit/

    My new fav after Datarams free ver became a bit to nagging
    Also this one have iso mounting and other good stuff and better speed.

    There are many to choose from
    https://www.raymond.cc/blog/12-ram-disk-software-benchmarked-for-fastest-read-and-write-speed/

    On linux I just use the systems version.



  • @koahnig

    I see. Indeed I havent considered all those who dont use QtCreator and its features. Havent done this myself for ages and that slipped my mind.

    I will try to do the trick with CONFIG -= debug_and_release to check if that at least is going to make it more intuitive for someone using QtCreator and shadow builds.

    Thanks all for valuable feedback on it.



  • I have verified that once CONFIG -= debug_and_release is added to the pro file additional debug/release subfolders do not popup in shadow mode builds.

    Thus, I am closing this thread since I got all my questions answered.

    Thanks a lot to you all!


  • Moderators

    @enmaniac
    Thanks for sharing your findings.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.