cmake: keep wx_NEED_NET on for BUILD_WEBSERVER-only configurations - #620
Merged
mrjimenez merged 1 commit intoMay 15, 2026
Merged
Conversation
The post-BUILD_* sanity block in cmake/options.cmake forces wx_NEED_NET
back to FALSE when none of BUILD_DAEMON / BUILD_MONOLITHIC /
BUILD_REMOTEGUI / BUILD_WXCAS is set, overriding the earlier
`set(wx_NEED_NET TRUE)` inside the BUILD_WEBSERVER block. But amuleweb
itself links against wxWidgets::NET unconditionally in
src/webserver/src/CMakeLists.txt, so a webserver-only configure
(cmake -B build -DBUILD_MONOLITHIC=NO -DBUILD_WEBSERVER=YES) errors
out with:
Target "amuleweb" links to:
wxWidgets::NET
but the target was not found.
Common workaround is to also enable BUILD_DAEMON, but that pulls in
the entire daemon target chain just to satisfy a wxNet target that
should have stayed on.
Add BUILD_WEBSERVER to the disjunction so amuleweb-only builds keep
the wxNet bindings the link line already declared.
Verified locally on macOS arm64: cmake -B build-macos
-DBUILD_MONOLITHIC=NO -DBUILD_WEBSERVER=YES -DBUILD_TESTING=NO
configures and builds amuleweb clean (previously errored at generate
time with the missing wxWidgets::NET target).
mrjimenez
pushed a commit
to mrjimenez/amule
that referenced
this pull request
Jul 27, 2026
…nnect (amule-project#620) Adding a burst of downloads to a large queue over the remote GUI froze the GUI for seconds and dripped the new files in at only a few per second (issue amule-project#615). Selecting ~100 search results for download on a ~10k queue was the reporter's repro. CKnownFilesRem::ProcessUpdate() only wrapped the list ctrls in BeginBatchUpdate()/EndBatchUpdate() for the post-reconnect reconcile (issue amule-project#444). On an ordinary steady-state poll the batch was never engaged, so each freshly-added partfile went through CDownloadListCtrl::AddFile() with the per-item SortList() active: a full re-sort of the entire list on every insert. For a 10k queue that is O(n^2 log n) and blocks the GUI event loop, which in turn throttles the outbound download requests -- hence the ~4/sec drip the reporter saw. Batch the download list on every non-initial poll: BeginBatchUpdate() suppresses the per-item sort, and the single SortList() runs once at the end, and only when the poll actually added a file (downloadListGrew). A pure in-place stat poll stays sort-free, so the common case pays nothing. EndBatchUpdate() gains a doSort parameter (default true) to express that. The cold-boot m_initialUpdate path keeps its own ShowFileList() batching and is left untouched. The shared-files ctrl batching is unchanged (reconnect-only), matching its existing behaviour. Refs amule-project#615
mrjimenez
pushed a commit
to mrjimenez/amule
that referenced
this pull request
Jul 27, 2026
amule-project#621) Downloading a large multi-selection of search results into a big queue froze the monolithic GUI, the same way amule-project#615 did over the remote GUI -- just on a different, un-batched path. CSearchListCtrl::DownloadSelected() loops over the selection calling Search_Add_Download per file. In the monolithic build that notification runs synchronously on the main thread, so each file's AddFile() fires a per-item SortList() inline -- a full re-sort of the whole download list on every insert, O(n^2) on a large queue. Wrap the selection loop in the download list's BeginBatchUpdate() / EndBatchUpdate() so the burst collapses into a single sort + repaint, mirroring the remote GUI's poll path (amule-project#620). Monolithic-only: the remote GUI's adds arrive later via the download-queue poll, which already batches, so the code is gated behind #ifndef CLIENT_GUI.
mrjimenez
pushed a commit
to mrjimenez/amule
that referenced
this pull request
Jul 27, 2026
…reconnect (amule-project#622) Companion to amule-project#620/amule-project#621. Adding a burst of freshly-shared files over the remote GUI -- many downloads completing daemon-side, or a shared folder added/rescanned on the daemon -- froze the GUI on a large share. amule-project#620 fixed the equivalent download-list case but deliberately left the shared-files ctrl batched reconnect-only. CKnownFilesRem::ProcessUpdate() adds each new shared file via CSharedFilesCtrl::ShowFile() -> AddItemData(), which on this virtual list does a sorted insert AND rebuilds the entire row index (RebuildRowIndex) on every call -- O(n) per insert, O(n^2) for a burst on an n-file share. Unlike the download list, a plain Freeze/deferred-sort batch wouldn't help, because the per-insert cost is the row-index rebuild, not a sort. Give the shared-files ctrl the same append-path batching the download list already uses: during a batch, ShowFile() appends with AppendItemDataNow() (O(1), and it keeps the row index and item count live so the interleaved reconcile prune and in-place UpdateItem() stay correct), and the single SortList() is deferred to EndBatchUpdate(doSort). The non-batch single-add path is unchanged. ProcessUpdate() now batches the shared list on every non-initial poll and sorts once at the end only if the poll added a file (sharedListGrew). Monolithic is unaffected: its bulk shared paths funnel through the batched Reload() -> ShowFileList(), and the dir-watcher coalesces bursts into a single Reload(). Verified by building amule and amulegui.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A configure with
-DBUILD_MONOLITHIC=NO -DBUILD_WEBSERVER=YES(no daemon, no GUI, no wxcas) errors at generate time:amuleweb's CMakeLists.txt linkswxWidgets::NETdirectly, and theBUILD_WEBSERVERblock incmake/options.cmakedoesset(wx_NEED_NET TRUE)to satisfy that. But a sanity-clamp block immediately below it (options.cmake:189-191) resetswx_NEED_NETtoFALSEwhen none of{BUILD_DAEMON, BUILD_MONOLITHIC, BUILD_REMOTEGUI, BUILD_WXCAS}is set —BUILD_WEBSERVERis missing from that list, so the override silently fires and the wxNet target stops being created.Common workaround for users / CI scripts is to also enable
-DBUILD_DAEMON=YES, but that pulls in the entire daemon target chain just to satisfy a wxNet target that should have stayed on.Fix
One-character change: add
BUILD_WEBSERVERto the disjunction so amuleweb-only configures keep the wxNet bindings that the link line already declared.(Comment is also updated to reflect that amuleweb is a direct wxNet consumer.)
Validation
macOS arm64, fresh build dir:
wxWidgets::NETtarget.cmake --build build-macos --target amulewebproduces a workingamulewebbinary.No effect on configurations that enable any of DAEMON / MONOLITHIC / REMOTEGUI / WXCAS — those already set
wx_NEED_NETand the new condition is a no-op there.