leftwm
leftwm copied to clipboard
feat(watchdog): deprecate leftwm-watchdog bin; gate leftwm behind feature
Description
Previously in #1192, we broke the leftwm binary (which is the leftwm-watchdog binary) out from the leftwm crate into the leftwm-watchdog crate to improve incremental compile times. However, because the interface for the leftwm-watchdog crate updates the installation command to cargo install leftwm leftwm-watchdog, which is relatively unituitive, in this commit, we revert #1192 to bring the leftwm binary back into the leftwm crate to allow installing all of leftwm with cargo install leftwm; this is nicer for "first time" users as it reduces confusion. The leftwm-watchdog binary is actually the leftwm binary, but that isn't always immediately obvious.
Any packagers who currently vendor leftwm-watchdog will need to remove the leftwm-watchdog crate and instead ensure the leftwm-watchdog feature is included in the build. Because this is a default feature, most packages should be fine. However, any package using --no-default-features will not vendor the leftwm binary unless the feature leftwm-watchdog is explicitly added back, e.g.:
cargo build --release --no-default-features --features leftwm-watchdog
For developers, the way to save time when doing incremental compilations is now to explicitly exclude the default feature leftwm-watchdog, e.g.:
cargo build --release --no-default-features
This reverts commit 5293219827bf0d2a982bf548b5fdbb0c4cc7d235.
This fixes #1323 and closes #1309.
Type of change
- [ ] Development change (no change visible to user)
- [x] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [x] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation only update (no change to the factual codebase)
- [x] This change requires a documentation update
Updated user documentation:
Add to https://github.com/leftwm/leftwm/wiki/Troubleshooting, under Environment:
- Issue: Leftwm binary not present
- Description: Leftwm binary not found after install
- Resolution: install/build with --features leftwm-watchdog
Add to https://github.com/leftwm/leftwm/wiki/Contributing-to-Leftwm---Tips-and-Tricks: Add section:
Incremental Builds
For incremental builds, you can get a faster build by excluding the
leftwm/leftwm-watchdogbinary. Use--no-default-featuresflag and then opt in to any features you require other thanleftwm-watchdog. Cargo should leave theleftwmbinary alone, unless you usecargo clean.
Checklist:
- [x] Ran
make testlocally with no errors or warnings reported Note: To fully reproduce CI checks, you will need to runmake test-full-nix. Usually, this is not necessary. - [ ] N/A Manual page has been updated accordingly
- [ ] Wiki pages have been updated accordingly (to perform after merge)
Thanks Mautamu. I think I can give this a spin at some point during the weekend. Should we possibly ping some package maintainers, especially the ones of distros/OSs with more exotic environments?
Should we possibly ping some package maintainers, especially the ones of distros/OSs with more exotic environments?
That sounds like a great idea! Can ping in Discord, but not sure who all's a maintainer on GitHub.
cc: @0323pin @adcdam @erikdubois
As a heads up, PR 1324 will have a breaking change that may require altering the packaging used for leftwm. Namely, the leftwm-watchdog crate will be deprecated in favor of gating the leftwm-watchdog binary behind the new leftwm-watchdog feature. If you customize the features that ship with leftwm, you might need to add leftwm-watchdog to the feature list.
Example:
# Will no longer ship the `leftwm` binary, preventing `leftwm` from starting or quietly leaving abandoned file behind:
cargo build --release --features xlib,journald-log --no-default-features
# Modified version that will ship the `leftwm` binary:
cargo build --release --features xlib,journald-log,leftwm-watchdog --no-default-features
# Unaffected since we accept default features but just add sys-log
cargo build --release --features sys-log
# Will result in an error since both `leftwm` and `leftwm-watchdog` provide the `leftwm` binary
cargo install leftwm leftwm-watchdog
- Are there any concerns with this approach? The rationale for not using a crate for leftwm-watchdog is that it requires an additional step (installing both leftwm and leftwm-watchdog) for end users who are installing from scratch. The reason for gating behind a feature flag is that it allows for developers to use a faster incremental build when needed.
- Should this warrant a minor version bump (0.6.0), or are we alright to do a patch version (0.5.5)? I'm tending towards the former.
Should we possibly ping some package maintainers, especially the ones of distros/OSs with more exotic environments?
That sounds like a great idea! Can ping in Discord, but not sure who all's a maintainer on GitHub.
cc: @0323pin @adcdam @erikdubois
I'm not on Discord and Matrix was too empty so, I've left the room. Easiest for me it's here on Github.
What would be the preference from a developer perspective?
What would be the preference from a developer perspective?
For being contacted? Or related to the PR?
For contact imo it's totally fine to reach package maintainers via github.
Actually it would be great if Repology had a feature to notify package maintainers...
What would be the preference from a developer perspective?
For being contacted? Or related to the PR?
For contact imo it's totally fine to reach package maintainers via github.
Actually it would be great if Repology had a feature to notify package maintainers...
Sorry for being unclear. I was asking for prefered build options for the package. Default is not an option as none of my systems have systemd.
Sorry for being unclear. I was asking for prefered build options for the package. Default is not an option as none of my systems have
systemd.
No problem.
Basically you just add leftwm-watchdog to the --features= e.g. cargo build --release --features xlib,sys-log,leftwm-watchdog --no-default-features
No problem. Basically you just add
leftwm-watchdogto the--features=e.g.cargo build --release --features xlib,sys-log,leftwm-watchdog --no-default-features
Cheers, I'll just add it to list in the package Makefile. Right now it has:
[...]
CARGO_NO_DEFAULT_FEATURES= YES
CARGO_FEATURES+= lefthk file-log xlib
[...]
I'd guess you simply forgot lefthk above 😉
I'd guess you simply forgot
lefthkabove 😉
Actually it was missing x11rb or xlib, it just occurred as I tried to do purposefull error run, but wasn't expecting this one :grinning:
building without lefthk should be fine, you just wont have any keybinds and could use your own keybind tool which talks to leftwm through either the command pipe or through leftwm-command.
x11rb is an alternative pure rust backend iirc.
x11rbis an alternative pure rust backend iirc.
I've tried it and it works but didn't respect the Gtk theme (or, something else I no longer remember), so I just went back to xlib and forgot about it.
Awesome; thanks for taking a look, 0323pin and VuiMuich!
Seems we can probably merge this tomorrow. Will also update the PKGBUILD so that AUR's leftwm-systemd-git will continue building.
Wiki updated! Will likely need to cut a 0.6.x release for this whenever we do our next release.
Wiki updated! Will likely need to cut a 0.6.x release for this whenever we do our next release.
I was thinking about a release, too. But I had a few little regressions in the focusing logic (at least for ClickTo) for which I haven't found time to triage yet. Both are related to closing windows, in some cases this causes a switch to the previous focused tag and sometimes all scratchpads get unhidden but unfocused and unhideable until the tag is switched.
Finally I had the chance to rebuild from git-HEAD, all good on Void Linux 😉
Glad to hear, thanks for checking, pin!