aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal
AgeCommit message (Collapse)Author
2026-01-05internal/pkg: expand single directory tarballOphestra
This enables much cleaner use of their output without giving up any meaningful data. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-05internal/pkg: temporary scratch space for cureOphestra
This allows for more flexibility during implementation. The use case that required this was for expanding single directory tarballs. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-05internal/pkg: compute http identifier from urlOphestra
The previous implementation exposes arbitrary user input to the cache as an identifier, which is highly error-prone and can cause the cache to enter an inconsistent state if the user is not careful. This change replaces the implementation to compute identifier late, using url string as params. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-05internal/pkg: improve artifact interfaceOphestra
This moves all cache I/O code to Cache. Artifact now only contains methods for constructing their actual contents. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-04internal/pkg: ignore typeflag 'g'Ophestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-04internal/pkg: create symlinks for filesOphestra
These are much easier to handle than hard links and should be just as transparent for this use case. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-04internal/pkg: implement tar artifactOphestra
This is useful for unpacking tarballs downloaded from the internet. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-04internal/pkg: override working directory permsOphestra
This must be writable to enable renaming, and the final result is conventionally read-only alongside the entire directory contents. This change overrides the permission bits as part of Store. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-04internal/pkg: enable cache access during storeOphestra
This is still not ideal as it makes entry into Store sequential. This will be improved after more usage code is written. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-03internal/pkg: pass context in request wrapperOphestra
This method is for the most common use case, and in actual use there will always be an associated context. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-03internal/pkg: implement caching for directoriesOphestra
This works on any directories and should be robust against any bad state the artifact curing process might have failed at. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-03internal/pkg: wrap checksum string encodingOphestra
This wraps base64.URLEncoding.EncodeToString for cleaner call site. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-03internal/pkg: compute identifier from depsOphestra
This provides infrastructure for computing a deterministic identifier based on current artifact kind, opaque parameters data, and optional dependency kind and identifiers. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-03internal/pkg: create work directoryOphestra
This is used for artifacts that cure into directories. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-03internal/pkg: optionally validate flat pathnamesOphestra
This makes the decoder safe against untrusted input without hurting performance for a trusted stream. This should still not be called against untrusted input though. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-03internal/pkg: implement http artifactOphestra
This is useful for downloading source tarballs from the internet. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-02internal/pkg: relocate cache test helperOphestra
This is useful for other tests that need a cache instance. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-02internal/pkg: encode entry in custom formatOphestra
The fact that Gob serialisation is deterministic is an implementation detail. This change replaces Gob with a simple custom format. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-02internal/pkg: implement caching for filesOphestra
This change contains primitives for validating and caching single-file artifacts. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-19internal/pipewire: raise Core::Sync timeoutOphestra
Hopefully relieves spurious failures on a very overloaded system. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-19internal/pipewire: EPOLL_CTL_ADD instead of EPOLL_CTL_MODOphestra
Implementation is no longer tied down by the limitations of SyscallConn. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-19internal/pipewire: hold socket fd directlyOphestra
The interface provided by net is not used here and is a leftover from a previous implementation. This change removes it. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-19internal/pipewire: inform conn of blocking intentOphestra
The interface does not expose underlying kernel notification mechanisms. This change removes the need to poll in situations were the next call might block. This is made cumbersome by the SyscallConn interface left over from a previous implementation, it will be replaced in a later commit as the current implementation does not make use of any net.Conn methods other than Close. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-18internal/pipewire: sendmsg/recvmsg errors are fatalOphestra
When returned wrapped as a syscall error, these are impossible to recover from, so wrap them as a fatal error. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-15internal/outcome: expose pipewire via pipewire-pulseOphestra
This no longer exposes the pipewire socket to the container, and instead mediates access via pipewire-pulse. This makes insecure parts of the protocol inaccessible as explained in the doc comment in hst. Closes #29. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-15internal/outcome: look up pipewire-pulse pathOphestra
This is for setting up the pipewire-pulse container in shim, for #29. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-15internal/outcome: optional shim private dirOphestra
This is a private work directory owned by the specific shim. Useful for sockets owned by this instance of the shim and requires no direct assistance from the priv-side process. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-14internal/pipewire: handle SecurityContext::Create errorOphestra
This method can result in an error targeting it, so it is handled here. This change also causes a call to Create to also Core::Sync, as it should have done. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-14internal/pipewire: SecurityContext as destructibleOphestra
This proxy can be destroyed by sending a Core::Destroy targeting it. This change implements the Destroy method by embedding destructible. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-14internal/pipewire: reorder context structOphestra
This change reorders and groups struct elements. This improves readability since this struct holds a lot of state loosely related to each other. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-14internal/pipewire: implement Core::DestroyOphestra
This change also implements pending destructible check on Sync. Destruction method should always be implemented as a wrapper of destructible.destroy. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-14internal/pipewire: do not emit None for spa_dictOphestra
Turns out the PipeWire server does not expect a value of type None here at all. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-14internal/pipewire: implement Core::CreateObjectOphestra
Nothing uses this right now, this would have to be called by wrapper methods on Registry that would search the objects Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-14internal/pipewire: handle nil spa_dict correctlyOphestra
This now marshals into a value of type None when the slice is nil, and correctly unmarshals from type None. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-14internal/pipewire: unmarshal nil pointer correctlyOphestra
This now calls unmarshalCheckTypeBounds to advance to the next message. Additionally, handling for None value is relocated to a function for reuse by other types. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-14internal/pipewire: return correct size for nil spa_dictOphestra
A nil spa_dict results in a None type value being sent over the wire. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-14internal/pipewire: move Core wrapper methods under CoreOphestra
These do not belong under Context, and is an early implementation limitation that carried over. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-13internal/pipewire: treat noAck violation as fatalOphestra
Receiving this event indicates something has gone terribly wrong somehow, and ignoring Core::BoundProps causes inconsistent state anyway. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-13internal/pipewire: implement Core::RemoveIdOphestra
This is emitted by the server when a proxy id is removed for any reason. Currently, the only path for this to be emitted is when a global object is destroyed while some proxy is still bound to it. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-11internal/pipewire: treat unknown opcode as fatalOphestra
Skipping events can cause local state to diverge from the server. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-11internal/pipewire: generic Core::Error handlingOphestra
This flushes message buffer before queueing the event expecting the error. Since this is quite useful and relatively complex, it is relocated to a method of Context. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-11internal/pipewire: export Registry::DestroyOphestra
This handles the error returned by Sync. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-10internal/outcome: populate instance metadata for PipeWireOphestra
These have similar semantics to equivalent Wayland security-context-v1 fields. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-10internal/pipewire: cleaner error message for unsupported typeOphestra
The error string itself is descriptive enough, so use it as the error message directly. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-10internal/pipewire: implement Registry::DestroyOphestra
This requires error handling infrastructure in Core that does not yet exist, so it is not exported for now. It has been manually tested via linkname against PipeWire. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-10internal/pipewire: implement Registry::GlobalRemoveOphestra
This is emitted by PipeWire when a global object disappears, because PipeWire insists that all clients that had called Core::GetRegistry must constantly sync its local registry state with the remote. 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>