aboutsummaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)Author
2025-12-09release: 0.3.2v0.3.2Ophestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-09container: load initial process started before syscallOphestra
This avoids a race between returning from syscall and checking the state. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-09internal/pipewire: expose connection propsOphestra
Unused in hakurei but could be useful when the package is moved out of internal. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-09internal/pipewire: include remaining size in recvmsg wrapperOphestra
This otherwise truncates the received data by len(remaining) bytes. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-09internal/pipewire: reset per-roundtrip state once per callOphestra
This was left in consume when relocating per-roundtrip code out of the per-receive consume method. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-09internal/pipewire: increment remote sequence after establishing boundsOphestra
This avoids incrementing it twice proceeding from a partial message. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-09internal/pipewire: do not clobber error parsing SCMsOphestra
The error is handled later, clobbering it here breaks error handling when SCMs are present. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-09Revert "internal/pipewire: work around remote sequence quirk"Ophestra
This reverts commit 564db6863b8e0e90cbf7210152c53124fddc1b4c.
2025-12-08container/initdaemon: copy wstatus from wait4 loopOphestra
Due to the special nature of the init process, direct use of wait outside the wait4 loop is racy. This change copies the wstatus from wait4 loop state instead. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-08container: spin instead of block on wait4 ECHILDOphestra
Blocking prevents further wait4 processing causing ops to never receive their signals. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-08container: improve error message fallbackOphestra
This now falls back to message.Error if no other concrete type is matched. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-08cmd/hakurei: exec instead of fork/exec from shellOphestra
There is no reason to keep the shell process around. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-08container: friendlier error message for op timing outOphestra
This includes the string for the failing op which helps with troubleshooting. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-08test/interactive: add app with bad daemonOphestra
This is useful for testing daemon error handling behaviour. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-08container: make wait4 loop available to opsOphestra
Due to the special nature of the init process, regular wait calls are unavailable. This change provides infrastructure to access wait4 loop state from Op. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-08internal/pipewire: work around remote sequence quirkOphestra
Remote sequence sometimes start with a non-zero value, and keeps the same value for a while before going back to zero. Conditions for reproducing this behaviour is not yet known. This change works around this behaviour. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-08treewide: include PipeWire op and enforce PulseAudio checkOphestra
This fully replaces PulseAudio with PipeWire and enforces the PulseAudio check and error message. The pipewire-pulse daemon is handled in the NixOS module. Closes #26. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-08hst: expose daemon as fs entryOphestra
This is slightly counterintuitive, but it turned out well under this framework since the daemon backs its target file. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-08container: start daemons within containerOphestra
This is useful for daemons internal to the container. The only current use case is pipewire-pulse. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-08container: pass context as setup stateOphestra
This is useful currently for daemon Op, but could be used for many other things. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-08internal/outcome: integrate pipewire serverOphestra
This is very simple and takes almost no inputs. This is not yet hooked up to anything to prevent breaking any existing behaviour. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-08container: call op method right before initial processOphestra
This is at a point considered to be already "within" the container. Daemons internal to the container can be started here. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-08hst: check for insecure PulseAudio enablementOphestra
This is currently still a noop, but required for #26. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-08cmd/hakurei: add pipewire flagOphestra
This is for "run" command, formerly permissive defaults behaviour. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-07internal/pipewire: constant for PIPEWIRE_REMOTEOphestra
This is not defined anywhere in upstream PipeWire, no idea why. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-07hst: add pipewire flagOphestra
These are for #26. None of them are implemented yet. This fixes up test cases for the change to happen. Existing source code and JSON configuration continue to have the same effect. Existing flags get its EPulse bit replaced by EPipeWire. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-07internal/system: integrate PipeWire SecurityContextOphestra
Tests for this Op happens to be the best out of everything due to the robust infrastructure offered by internal/pipewire. This is now ready to use in internal/outcome for implementing #26. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-07internal/system: optional op check parallelismOphestra
The PipeWire Op check cannot be made parallel due to the OS interaction. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-07internal/pipewire: set finalizer on sccOphestra
This prevents leaking the socket and pipe fds. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-07internal/pipewire: seq access method for consumeOphestra
This improves readability as the offset is not immediately obvious. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-07internal/pipewire: respond to Core::PingOphestra
There is currently no known message that will get the PipeWire server to emit this event. It should be handled regardless. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-07internal/pipewire: specify opcode and file count with messageOphestra
This adds checking of FileCount while writing a message. Message encoding is relocated to an exported method to be used externally, probably for test stubbing. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-07internal/system: pass syscall error messageOphestra
This makes wrapped syscall errors produce a cleaner error message. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-07internal/system: port connect by nameOphestra
This behaviour is a bit messy and checks what appears to be a windows-specific environment variable for some reason. Keeping everything intact regardless to match upstream behaviour. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-07internal/system: remove ineffectual join reverting waylandOphestra
Removing the pathname socket used to be handled separately, now it is done during the Close call. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-06internal/pipewire: high level SecurityContext helperOphestra
This sets up close pipe and socket internally, and exposes the resulting pathname socket and close_fd cleanup as an io.Closer. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-06internal/pipewire: check pending ids after doneOphestra
This is not guaranteed to have completed after a roundtrip. This is leftover from when Roundtrip also sent and waited for sync. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-06internal/pipewire: post-sync cleanup functionsOphestra
This makes it easier to handle resources who only needs to stay alive before the next sync. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-06internal/pipewire: handle dangling files in roundtripOphestra
This should not be handled on every receive as it could cause valid (though impossible in current upstream implementation) messages to be rejected and raise a protocol error. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-06internal/pipewire: store proxy errors in contextOphestra
This change fixes handling of non-fatal errors during a roundtrip as there can be multiple receive calls per roundtrip. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-06internal/pipewire: set errno on an empty messageOphestra
This matches upstream behaviour. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-06internal/pipewire: rename context consume methodOphestra
This name is more correct since it does not roundtrip, but receives messages. This is also more consistent with the method on event proxies. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-06internal/pipewire: use sendmsg/recvmsg directlyOphestra
The PipeWire protocol does not work with Go abstractions. This change makes relevant methods call sendmsg/recvmsg directly. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-05internal/pipewire: do not send ancillary msg without filesOphestra
This is unnecessary and does not match upstream behaviour. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-05internal/pipewire: constants from pipewire/keys.hOphestra
These are PipeWire spa_dict keys. Interestingly many keys in the sample are undefined and appear as magic strings in upstream source code. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-04internal/pipewire: improve protocol error messagesOphestra
These are mostly small formatting changes, with the biggest change being to UnexpectedEOFError where its kind is now described as part of the error type. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-04internal/pipewire: use type name in error stringsOphestra
This provides more useful messages for protocol errors. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-03internal/pipewire: relocate constantsOphestra
This should make things easier to navigate, and possible to fully automatically generate the constants in the future. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-03internal/pipewire: finalizers for dangling filesOphestra
This makes their handling much less error-prone. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-03internal/pipewire: collect non-protocol errorsOphestra
These errors are recoverable and should not terminate event handling. Only terminate event handling for protocol errors or inconsistent state that makes further event handling impossible. Signed-off-by: Ophestra <cat@gensokyo.uk>