Opened 5 years ago

Closed 5 years ago

Last modified 3 years ago

#16325 closed defect (fixed)

wxExecuteData appears to be unusable

Reported by: ojwb Owned by: VZ
Priority: normal Milestone:
Component: base Version: 3.0.0
Keywords: Cc:
Blocked By: Blocking:
Patch: no

Description

With wx 3.0.0, a user can't seem to do much with wxExecuteData.

The header <wx/unix/execute.h> is installed, but near the start it has this:

#if wxUSE_STREAMS
    #include "wx/unix/pipe.h"
    #include "wx/private/streamtempinput.h"
#endif

And wx/private/streamtempinput.h is not installed, so if wxUSE_STREAMS is defined (which it seems to be by default - at least it's defined in Debian builds, and I haven't explicitly enabled it), then you can't actually include this header.

I can't seem to find wxExecuteData mentioned in the docs, but the headers show wxAppTraits::WaitForChild(wxExecuteData& execData), and comment above talks about execData.flags suggesting it's not just meant to be some opaque handle.

The amule source code (not yet updated for wx3.0) expects to be able to access public members of wxExecuteData, such as pid and flags.

Change History (9)

comment:1 Changed 5 years ago by ojwb

  • Type changed from build error to defect

comment:2 follow-up: Changed 5 years ago by vadz

Normally I'd say that wxExecuteData is supposed to be private and that the right solution is to not install wx/unix/execute.h (and rename it to wx/unix/private/execute.h). This is because this struct is Unix-only and doesn't exist in wxMSW and because WaitForChild() is really just an implementation helper allowing console and GUI programs to do different things.

And I still think this is what should be done in trunk. But for 3.0, we probably need to make this header compile somehow, if it's there and if it's being used. The only solution I see is to install wx/private/streamtempinput.h and wx/private/pipestream.h and wx/private/unix/pipestream.h, which is pretty ugly, but what else can we do?

I'd be curious how is aMule using this, where do they even get this struct from?

comment:3 Changed 5 years ago by ojwb

I'm not at all familiar with the amule code, but it seems they get it from wx, by subclassing wxConsoleAppTraits - this is in src/amule.h (http://sources.debian.net/src/amule/2.3.1-11/src/amule.h#L497) :

class CDaemonAppTraits : public wxConsoleAppTraits
{
[...]
        virtual int WaitForChild(wxExecuteData& execData);
[...]

I've never looked at the wx app traits stuff before, so I don't know if that's a sensible thing to be trying to do.

comment:4 Changed 5 years ago by vadz

It could be sensible or not (I don't know this code neither and it's not obvious what does it do at the first glance), but it definitely uses undocumented parts of wx :-( And even if we can make it compile I'm not really sure if this code still works.

Anyhow, let's install the private headers in 3.0 branch, there is really nothing else to do.

comment:5 Changed 5 years ago by VZ

In 76683:

Move include/wx/unix/execute.h to include/wx/unix/private.

This header is private and is not supposed to be used from the outside the
library.

See #16325.

comment:6 Changed 5 years ago by VZ

  • Owner set to VZ
  • Resolution set to fixed
  • Status changed from new to closed

In 76685:

Install private headers used by wx/unix/execute.h.

Although private headers are not normally installed, do install the ones
included from the (erroneously) public wx/unix/execute.h to allow code
including it to compile.

Closes #16325.

comment:7 in reply to: ↑ 2 Changed 3 years ago by Yoshi

Replying to vadz:

Normally I'd say that wxExecuteData is supposed to be private and that the right solution is to not install wx/unix/execute.h (and rename it to wx/unix/private/execute.h). This is because this struct is Unix-only and doesn't exist in wxMSW and because WaitForChild() is really just an implementation helper allowing console and GUI programs to do different things.

And I still think this is what should be done in trunk. But for 3.0, we probably need to make this header compile somehow, if it's there and if it's being used. The only solution I see is to install wx/private/streamtempinput.h and wx/private/pipestream.h and wx/private/unix/pipestream.h, which is pretty ugly, but what else can we do?

I'd be curious how is aMule using this, where do they even get this struct from?

Hi! I'm facing the same issues and searching for those file, I found on https://github.com/wxWidgets/wxWidgets/tree/master/include/wx that the pipestream's pathname is different:

you wrote:

wx/private/unix/pipestream.h

but I found that the pathname is:

wx/unix/private/pipestream.h

Am'I wrong?

Thanks for the reply and sorry for my bad english

comment:8 Changed 3 years ago by vadz

Yes, the correct file name is include/wx/unix/private/pipestream.h.

comment:9 Changed 3 years ago by Yoshi

I've replaced those file but i got the same issues. Here http://forum.adunanza.net/t/installazione-amule-adunanza-2012-1-2-3-1-su-jessie/8885/32 you can find the errors i got.

Some tips?

Note: See TracTickets for help on using tickets.