Releases: Nukesor/pueue
v4.0.1
v4.0.0
[4.0.0] - 2025-03-09
This release aims to further improve Pueue and to rectify some old design decisions.
Large portions of both the library and the executables' code have been refactored and the protocol has been reworked, which completely breaks backwards compatibility.
Read the Change section for more details.
Removing internal channel communication
TLDR: Commands that start/stop/pause tasks now only return when the task is actually started/stopped/paused.
killing commands still takes a short while, as the process needs to be cleaned up properly.
Until recently, Pueue managed subprocess (task) states in a dedicated thread.
Client commands affecting subprocesses, such as pueue start --immediate, were relayed to this special thread via an mpsc channel for processing.
This setup caused short delays before the instructions were executed.
For instance, tasks would begin a few hundred milliseconds after the client received an Ok from the daemon, despite using the --immediate flag.
This behavior was unintuitive and often led to commands like pueue add --immediate install_something && pueue send 0 'y\n' failing, as the task had not started by the time pueue send was called.
The new state design resolves this issue by allowing Pueue to manipulate subprocess states directly within the client message handlers, eliminating any delays.
New editing
Task editing was a bit tedious until recently.
One could only edit a single task at a time and you had to specify which properties you wanted to add.
Each property was then opened in a new $EDITOR session, which meant that users had to open and close editors up to four times to edit a single task.
After a lot of consideration, tasks editing has been redesigned, provoding two ways that allow simple and convenient editing of multiple tasks at once.
File based approach
For this, a temporary directory is created for every task to edit and a new file for every property, resulting in the following structure:
π 0/
β * command
β * label
β * path
β * priority
π 1/
β * command
β * label
β * path
β * priority
You can then just navigate the resulting file structure and edit the properties you want in the editor of your choice.
This solution is obviously flawed if your editor doesn't provide an in-editor file tree like helix.
This mode is enabled by setting client.edit_mode to files.
Toml based approach
In this mode, all tasks to be edited are serialized into a single toml file that's then opened in the editor of your choice.
[1]
id = 1
command = "ls"
path = "/tmp"
priority = 0This mode is very convenient for editing simple tasks, but has the drawback that users need to know the TOML format and have to make sure to not mess up character escaping.
For example, multi-line commands or commands that contain special/reserved characters in TOML will need special care.
Based on some feedback, this mode is apparently the most asked for, so this is enabled by default.
It can also be explicitly set via client.edit_mode: "toml".
Runtime invariants
TLDR: A new task state representation has been introduced, which is significantly cleaner and fixes some bugs.
However, it breaks compatibility with old states, so ensure there are no important tasks in your queue before updating. You'll also need to recreate groups.
Previously, various task-state related invariants were manually enforced during runtime. For example, a Queued task should not have a start or enqueued_at time set.
Turns out, doing this manually is highly error-prone, as it is difficult to account for every state transition and ensure everything is set or cleaned up correctly.
Fortunately, this issue can be addressed in a more elegant way by using Rust's struct enums. This method enforces invariants via the type system at compile time.
Although the affected code became slightly more verbose (about 25% larger), it eliminated an entire class of bugs.
During this refactoring, I discovered at least two instances where I had forgotten to clear a variable, leading to inconsistent state.
Since the new structure differs significantly from the old one, it completely breaks backward compatibility.
Upon updating Pueue and restarting the daemon, the previous state will be wiped, resulting in a clean slate.
Change
- Breaking: Refactor internal task state. Some task variables have been moved into the
TaskStatusenum, which now enforces various invariants during compile time via the type system.
Due to this, several subtle time related inconsistencies (task start/stop/enqueue times) have been fixed. #556
Important: This completely breaks pre v4.0 states.
Important: The Pueue daemon needs to be restarted and the state will be wiped clean. - Breaking: Streamlined
pueue logparameters to behave the same way asstart,pauseorkill. #509 - Breaking: Remove the
--childrencommandline flags, that have been deprecated and no longer serve any function sincev3.0.0. - Send log output to
stderrinstead ofstdout#562. - Change default log level from error to warning #562.
- Bumped MSRV to 1.85 and Rust edition to 2024.
- Breaking: Redesigned task editing process #553.
Pueue now allows editing all properties a task in one editor session. There're two modes to do so:tomlandfiles, which is configurable via theclient.edit_modesettings field. - Revisited, fixed and cleaned up CLI help texts.
- Print most of Pueue's info/log messages to
stderr. Only keep useful stuff like json and task log output onstdout. - Breaking: Allow
--immediateflag instead of--start--immediatelyonpueue restartfor consistency withpueue add. - Breaking: Ported from
anyhowtocolor_eyrefor prettier log output. - Breaking: Switch
cborhandling library, breaking backwards-compatible communication on a data format level. - Breaking: Switch protocol message representation, completely breaking backwards compatibility.
Add
- Add support for NetBSD.
- Add
--alland--grouptopueue log. #509 - Add
--alland--grouptopueue enqueue. #558 - Add
--alland--grouptopueue stash. #558 - Add
pueue reset --groups [group_names]to allow resetting individual groups. #482
This also refactors the way resets are done internally, resulting in a cleaner code architecture. - Ability to set the Unix socket permissions through the new
unix_socket_permissionsconfiguration option. #544 - Add
commandfilter topueue status. #524 #560 - Allow
pueue statusto order tasks byenqueue_at. #554 - Added Windows service on Windows to allow a true daemon experience. #344 #567
- Add
queued_countandstashed_countto callback template variables. This allows users to fire callbacks when whole groups are finished. #578 - Add new subcommand to set or unset environment variables for tasks. #503
- Add
add --followflag that may be called in combination with--immediate#592 - Add option to save the state in compressed form. This can be toggled with the
daemon.compress_state_fileconfig file.
Preliminary testing shows significant compression ratios (up to x15), which helps with large states in embedded and I/O bound environments.
On my local machine with a state of 400 tasks, state file size shrinks from ~2MB to ~120KB and save time increases from ~8ms to ~20ms.
Due to the very repetitive nature of the state's data (mostly environment variables), thegzipcompression algorithm with theflate2implementation has been chosen.
It shows similar compression rations tozstdon level7, which is more than enough and the dependency is significantly lighter thanzstd.
snappy, which is already a dependency, has also been considered, but it has much worse compression ratios (~2MB -> ~300KB).
Fixed
- Fixed delay after sending process related commands from client. #548
- Callback templating arguments were html escaped by accident. #564
- Print incompatible version warning info as a log message instead of plain stdout input, which broke json outputs #562.
- Fixed
-ddaemon mode on Windows. #344 - Fixed a pueued crash when malformed secret exchange messages are sent by a connecting client #619.
Remove
status-formatsubcommand. This was a temporary workaround until thestatus queryfeature was finished, which is now the case.
pueue-lib-v0.29.0
[0.29.0 ] - 2025-03-09
Changed
- Streamline all
RequestandResponsevariant names and struct names used in unit variant. - Prepare
Request::StreamandResponse::Streamto be compatible with multiple follow tasks in the scope of #614. - Rename
commandtooriginal_commandinEditableTaskandTaskToRestartto prevent confusion and ambiguity. - Add new
receive_bytes_with_max_sizefunction to restrict message buffer size for DoS prevention. - Add
compress_state_filesetting (used by daemon).
v4.0.0-rc.3
Visible changes since last release candidate:
Change
- Breaking: Switch
cborhandling library, potentially breaking backwards-compatible communication on a data format level.
Remove
status-formatsubcommand. This was a temporary workaround until thestatus queryfeature was finished, which is now the case.
pueue-lib-v0.28.1
[0.28.1] - 2025-02-17
Added
- Extracted
pueue'sClientimplementation intopueue_lib.
It usescolor-eyrefor generic error handling, which could be improved in the future.
Otherwise, it serves as a convenient entry point to implement a client.
v4.0.0-rc.2
Visible changes since last release candidate:
Change
- Breaking: Redesigned task editing process #553.
Pueue now allows editing all properties of a task in one editor session. There're two modes to do so:tomlandfiles. - Revisited, fixed and cleaned up CLI help texts.
- Breaking: Print most of Pueue's info/log messages to
stderr. Only keep useful stuff like json and task log output onstdout. - Breaking: Ported from
anyhowtocolor_eyrefor prettier log output.
Add
- Add
add --followflag that may be called in combination with--immediate#592
pueue-lib-v0.28.0
[0.28.0] - 2025-02-11
Changed
- Breaking: Split the
Messageenum into aResponseandRequestenum. Requests are sent to the daemon, responses are sent from the daemon. - Breaking: Move all process handling related logic out of
pueue_lib - Breaking: Remove all process related fields and helper functions from
State
v4.0.0-rc.1
This release aims to further improve Pueue and to rectify some old design decisions.
Removing internal channel communication
TLDR: Commands that start/stop/kill/pause tasks now only return when the task is actually started/stopped/killed/paused.
Until recently, Pueue managed subprocess (task) states in a dedicated thread.
Client commands affecting subprocesses, such as pueue start --immediate, were relayed to this special thread via an mpsc channel for processing.
This setup caused short delays before the instructions were executed.
For instance, tasks would begin a few hundred milliseconds after the client received an Ok from the daemon, despite using the --immediate flag.
This behavior was unintuitive and often led to commands like pueue add --immediate install_something && pueue send 0 'y\n' failing, as the task had not started by the time pueue send was called.
The new state design resolves this issue by allowing Pueue to manipulate subprocess states directly within the client message handlers, eliminating any delays.
New editing
Task editing was a bit tedious until recently.
One could only edit a single task at a time and you had to specify which properties you wanted to add.
Each property was then opened in a new $EDITOR session, which meant that users had to open and close editors up to four times to edit a single task.
After a lot of consideration, a new way of editing tasks has been designed that allows simple and convenient editing of multiple tasks at once.
For this, a temporary directory is created for every task to edit and a new file for every property, resulting in the following structure:
π 0/
β * command
β * label
β * path
β * priority
You can then just navigate the resulting file structure and edit the properties you want in the editor of your choice.
I'm aware that this might not be for everyone, so feedback is very much encouraged over here.
Runtime invariants
TLDR: A new task state representation has been introduced, that's significantly cleaner and fixes some bugs.
However, it breaks compatibility with old states, so ensure there are no important tasks in your queue before updating. You'll also need to recreate groups.
Previously, various task-state related invariants were manually enforced during runtime. For example, a Queued task should not have a start or enqueued_at time set.
Turns out, doing this manually is highly error-prone, as it is difficult to account for every state transition and ensure everything is set or cleaned up correctly.
Fortunately, this issue can be addressed in a more elegant way in Rust using struct enums. This method enforces invariants via the type system at compile time.
Although the affected code became slightly more verbose (about 25% larger), it eliminated an entire class of bugs.
During this refactoring, I discovered at least two instances where I had forgotten to clear a variable, leading to inconsistent state.
Since the new structure differs significantly from the old one, it completely breaks backward compatibility.
Upon updating Pueue and restarting the daemon, the previous state will be wiped, resulting in a clean slate.
Change
- Breaking: Refactor internal task state. Some task variables have been moved into the
TaskStatusenum, which now enforces various invariants during compile time via the type system.
Due to this, several subtle time related inconsistencies (task start/stop/enqueue times) have been fixed. #556
Important: This completely breaks backwards compatibility, including previous state.
Important: The Pueue daemon needs to be restarted and the state will be wiped clean. - Breaking: Streamlined
pueue logparameters to behave the same way asstart,pauseorkill. #509 - Breaking: Remove the
--childrencommandline flags, that have been deprecated and no longer serve any function sincev3.0.0. - Send log output to
stderrinstead ofstdout#562. - Change default log level from error to warning #562.
- Bumped MSRV to 1.70.
- Breaking: Redesigned task editing process #553.
Add
- Add support for NetBSD.
- Add
--alland--grouptopueue log. #509 - Add
--alland--grouptopueue enqueue. #558 - Add
--alland--grouptopueue stash. #558 - Add
pueue reset --groups [group_names]to allow resetting individual groups. #482
This also refactors the way resets are done internally, resulting in a cleaner code architecture. - Ability to set the Unix socket permissions through the new
unix_socket_permissionsconfiguration option. #544 - Add
commandfilter topueue status. #524 #560 - Allow
pueue statusto order tasks byenqueue_at. #554 - Added Windows service on Windows to allow a true daemon experience. #344 #567
- Add
queued_countandstashed_countto callback template variables. This allows users to fire callbacks when whole groups are finished. #578 - Add new subcommand to set or unset environment variables for tasks. #503
Fixed
v3.4.1
v3.4.0
[3.4.0] - 2024-03-22
Added
- Support modification of task priorities via
pueue edit --priority/-oandpueue restart --edit-priority/-o#449. - If no output directory is provided in
completions, the generated file is printed tostdout#489. - Allow setting the
parallel_tasksvalue of groups to0. Setting this value allows unlimited tasks for that group #500.