Files
RedLintu16andClaude Opus 5.5 b67b29b40b CrossSound desktop with the DRM stubbed out
A single-commit snapshot of better-remote (7a8c4cb plus the uncommitted
remote.js work), with every DRM-bearing piece replaced by a stub that keeps
the same interface:

- src/ui/drm.js: no DRM pipelines; needsDrm/isDrmUrl false,
  bestEncryptedTranscoding null, playDrmAudio rejects. The engine switcher
  and drmVjs* helpers stay as no-ops.
- src/electron/drm.ts: initCdm/setupLicenseCors no-ops; the drm:license and
  api:stream:drm-info IPC handlers reject with "DRM is not available".
- src/api/soundcloud.ts: resolveEncryptedStream keeps its signature, rejects.
- src/electron/main.ts: license host dropped from the header rewrite.
- src/ui/pb-lease.js: the expiry self-check uses a placeholder URL instead
  of a captured DRM manifest URL (same policy values, still passes).
- scripts/vmp-sign.js, forge.config.js vmpSign: Widevine signing skipped,
  so no castLabs EVS account is needed to run or package.
- README: says DRM is stubbed here.

Go+ tracks SoundCloud only serves encrypted are unplayable and skipped;
previews and everything else play as before. No history: the private
branches' DRM code is not reachable from this commit.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-14 10:06:08 -07:00

73 lines
2.8 KiB
JavaScript
Executable File

// Run a build command while mirroring ALL of its output — stdout AND stderr, every
// line timestamped — to a log file under build-logs/, so a silent/hung packaging
// step is actually visible. A 15s heartbeat keeps writing "…still running…" so the
// LAST real line before the heartbeats tells you exactly which step is stuck.
//
// It also flips on verbose logging for the whole Electron toolchain (forge,
// @electron/packager, @electron/universal, osx-sign) via DEBUG, unless you already
// set DEBUG yourself.
//
// Usage:
// node scripts/build-log.js <logname> -- <command …>
// e.g. node scripts/build-log.js mac -- npm run mac
const { spawn } = require('node:child_process')
const fs = require('node:fs')
const path = require('node:path')
const argv = process.argv.slice(2)
const sep = argv.indexOf('--')
const logName = sep > 0 ? argv[0] : 'build'
const cmdParts = sep >= 0 ? argv.slice(sep + 1) : argv
if (!cmdParts.length) {
console.error('usage: node scripts/build-log.js <logname> -- <command …>')
process.exit(1)
}
const command = cmdParts.join(' ')
const logDir = path.join(__dirname, '..', 'build-logs')
fs.mkdirSync(logDir, { recursive: true })
const stamp = new Date().toISOString().replace(/[:.]/g, '-')
const logFile = path.join(logDir, `${logName}-${stamp}.log`)
const out = fs.createWriteStream(logFile, { flags: 'a' })
const ts = () => new Date().toISOString()
function mirror(chunk) {
const text = chunk.toString()
process.stdout.write(text) // live console, unchanged
out.write(text.replace(/^/gm, `[${ts()}] `)) // file copy, line-timestamped
}
console.log(`\n=== build-log → ${logFile} ===\n`)
out.write(`=== build-log started ${ts()} ===\ncmd: ${command}\ncwd: ${process.cwd()}\n\n`)
// Verbose logging across the Electron packaging toolchain unless the caller set DEBUG.
const env = { ...process.env }
if (!env.DEBUG) env.DEBUG = 'electron-*,@electron/*,electron-forge:*,electron-osx-sign*,electron-notarize*'
// Force color off so the log file isn't full of escape codes.
env.FORCE_COLOR = '0'
const child = spawn(command, { env, shell: true, stdio: ['inherit', 'pipe', 'pipe'] })
child.stdout.on('data', mirror)
child.stderr.on('data', mirror)
// Heartbeat: if the child goes quiet, these lines show the log is still live and
// pinpoint when output stopped (= the hung step).
const hb = setInterval(() => out.write(`[${ts()}] …still running (no output)…\n`), 15000)
child.on('exit', (code, signal) => {
clearInterval(hb)
const msg = `\n=== exited code=${code} signal=${signal} at ${ts()} ===\n`
process.stdout.write(msg)
out.write(msg)
out.end()
process.exit(code == null ? 1 : code)
})
child.on('error', (e) => {
clearInterval(hb)
const msg = `\n=== spawn error: ${e.stack || e.message} ===\n`
process.stdout.write(msg)
out.write(msg)
out.end()
process.exit(1)
})