Skip to content

Fix aria2 download completion when user config is present - #13

Open
Shinolr wants to merge 1 commit into
XcodesOrg:mainfrom
Shinolr:fix/aria2-controlled-process
Open

Shinolr wants to merge 1 commit into
XcodesOrg:mainfrom
Shinolr:fix/aria2-controlled-process

Conversation

@Shinolr

@Shinolr Shinolr commented Dec 3, 2026

Copy link
Copy Markdown

Problem

Aria2DownloadService did not pass --no-conf to aria2c, so aria2c loaded the user's default configuration (~/.aria2/aria2.conf). When that configuration enables RPC (enable-rpc=true), aria2c stays alive after printing Download complete in order to serve the RPC endpoint.

ProcessProgressStreamRunner treats a zero exit status from aria2c as the signal that the download stream is finished. Because the process never exits, the stream never completes and callers (Xcodes.app and the xcodes CLI) remain stuck at the final download step.

Reproduced with the aria2c binary bundled in Xcodes.app: with user config enabling RPC, aria2c prints Download complete but does not exit. With --no-conf --continue=true, it exits with status 0.

Changes

  • Pass --no-conf so this one-shot download is not affected by user aria2 configuration that can change process lifetime (enable-rpc, daemon) or the parsed output format (quiet, log level).
  • Pass --continue=true explicitly. XcodeArchiveService and RuntimeArchiveService both inspect the .aria2 sidecar to detect incomplete archives, so resume is part of the existing design; it was previously dependent on user configuration.

Verification

swift test --disable-sandbox — 201 tests, 0 failures.

Compatibility note

This intentionally changes behavior: XcodesKit-managed aria2 downloads no longer read user aria2 configuration. Users who relied on that configuration for proxies, custom CA certificates, or rate limits would need those options supported explicitly by XcodesKit, or use the URLSession download path instead.

Pass --no-conf so aria2c ignores user configuration that can keep the process alive (enable-rpc/daemon) or change parsed output. Enable resume explicitly with --continue=true because archive services rely on the .aria2 sidecar. Add a regression test for the generated arguments.
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.

1 participant