aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/pkg
AgeCommit message (Collapse)Author
2026-03-12container: expose priority and SCHED_OTHER policyOphestra
The more explicit API removes the arbitrary limit preventing use of SCHED_OTHER (referred to as SCHED_NORMAL in the kernel). This change also exposes priority value to set. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-11container: move scheduler policy constants to stdOphestra
This avoids depending on cgo. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-09container: sched policy string representationOphestra
This also uses priority obtained via sched_get_priority_min, and improves bounds checking. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-06internal/pkg: move output buffer to readerOphestra
This side is the read end of a pipe and buffering reads from it ended up performing better than buffering one half of the TeeReader (which already goes through the kernel page cache anyway). Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-05internal/pkg: expose status fileOphestra
This is useful for external tooling. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-05internal/pkg: scrub for dangling statusOphestra
These cause build to fail to start. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-05internal/pkg: return writer after syncOphestra
This fixes a use-after-free. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-04internal/pkg: check filtered errorOphestra
This avoids filtering some unrelated os.ErrExist. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-04internal/pkg: write per-artifact logsOphestra
This is currently only used by execArtifact. A later patch will add additional logging facilities. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-03internal/pkg: cancel on scanner errorOphestra
This avoids discarding output thus appearing unresponsive. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-02-26internal/pkg: set container scheduling policyOphestra
This is not as necessary as it was for nix, since internal/pkg only unblocks exclusive artifacts one at a time. Still, this is useful when running alongside an unprivileged music player which cannot set itself to a higher priority. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-02-23internal/pkg/ir: raise string limit to 16 MiBOphestra
A string holds "current" hakurei source code. For now the compressed tarball is 4.9 MiB long. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-02-19internal/pkg: export layer promotionOphestra
This is a useful helper for external tooling. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-02-19internal/pkg: export seccomp presetsOphestra
This is useful for external tooling providing an execArtifact-like environment. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-02-17internal/pkg/ir: document reason for avoiding ident cacheOphestra
This got brought up earlier today as a potential optimisation. This change documents why it is not viable, and hopefully clears up some performance implications of using IRDecoder, namely that its decoding costs do not amortise. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-02-16internal/pkg: allow devel syscallsOphestra
This is required by the GLib test suite, and possibly others. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-02-15internal/pkg: expose extra methods to fileOphestra
This is useful for FileArtifact processing another stream. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-02-15internal/pkg: split off context commonOphestra
For making these methods available to RContext. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-02-11internal/pkg: skip resolved cure errorsOphestra
This significantly improves error resolution performance. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-02-11internal/pkg: buffer tar readerOphestra
This significantly improves performance and is a good assumption since the primary use case of FileArtifact is over the network. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-02-11internal/pkg: read buffer free listOphestra
Reader has a non-insignificant buffer that is worth saving as well. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-02-11internal/pkg: validate tar pathnamesOphestra
TContext no longer validates FileArtifact ahead of time, validation outcome is instead determined after consuming the reader to EOF. All data must therefore be treated as untrusted input until the reader is closed. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-02-07internal/pkg: skip duplicate earlyOphestra
This significantly increases IR generation performance. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-02-05internal/pkg: standardise artifact IROphestra
This should hopefully provide good separation between the artifact curing backend implementation and the (still work in progress) language. Making the IR parseable also guarantees uniqueness of the representation. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-02-03internal/pkg: improve error resolutionOphestra
This was taking way too long for early failures. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-29internal/pkg: set User-Agent headerOphestra
Avoid living under the default user agent and be at the mercy of some IDS. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-27internal/pkg: allow multiarchOphestra
The armv8l busybox binary release needs this to run correctly. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-27internal/pkg: encode checksum in identOphestra
This also rearranges the ident ir to be more predictable, and avoids an obvious and somewhat easy to get into inconsistent state. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-27internal/pkg: exclusive artifactsOphestra
This alleviates scheduler overhead when curing many artifacts. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-26internal/pkg: close gzip reader on successOphestra
The Close method panics otherwise. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-26internal/pkg: absolute hard linkOphestra
This cannot be relative since the curing process is not in the temp directory. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-25internal/pkg: expose response bodyOphestra
This uses the new measured reader provided by Cache. This should make httpArtifact zero-copy. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-25internal/pkg: expose underlying readerOphestra
This will be fully implemented in httpArtifact in a future commit. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-24internal/pkg: block on implementation entryOphestra
This avoids blocking while not in Cure method of the implementation. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-24internal/pkg: increase output buffer sizeOphestra
This avoids truncating unreasonably long lines from llvm. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-21internal/pkg: report dependency graph sizeOphestra
This is an interesting value to know when profiling. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-21internal/pkg: allow user namespace creationOphestra
No good reason to filter this in the execArtifact container, and the extended filter breaks certain programs. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-19internal/pkg: make checksum available to cureOphestra
This enables deduplication by value as implemented in execArtifact. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-17internal/pkg: deduplicate dependency errorsOphestra
This significantly simplifies error reporting for caller. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-16internal/pkg: lock on-filesystem cacheOphestra
Any fine-grained file-based locking here significantly hurts performance and is not part of the use case of the package. This change guarantees exclusive access to prevent inconsistent state on the filesystem. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-16internal/pkg: parallelise scrubOphestra
This significantly improves scrubbing performance. Since the cache directory structure is friendly to simultaneous access, this is possible without synchronisation. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-15internal/pkg: cache computed identifiersOphestra
This eliminates duplicate identifier computations. The new implementation also significantly reduces allocations while computing identifier for a large dependency tree. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-14internal/pkg: optional dependency graph size limitOphestra
This provides a quick check against cyclic dependencies without hurting cure performance. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-13internal/pkg: zero atime and mtimeOphestra
This is significantly more practical than keeping track of them in directory flattening format and setting this in every non-artifact implementation. Only tarArtifact can have meaningful deterministic checksums that are not zero and zeroing them still keeps autotools happy. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-13internal/pkg: remove typeflag promotion loopOphestra
Expanding this enables sharing of code common between types. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-12internal/pkg: exec prefix verbose outputOphestra
This proxies program output through msg with a name and fd prefix. This also avoids introducing additional information to the container via process stdout/stderr. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-12internal/pkg: cure completion verbose messagesOphestra
This reports cure completions to the user. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-12internal/pkg: optionally named static fileOphestra
These are generally for generating configuration files or build scripts, naming them is quite useful. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-12internal/pkg: caller-supplied reporting name for execOphestra
This does not have a reasonable way of inferring the underlying name. For zero value it falls back to base of executable pathname. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-12internal/pkg: append user-facing name in messagesOphestra
This makes verbose messages much more useful. Signed-off-by: Ophestra <cat@gensokyo.uk>