macOS port: build, rendering, daemon, and mining fixes

Build & setup:
- Fix setup.sh and build.sh for macOS (bundle daemon, xmrig, sapling params, asmap.dat into .app)
- Fix CMakeLists.txt libsodium linking for macOS
- Fix incbin.h to use __DATA,__const section on macOS
- Remove vendored libsodium-1.0.18 source tree (use fetch script instead)
- Remove prebuilt-binaries/xmrig (replaced by xmrig-hac)
- Add .DS_Store to .gitignore

Rendering & UI:
- Use GLSL #version 150 and OpenGL 3.2 Core Profile on macOS
- Force dpiScale=1.0 on macOS to fix Retina double-scaling
- Set default window/UI opacity to 100% on Mac/Linux
- Add scroll fade shader guard for macOS GL compatibility
- Add ImGui error recovery around render loop and mining tab

Daemon & bootstrap:
- Fix getDragonXDataDir() to return ~/Library/Application Support/Hush/DRAGONX/ on macOS
- Fix isPortInUse() with connect() fallback (no /proc/net/tcp on macOS)
- Increase daemon watchdog timeout from 3s to 15s
- Add daemon status indicator (colored dot + label) in wizard bootstrap phases

Mining tab:
- Fix EmbeddedDaemon::getMemoryUsageMB() crash on macOS (was using Linux /proc)
- Fix XmrigManager::getMemoryUsageMB() to use ps on macOS instead of /proc
- Restructure RenderMiningTab with wrapper pattern for exception safety
- Fix default pool URL to include port (pool.dragonx.is:3433)
This commit is contained in:
2026-03-19 14:26:04 -05:00
parent d79d013060
commit 2b3277529e
572 changed files with 284 additions and 146732 deletions

View File

@@ -512,6 +512,21 @@ bool XmrigManager::isRunning() const {
double XmrigManager::getMemoryUsageMB() const {
if (process_pid_ <= 0) return 0.0;
#ifdef __APPLE__
// macOS: use ps to read RSS for xmrig process
char cmd[128];
snprintf(cmd, sizeof(cmd), "ps -o rss= -p %d 2>/dev/null", process_pid_);
FILE* fp = popen(cmd, "r");
if (!fp) return 0.0;
char line[64];
double mb = 0.0;
if (fgets(line, sizeof(line), fp)) {
long rss_kb = atol(line);
if (rss_kb > 0) mb = static_cast<double>(rss_kb) / 1024.0;
}
pclose(fp);
return mb;
#else
char path[64];
snprintf(path, sizeof(path), "/proc/%d/statm", process_pid_);
FILE* fp = fopen(path, "r");
@@ -523,6 +538,7 @@ double XmrigManager::getMemoryUsageMB() const {
fclose(fp);
long pageSize = sysconf(_SC_PAGESIZE);
return static_cast<double>(pages * pageSize) / (1024.0 * 1024.0);
#endif
}
void XmrigManager::drainOutput() {