Windows Build system missmatch Console/Windows

Bug #1453782 reported by Daniel Schürmann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Low
RJ Skerry-Ryan

Bug Description

The current build log contains both Console and Windows settings:
http://builds.mixxx.org/jenkins/job/1.12-release/architecture=i386,platform=windows/lastBuild/consoleFull

```
Building with LINKFLAGS: /nologo /MACHINE:X86 /DEBUG /LTCG:NOSTATUS /OPT:REF /OPT:ICF /MANIFEST /nodefaultlib:LIBCMT.lib /nodefaultlib:LIBCMTd.lib /entry:mainCRTStartup /subsystem:windows,5.01 /manifest
```

```
link /nologo /MACHINE:X86 /DEBUG /LTCG:NOSTATUS /OPT:REF /OPT:ICF /MANIFEST /nodefaultlib:LIBCMT.lib /nodefaultlib:LIBCMTd.lib /entry:mainCRTStartup /manifest /subsystem:console,5.01 /OUT:win32_build\mixxx.exe /LIBPATH:C:\mixxx\environments\2.0-x86-Release /LIBPATH:C:\mixxx\environments\2.0-x86-Release\lib /LIBPATH:C:\mixxx\environments\2.0-x86-Release\build\qt-everywhere-opensource-src-4.8.6\lib /LIBPATH:lib\gtest-
```

```
link /nologo /MACHINE:X86 /DEBUG /LTCG:NOSTATUS /OPT:REF /OPT:ICF /MANIFEST /nodefaultlib:LIBCMT.lib /nodefaultlib:LIBCMTd.lib /entry:mainCRTStartup /manifest /subsystem:console,5.01 /OUT:win32_build\mixxx.exe /LIBPATH:C:\mixxx\environments\2.0-x86-Release /LIBPATH:C:\mixxx\environments\2.0-x86-Release\lib /LIBPATH:C:\mixxx\environments\2.0-x86-Release\build\qt-everywhere-opensource-src-4.8.6\lib /LIBPATH:lib\gtest-1.
```

It looks like the current build is finally a Console Applikation, because it spans an undesired console window when double clicked.
The start link contains settings for the console which is typical for a console application.

After a double click start we are able to close the undesired console window, which will pop up.
We can go this way. It has the advantage that Mixxx behaves similar to the other Build targets.

The other solution is to be a Windows application and try to connect to a calling cmd.exe process. Do not know if this is possible.
But maybe we just don't need to do it, since we have the debug output in the developers menu.

I wonder how the "DEBUGCONSOLE" has worked in Mixxx 1.11. My first assumption that the console is fired up on demand only was wrong.

Tags: build
Revision history for this message
Daniel Schürmann (daschuer) wrote :

We may also make the debug build a console application and the release build a windows application ...

Changed in mixxx:
milestone: none → 1.12.0
Revision history for this message
Daniel Schürmann (daschuer) wrote :

It seams to be difficult:

http://stackoverflow.com/questions/3360548/console-output-in-a-qt-gui-app

It outlines the idea of a second exe with console nature that jumps into a common dll.

Revision history for this message
Daniel Schürmann (daschuer) wrote :

For now I like this solution most:
Be a console application, detect if we are started by double click and close the console.

http://stackoverflow.com/questions/510805/can-a-win32-console-application-detect-if-it-has-been-run-from-the-explorer-or-n

This comes closest to the Linux behavior.
Drawback: A console window is poped up for a spit of a second.

Alternative:
We may live with it or close it later after the Main window is visible.

Any other Ideas?

RJ Skerry-Ryan (rryan)
Changed in mixxx:
assignee: nobody → RJ Ryan (rryan)
status: New → Confirmed
Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

For some reason our /subsystem:windows link flag is being converted to /subsystem:console. All the other flags are identical to what is specified in LINKFLAGS.

Since the log output with /subsystem:console is printed by SCons this looks like a bug in our build scripts -- not link.exe.

Revision history for this message
Daniel Schürmann (daschuer) wrote :

Ah I think I have found the best solution.

Once you have managed to fix scons, (it seams to have something to do with the test=1 flag)
we can link Mixxx as a Windows application.

Than we can reintroduce parts of the the code removed here:
https://github.com/mixxxdj/mixxx/commit/a1df7df89ae1182af3d29ca1f19d6c941a11443d
replace AllocConsole() with AttachConsole(ATTACH_PARENT_PROCESS) and we will have exactly the Linux behaviour.
So we can safely remove the "DEBUGCONSOLE" flag.

Would this be OK for you?

Revision history for this message
Daniel Schürmann (daschuer) wrote :

We can also use the same hack in the test main() so there is no need to the windows/console replacement for both build targets.

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

Temporarily disabled mixxx-test subsystem change in
https://github.com/mixxxdj/mixxx/commit/304e5f6eceb60c8dbc80999f52f03c9876d6b577

A complete fix will build the core of Mixxx as an object in the standard environment and then change the link flags for the test environment. Then SCons will not complain about duplicate environments for the automoc / protoc'd files.

Revision history for this message
Daniel Schürmann (daschuer) wrote :

This means if we use AttachConsole() in mixxx-test.exe and mixxx.exe we can build both with /subsystem:windows
Should I try to commit a solution from remote?

RJ Skerry-Ryan (rryan)
Changed in mixxx:
milestone: 2.0.0 → none
importance: Undecided → Low
RJ Skerry-Ryan (rryan)
tags: added: build
Revision history for this message
RJ Skerry-Ryan (rryan) wrote :
Changed in mixxx:
milestone: none → 2.2.0
status: Confirmed → In Progress
RJ Skerry-Ryan (rryan)
Changed in mixxx:
milestone: 2.2.0 → 2.3.0
status: In Progress → Fix Committed
Changed in mixxx:
status: Fix Committed → Fix Released
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/8021

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.