Bug 269320 - [new port] x11/waylock
Summary: [new port] x11/waylock
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Jan Beich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-04 12:36 UTC by Oleh Vinichenko
Modified: 2023-02-06 20:04 UTC (History)
1 user (show)

See Also:


Attachments
v0 (apply via "git am") (6.98 KB, patch)
2023-02-04 14:43 UTC, Jan Beich
no flags Details | Diff
v0 (apply via "git am") (7.19 KB, patch)
2023-02-04 14:46 UTC, Jan Beich
no flags Details | Diff
v0 (apply via "git am") (4.77 KB, patch)
2023-02-04 14:52 UTC, Jan Beich
no flags Details | Diff
upstream patch (1.62 KB, patch)
2023-02-06 18:51 UTC, Oleh Vinichenko
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oleh Vinichenko 2023-02-04 12:36:26 UTC
As per summary. Waylock is a screenlocker for Wayland similar to swaylock but written in zig by river author. [1], [2].
References:
[1]: https://github.com/ifreund/waylock
[2]: https://github.com/ifreund/waylock/blob/master/PACKAGING.md
Notice, that -Dcpu=baseline is essential for compiling binary that will run on outdated CPU's. This is also reflected in:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269206
Comment 1 Jan Beich freebsd_committer freebsd_triage 2023-02-04 14:43:31 UTC
Created attachment 239901 [details]
v0 (apply via "git am")

Does it actually work for you? Can you unlock the screen? Packaging is the easy part as one can use x11-wm/river + x11/swaylock as templates.

Disclaimer: I'm not interested in Zig or waylock myself.
Comment 2 Jan Beich freebsd_committer freebsd_triage 2023-02-04 14:46:18 UTC
Created attachment 239902 [details]
v0 (apply via "git am")

Oops, forgot to add security/unix-selfauth-helper to dependencies.
Comment 3 Jan Beich freebsd_committer freebsd_triage 2023-02-04 14:52:48 UTC
Created attachment 239903 [details]
v0 (apply via "git am")

Oops, missed v0.6.1 which doesn't need patching for Zig 0.10.
Comment 4 Oleh Vinichenko 2023-02-04 20:56:39 UTC
thanks for adding. i tried building it, with latest patch ( attachment 293903 ). unfortunately, i am unable to unlock it. waylock just gives black screen, and typing password gives nothing. i will contact upstream about this.
Comment 5 Oleh Vinichenko 2023-02-04 21:24:19 UTC
the reason of such behavior is that waylock segfaulted. will investigate further.
Comment 6 Oleh Vinichenko 2023-02-05 19:07:39 UTC
to proceed with core dump investigation i was said to not strip debug symbols ( line with WITH_DEBUG in CONFIGURE_ARGS ), i can try this locally in port, but how exactly?
Comment 7 Jan Beich freebsd_committer freebsd_triage 2023-02-06 11:04:04 UTC
WITH_DEBUG is a ports-global feature, usually defined on command-line, its value can be anything (including empty). See /usr/ports/Mk/Features/debug.mk
Try "make clean all deinstall install WITH_DEBUG= " (without quotes)
Comment 8 Jan Beich freebsd_committer freebsd_triage 2023-02-06 11:26:25 UTC
Installing waylock port/package is only necessary to get FreeBSD-specific PAM config (exactly same as in x11/swaylock) i.e., etc/pam.d/waylock + unix-selfauth-helper package. After that you can debug the regular way from a Git tree via "zig build && zig-out/bin/waylock", "git bisect ...", etc.
Comment 9 Oleh Vinichenko 2023-02-06 18:51:13 UTC
Created attachment 239955 [details]
upstream patch

attached patch from upstream resolved the issue. Notice, that soon after i tested the patch and confirmed it fixes, there will be new 0.6.2 tag, so it's best to wait for new sources. Thank you very much for port.
Comment 10 Oleh Vinichenko 2023-02-06 19:22:50 UTC
another suggestion was to use safe instead fast in -Drelease
Comment 11 Oleh Vinichenko 2023-02-06 19:23:48 UTC
https://github.com/ifreund/waylock/releases/tag/v0.6.2
Comment 12 commit-hook freebsd_committer freebsd_triage 2023-02-06 19:26:28 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=16ce45fc2070b7333d7c4f7d0040c14426f37748

commit 16ce45fc2070b7333d7c4f7d0040c14426f37748
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2023-02-06 19:04:21 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2023-02-06 19:25:58 +0000

    x11/waylock: add new port

    Waylock is a small screenlocker for Wayland compositors implementing
    ext-session-lock-v1. The ext-session-lock-v1 protocol is significantly
    more robust than previous client-side Wayland screen locking approaches.
    Importantly, the screenlocker crashing does not cause the session to be
    unlocked.

    https://github.com/ifreund/waylock

    PR:             269320
    Tested by:      Oleh Vinichenko

 x11/Makefile                                |  1 +
 x11/waylock/Makefile (new)                  | 54 +++++++++++++++++++++++++++++
 x11/waylock/distinfo (new)                  |  7 ++++
 x11/waylock/files/patch-pam.d_waylock (new) | 11 ++++++
 x11/waylock/pkg-descr (new)                 |  5 +++
 5 files changed, 78 insertions(+)
Comment 13 Jan Beich freebsd_committer freebsd_triage 2023-02-06 19:32:48 UTC
Thanks for the help (testing, debugging, contacting upstream). I've fixed a similar issue in ports e239314a86fd.
Comment 14 Jan Beich freebsd_committer freebsd_triage 2023-02-06 19:52:11 UTC
(In reply to Oleh Vinichenko from comment #10)
Zig itself is built with -Drelease-fast according to https://github.com/ziglang/zig/commit/72800f176e70 
-Drelease-fast also matches -DNDEBUG behavior in other ports (default at least in USES=cmake consumers).

I'm trying to keep Zig bits consistent to facilitate refactoring into USES=zig.
Comment 15 commit-hook freebsd_committer freebsd_triage 2023-02-06 20:04:33 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=425effc683bc48fedc3d12b348c85977910ce2b0

commit 425effc683bc48fedc3d12b348c85977910ce2b0
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2023-02-06 19:56:44 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2023-02-06 20:03:31 +0000

    x11/waylock: disable bogus "make test" support

    All other lang/zig consumers have tests but not this one.

    $ zig build test
    error: Cannot run step 'test' because it does not exist

    PR:             269320

 x11/waylock/Makefile | 3 ---
 1 file changed, 3 deletions(-)