Bug 199919 - games/wxlauncher: fails to build with WX3=on JOYSTICK=off
Summary: games/wxlauncher: fails to build with WX3=on JOYSTICK=off
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Jan Beich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-04 09:06 UTC by Jan Beich
Modified: 2015-05-05 04:10 UTC (History)
1 user (show)

See Also:
lightside: maintainer-feedback+


Attachments
v0 (518 bytes, patch)
2015-05-04 10:08 UTC, Jan Beich
jbeich: maintainer-approval? (lightside)
Details | Diff
Proposed patch (since 385396 revision) (695 bytes, patch)
2015-05-04 21:41 UTC, lightside
lightside: maintainer-approval+
Details | Diff
Proposed patch (since 385396 revision) (1.06 KB, patch)
2015-05-04 22:52 UTC, lightside
lightside: maintainer-approval+
Details | Diff
Additional proposed patch (since 385435 revision) (676 bytes, patch)
2015-05-05 02:14 UTC, lightside
lightside: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2015-05-04 09:06:52 UTC
code/apis/JoystickManager.cpp: In function 'bool JoyMan::Initialize()':
code/apis/JoystickManager.cpp:69:4: error: 'joysticks' was not declared in this scope
    joysticks.Count());
    ^
Comment 1 Jan Beich freebsd_committer freebsd_triage 2015-05-04 09:39:01 UTC
wxLogDebug() is no longer a nop in non-debug build according to c++ -E output:

  // wxgtk-2.8
  bool JoyMan::Initialize() {
   if ( JoyMan::IsInitialized() ) {
    wxLogNop();

    return true;
   }
  ...

  // wxgtk-3.0
  JoyMan::Initialize() {
   if ( JoyMan::IsInitialized() ) {
    for ( bool wxlogcheck68 = false; !wxlogcheck68 && wxLog::IsLevelEnabled(wxLOG_Debug, wxLOG_COMPONENT); wxlogcheck68 = true ) wxLogger(wxLOG_Debug, "/wrkdirs/usr/ports/games/wxlauncher/work/wxLauncher-wxlauncher-7ee46df/code/apis/JoystickManager.cpp", 68, __FUNCTION__, wxLOG_COMPONENT).Log(L"JoyMan already initialized with %d joysticks",
     joysticks.Count());
    return true;
   }
  ...
Comment 2 Jan Beich freebsd_committer freebsd_triage 2015-05-04 10:08:36 UTC
Created attachment 156329 [details]
v0

Maybe disable debug logging after
https://github.com/wxWidgets/wxWidgets/commit/7d9550df507d5522ac76887e5876b314b729ed50
Comment 3 lightside 2015-05-04 21:41:19 UTC
Created attachment 156348 [details]
Proposed patch (since 385396 revision)

(In reply to comment #2)
> Maybe disable debug logging

I think, that the check of USE_JOYSTICK define will be enough, in this case.

The proposed patch attached.
Comment 4 lightside 2015-05-04 22:52:41 UTC
Created attachment 156353 [details]
Proposed patch (since 385396 revision)

I found discussion of related issue:
https://github.com/wxLauncher/wxlauncher/issues/117

The topic starter suggested to use "-DNDEBUG" compiler flag. This disables debugging info (e.g. inside of wxlauncher.log).

The new proposed patch attached.
The consequence is: now the program shows splash screen on startup.
Comment 5 Jan Beich freebsd_committer freebsd_triage 2015-05-04 23:20:03 UTC
Comment on attachment 156353 [details]
Proposed patch (since 385396 revision)

>diff -ruN wxlauncher.orig/Makefile wxlauncher/Makefile
>--- wxlauncher.orig/Makefile	2015-05-04 15:18:03.000000000 +0400
>+++ wxlauncher/Makefile	2015-05-05 01:08:32.000000000 +0400
>@@ -43,6 +43,10 @@
> WX3_USE=	WX=3.0+
> WX3_USE_OFF=	WX=2.8
> 
>+.if !defined(WITH_DEBUG)
>+CXXFLAGS=	-DNDEBUG

CFLAGS would be more correct but wxlauncher doesn't have any *.c files.

Also, convert to a proper option instead of relying on current (fragile) implementation.

>+.endif
>+
> .include <bsd.port.options.mk>
Comment 6 commit-hook freebsd_committer freebsd_triage 2015-05-05 00:10:45 UTC
A commit references this bug:

Author: jbeich
Date: Tue May  5 00:09:52 UTC 2015
New revision: 385433
URL: https://svnweb.freebsd.org/changeset/ports/385433

Log:
  games/wxlauncher: unbreak build when WX3=on JOYSTICK=off

  wxgtk30 enables debug logging by default. This led to breakage
  because the calls within wxLogDebug() are no longer eliminated.

  PR:		199919
  Submitted by:	lightside <lightside@gmx.com> (maintainer)

Changes:
  head/games/wxlauncher/files/
  head/games/wxlauncher/files/patch-code_apis_JoystickManager.cpp
Comment 7 Jan Beich freebsd_committer freebsd_triage 2015-05-05 00:16:31 UTC
Thanks. Committed earlier version. Waiting for feedback about WITH_DEBUG.
Comment 8 lightside 2015-05-05 02:14:47 UTC
Created attachment 156359 [details]
Additional proposed patch (since 385435 revision)

(In reply to comment #5)
> CFLAGS would be more correct but wxlauncher doesn't have any *.c files.
>
> Also, convert to a proper option instead of relying on current (fragile) implementation.

The DEBUG_CFLAGS_OFF works, but more correct DEBUG_CPPFLAGS_OFF doesn't (for some reason). It may be DEBUG_CXXFLAGS_OFF also.

(In reply to comment #7)
> Thanks. Committed earlier version. Waiting for feedback about WITH_DEBUG.

Thank you too.

Well, the earlier version is ok (at least the port is buildable now).
Even with debugging info, it just logs it to ~/wxlauncher/wxLauncher.log file (e.g. no obtrusive windows with errors). The splash screen, which was enabled by NDEBUG define, is interesting, but I didn't find an option to disable it. The mentioned 117 issue on GitHub wxlauncher site is still open.

On the other hand, the wxWidgets documentation about debugging contains information about using NDEBUG define on release builds (but also possible to use wxDEBUG_LEVEL=0, as you mentioned):
http://docs.wxwidgets.org/3.0.2/overview_debugging.html

I attached the new proposed patch, but now it will require to bump PORTREVISION.
Comment 9 commit-hook freebsd_committer freebsd_triage 2015-05-05 04:07:18 UTC
A commit references this bug:

Author: jbeich
Date: Tue May  5 04:07:02 UTC 2015
New revision: 385443
URL: https://svnweb.freebsd.org/changeset/ports/385443

Log:
  games/wxlauncher: add DEBUG option and put verbose logging behind it

  DEBUG=off (default) now shows splash screen on startup due to being on
  the same #if NDEBUG bandwagon used to turn off verbose logging.

  GitHub:		wxLauncher/wxlauncher#117
  PR:		199919
  Submitted by:	lightside <lightside@gmx.com> (maintainer)

Changes:
  head/games/wxlauncher/Makefile
Comment 10 Jan Beich freebsd_committer freebsd_triage 2015-05-05 04:10:10 UTC
Done, with upstream ping via commit.