Skip to content

Proposed changes to build aMule with wx 3.1.x - #168

Closed
mrhyde71 wants to merge 2 commits into
amule-project:masterfrom
mrhyde71:master
Closed

Proposed changes to build aMule with wx 3.1.x#168
mrhyde71 wants to merge 2 commits into
amule-project:masterfrom
mrhyde71:master

Conversation

@mrhyde71

Copy link
Copy Markdown
  1. removed warnings related to some macros deprecated in wx 3.0 related to Pen/Brush
  2. removed warnings related to some macros deprecated in wx 3.1 related to Font
  3. little change to remove call to wxScrolledWindow::OnScroll, deprecated in wx 3.0 and removed in wx 3.1

This code has been built on Mac with wx 3.1.2 and seems to work

…x and changed the code to allow to build with wxWidgets 3.1.x
@felisucoibi

Copy link
Copy Markdown

i think the scroll stuff is the main problem for amule crashing.

@mrhyde71

mrhyde71 commented Oct 27, 2019

Copy link
Copy Markdown
Author

Till now no problems with scroll noticed but currently I built only on Mac OS (still trying to build on WIndows and not updated my linux dev machines)
I put all changes I made (the reported in this pull request and also the others proposed in aMule forum, see http://forum.amule.org/index.php?topic=51900.msg153674#msg153674 and http://forum.amule.org/index.php?topic=51877.msg153590#msg153590 and created the following binaries for Mac OS in case someone want to try.

You can find them at following links
aMule
aMuleGUI

I imposed as min target 10.11 so I guess they should work starting from El Capitan

@gonosztopi gonosztopi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, I welcome these changes and your contribution.

However, adding this amount of #if... lines makes the code harder to maintain. I'd suggest you create a separate file(like src/wxcompat.h, or any likeable name), with content like

// Renamed in wxWidgets-3.0.0
#ifndef wxBRUSHSTYLE_SOLID
#define wxBRUSHSTYLE_SOLID wxSOLID
#endif

and include it in the affected files. This way once we move away from wx-2.8 we'll need to touch only the compatibility header.

On the other hand, changes in wxCas code should stay as-is, because it's a separate app and should not share code with aMule.

@gonosztopi gonosztopi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason in removing a bunch of wxALIGN_CENTER_VERTICAL?

(Ok, I found your forum post...)

@mrhyde71

Copy link
Copy Markdown
Author

In general, I welcome these changes and your contribution.

However, adding this amount of #if... lines makes the code harder to maintain. I'd suggest you create a separate file(like src/wxcompat.h, or any likeable name), with content like

// Renamed in wxWidgets-3.0.0
#ifndef wxBRUSHSTYLE_SOLID
#define wxBRUSHSTYLE_SOLID wxSOLID
#endif

and include it in the affected files. This way once we move away from wx-2.8 we'll need to touch only the compatibility header.

On the other hand, changes in wxCas code should stay as-is, because it's a separate app and should not share code with aMule.

Ok, I'll try, I like your suggestion (find some free time to do it not so simple but I agree with you that there are too many #if...).

@mrhyde71

Copy link
Copy Markdown
Author

What's the reason in removing a bunch of wxALIGN_CENTER_VERTICAL?

(Ok, I found your forum post...)

Yes and building against wxWidgets with debug/assertion enabled is a little nightmare (basically I have an assertion for almost each object built in muuli_wdr.cpp)... I need to try something else to remove the "offending" flags in code without using to #if/#else (I have a couple of ideas and your idea about a file like "src/compat.h" could be useful also for this)

@Stoatwblr Stoatwblr mentioned this pull request Jun 7, 2020
@sergiomb2

Copy link
Copy Markdown
Contributor

wx 3.2.0 is out

@sandrotosi

Copy link
Copy Markdown

is there an effort to adjust this PR for wx 3.2?

@mifritscher

Copy link
Copy Markdown

As mentioned in #340, debian has applied a patch für wxwidgets 3.2.

@sl1pkn07

sl1pkn07 commented Dec 3, 2023

Copy link
Copy Markdown

please update the patch also for Wx 3.2.4

[Detaching after fork from child process 248120]
Assertion failed: /usr/src/debug/wxwidgets-light/wxwidgets/src/unix/sockunix.cpp:DoEnableEvents:100: Assertion '!(GetSocketFlags() & wxSOCKET_BLOCK)' failed. enabling events for a blocking socket?
Backtrace follows:
[3] wxOnAssert(char const*, int, char const*, char const*, char const*) in /usr/lib/libwx_baseu-3.2.so.0[0x7ffff76d1327]
[4] wxSocketImplUnix::DoEnableEvents(int, bool) in /usr/lib/libwx_baseu_net-3.2.so.0[0x7ffff7f3d9df]
[5] wxEpollDispatcher::Dispatch(int) in /usr/lib/libwx_baseu-3.2.so.0[0x7ffff7831d49]
[6] wxConsoleEventLoop::DispatchTimeout(unsigned long) in /usr/lib/libwx_baseu-3.2.so.0[0x7ffff7836b2b]
[7] wxConsoleEventLoop::Dispatch() in /usr/lib/libwx_baseu-3.2.so.0[0x7ffff78368a5]
[8] wxEventLoopManual::ProcessEvents() in /usr/lib/libwx_baseu-3.2.so.0[0x7ffff7714df5]
[9] wxEventLoopManual::DoRun() in /usr/lib/libwx_baseu-3.2.so.0[0x7ffff7714f31]
[10] wxEventLoopBase::Run() in /usr/lib/libwx_baseu-3.2.so.0[0x7ffff7714b82]
[11] wxAppConsoleBase::MainLoop() in /usr/lib/libwx_baseu-3.2.so.0[0x7ffff76d223f]
[12] wxEntry(int&, wchar_t**) in /usr/lib/libwx_baseu-3.2.so.0[0x7ffff776b579]
[13] ?? in /usr/bin/amuled[0x5555555ccec7]
[14] ?? in /usr/lib/libc.so.6[0x7ffff7045cd0]
[15] __libc_start_main in /usr/lib/libc.so.6[0x7ffff7045d8a]
[16] ?? in /usr/bin/amuled[0x5555555cfa25]

/usr/src/debug/wxwidgets-light/wxwidgets/src/unix/sockunix.cpp(100): assert "!(GetSocketFlags() & wxSOCKET_BLOCK)" failed in DoEnableEvents(): enabling events for a blocking socket?
[Detaching after vfork from child process 248121]


Call stack:
[01] wxSocketImplUnix::DoEnableEvents(int, bool)
[02] wxEpollDispatcher::Dispatch(int)        
[03] wxConsoleEventLoop::DispatchTimeout(unsigned long)
[04] wxConsoleEventLoop::Dispatch()          
[05] wxEventLoopManual::ProcessEvents()      
[06] wxEventLoopManual::DoRun()              
[07] wxEventLoopBase::Run()                  
[08] wxAppConsoleBase::MainLoop()            
[09] wxEntry(int&, wchar_t**)                
[10] 0x5555555ccec7
[11] 0x7ffff7045cd0
[12] __libc_start_main                       
[13] 0x5555555cfa25
[New Thread 0x7ffff13f76c0 (LWP 248122)]
[Thread 0x7fffd27fc6c0 (LWP 248118) exited]
02:11:33: Debug: Failed to unregister 22 in direction 0
[Thread 0x7ffff13f76c0 (LWP 248122) exited]

Thread 1 "amuled" received signal SIGSEGV, Segmentation fault.
0x00007ffff7f3db6d in wxSocketImplUnix::OnReadWaiting (this=0x7fffe0001f70) at /usr/src/debug/wxwidgets-light/wxwidgets/src/unix/sockunix.cpp:180
Downloading source file /usr/src/debug/wxwidgets-light/wxwidgets/src/unix/sockunix.cpp
180                     if ( GetLastError() == wxSOCKET_WOULDBLOCK )                                                                                                                                                                                                                                                                                                                         
(gdb) bt full
#0  0x00007ffff7f3db6d in wxSocketImplUnix::OnReadWaiting() (this=0x7fffe0001f70) at /usr/src/debug/wxwidgets-light/wxwidgets/src/unix/sockunix.cpp:180
        __FUNCTION__ = "OnReadWaiting"
        notify = <optimized out>
#1  0x00007ffff7831d49 in wxEpollDispatcher::Dispatch(int) (this=<optimized out>, timeout=<optimized out>) at /usr/src/debug/wxwidgets-light/wxwidgets/src/unix/epolldispatcher.cpp:233
        handler = <optimized out>
        p = 0x7fffffffd060
        events = {{events = 5, data = {ptr = 0x7fffe0001fe8, fd = -536862744, u32 = 3758104552, u64 = 140736951492584}}, {events = 21845, data = {ptr = 0x555555e575b0, fd = 1441101232, u32 = 1441101232, u64 = 93825001682352}}, {events = 4152650817, data = {ptr = 0x1300007fff, fd = 32767, u32 = 32767, u64 = 81604411391}}, {events = 0, data = {ptr = 0x7ffff7837ee4 <wxConsoleEventLoopSourcesManager::AddSourceForFD(int, wxEventLoopSourceHandler*, int)+1860>, fd = -142377244, u32 = 4152590052, u64 = 140737345978084}}, {events = 1441108048, data = {ptr = 0x5bd1870000005555, fd = 21845, u32 = 21845, u64 = 6616217761653740885}}, {events = 2978056804, data = {ptr = 0x0, fd = 0, u32 = 0, u64 = 0}}, {events = 0, data = {ptr = 0x0, fd = 0, u32 = 0, u64 = 0}}, {events = 0, data = {ptr = 0x0, fd = 0, u32 = 0, u64 = 0}}, {events = 0, data = {ptr = 0x558ed69800000000, fd = 0, u32 = 0, u64 = 6165100888240160768}}, {events = 21845, data = {ptr = 0x555555963050, fd = 1435906128, u32 = 1435906128, u64 = 93824996487248}}, {events = 4151809165, data = {ptr = 0x7fff, fd = 32767, u32 = 32767, u64 = 32767}}, {events = 0, data = {ptr = 0x0, fd = 0, u32 = 0, u64 = 0}}, {events = 0, data = {ptr = 0x5bd1870000000000, fd = 0, u32 = 0, u64 = 6616217761653719040}}, {events = 2978056804, data = {ptr = 0x555555963050, fd = 1435906128, u32 = 1435906128, u64 = 93824996487248}}, {events = 1540458240, data = {ptr = 0x558fa410b1818a64, fd = -1316910492, u32 = 2978056804, u64 = 6165326806497987172}}, {events = 21845, data = {ptr = 0x555555962460, fd = 1435903072, u32 = 1435903072, u64 = 93824996484192}}}
        rc = <optimized out>
        __FUNCTION__ = "Dispatch"
        numEvents = 0
#2  0x00007ffff7836b2b in wxConsoleEventLoop::DispatchTimeout(unsigned long) (this=0x555556057510, timeout=18446744073709551615) at /usr/src/debug/wxwidgets-light/wxwidgets/src/unix/evtloopunix.cpp:192
        nextTimer = {m_ll = 0}
        hadEvent = <optimized out>
#3  0x00007ffff78368a5 in wxConsoleEventLoop::Dispatch() (this=<optimized out>) at /usr/src/debug/wxwidgets-light/wxwidgets/src/unix/evtloopunix.cpp:173
#4  0x00007ffff7714df5 in wxEventLoopManual::ProcessEvents() (this=this@entry=0x555556057510) at /usr/src/debug/wxwidgets-light/wxwidgets/src/common/evtloopcmn.cpp:234
--Type <RET> for more, q to quit, c to continue without paging--
        res = <optimized out>
#5  0x00007ffff7714f31 in wxEventLoopManual::DoRun() (this=0x555556057510) at /usr/src/debug/wxwidgets-light/wxwidgets/src/common/evtloopcmn.cpp:288
#6  0x00007ffff7714b82 in wxEventLoopBase::Run() (this=0x555556057510) at /usr/src/debug/wxwidgets-light/wxwidgets/src/common/evtloopcmn.cpp:87
        __FUNCTION__ = "Run"
        activate = {m_evtLoopOld = 0x0}
#7  0x00007ffff76d223f in wxAppConsoleBase::MainLoop() (this=0x555555962460) at /usr/src/debug/wxwidgets-light/wxwidgets/src/common/appbase.cpp:381
        mainLoop = {<wxEventLoopBasePtr> = {m_ptr = 0x555556057510}, m_pp = 0x5555559625f0, m_pOld = 0x0}
#8  0x00007ffff776b579 in wxEntry(int&, wchar_t**) (argc=@0x7ffff79323e4: 1, argv=<optimized out>) at /usr/src/debug/wxwidgets-light/wxwidgets/src/common/init.cpp:497
        initializer = {m_ok = <optimized out>}
#9  0x00007ffff776b617 in wxEntry(int&, char**) (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/wxwidgets-light/wxwidgets/src/common/init.cpp:509
#10 0x00005555555ccec7 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/amule-daemon-git/amule/src/amuled.cpp:124

greetings

@sc0w

sc0w commented Sep 26, 2024

Copy link
Copy Markdown
Member

wxWidgets 3.2 compatibility was added in 9fc3bd0

@sc0w sc0w closed this Sep 26, 2024
mrjimenez pushed a commit to mrjimenez/amule that referenced this pull request Jun 16, 2026
The "You already have the file '%s'" log line printed only the bare
filename, which made the file hard to locate on disk when the user
had renamed it locally or had several shared roots. The full path is
already computed two lines above for the existence check; just pass
that to CFormat instead of the bare filename.

Output goes from
  You already have the file 'XYZ.avi'
to
  You already have the file '/home/user/Music/XYZ.avi'

The basename is still present in the formatted string (it's the tail
of the path), so existing log greps for the filename still match.
The msgid stays byte-identical so .pot/.po catalogs are untouched.

Closes amule-project#168
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants