Skip to content

fix(build): libpam fallback detection for Debian - #714

Merged
JimmyCozza merged 1 commit into
trip-zip:release/1.4from
shuber2:fix/debian-pam-detection
Aug 26, 2026
Merged

fix(build): libpam fallback detection for Debian#714
JimmyCozza merged 1 commit into
trip-zip:release/1.4from
shuber2:fix/debian-pam-detection

Conversation

@shuber2

@shuber2 shuber2 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Description

The lockscreen did not work on Debian machines. The reason was that meson would not find pam, although the pam dev package was installed. However, upstream PAM does not ship pkg-config files, and so it depends on the distro to ship one. Debian does not. Hence, we need a fallback mechanism here.

Test Plan

Manual test on Debian. Confirmed on Debian Trixie on two different machines.

AI Usage

Debugged and implemented with the help of Claude.

Checklist

  • Lua libraries (lua/awful/, lua/gears/, lua/wibox/, lua/naughty/) are not modified — if a bug surfaces in Lua, the fix belongs in C
  • Tests pass (make test-unit && make test-integration)

@shuber2 shuber2 changed the title fix(build): detect libpam without pkg-config/cmake metadata fix(build): libpam fallback detection for Debian Aug 25, 2026
@shuber2
shuber2 force-pushed the fix/debian-pam-detection branch from 5ed1f64 to a64ab94 Compare August 25, 2026 16:01

@JimmyCozza JimmyCozza left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shuber2 Thanks for finding this.

I do have 1 question about this for you. Now that dependency() is called with required:false, does -Dpam=disabled still turn PAM off where pam.pc does exist? I would just like to make sure that we keep that path working for anyone who locks with swaylock and don't want libpam linked into the compositor.

Upstream PAM ships no pam.pc or CMake config, so availability of
pkg-config detection depends on the distribution. For instance, Debian
does not ship it, so pam is not detected by the Meson build, although it
is available.

Implement a fallback mechanism by detecting the header file along with
the library.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@shuber2
shuber2 force-pushed the fix/debian-pam-detection branch from a64ab94 to 10208d2 Compare August 26, 2026 16:40
@shuber2

shuber2 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

I was just about to write why the logic is correct, until I saw it was not. Oh man, three-valued logic fail.

Anyway, I took the opportunity to add some comment on the intended logic and reorganized the case distinction. Now it is evident that pam_option.disabled() leads to have_pam = false. The pam_dep logic is entirely opportunistic. The case for pam_option.enabled() is a single post-hoc check.

Sorry I did not realize right ahead.

@JimmyCozza JimmyCozza left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

Thanks @shuber2

@JimmyCozza
JimmyCozza merged commit 394fd3b into trip-zip:release/1.4 Aug 26, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants