Bug 268714 - shells/zsh: log/watch functionality disabled for poudriere/synth builds
Summary: shells/zsh: log/watch functionality disabled for poudriere/synth builds
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Baptiste Daroussin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-02 11:38 UTC by Oliver Kiddle
Modified: 2023-04-06 13:11 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (bapt)


Attachments
Touch utx.active from Makefile to trick autoconf (452 bytes, patch)
2023-01-02 11:38 UTC, Oliver Kiddle
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Kiddle 2023-01-02 11:38:21 UTC
Created attachment 239205 [details]
Touch utx.active from Makefile to trick autoconf

When running the zsh log builtin on FreeBSD, I get:

    log: not available on this system

If I build zsh from source, it works fine. The cause of this is an autoconf test in the zsh configure script which looks for the appropriate utmp file for login information. In the case of recent FreeBSD, this is /var/run/utx.active. I think the problem is that when zsh is built with poudriere or synth, a chroot or jail or similar is used where this file is absent. I attach a patch which touches that file from the Makefile as a simple hack to trick the autoconf test. I've only tested this with synth. Maybe you have better ideas on how the autoconf test should be written?

An unrelated minor item with the zsh port Makefile is that I think ZSH_VER should be defined to be ${DISTVERSION} instead of ${PORTVERSION}. It is the distributed version that zsh inserts into the paths for the distributed functions. I typically build a newer zsh from git as a port and my git repo has carried that change for some time.
Comment 1 Baptiste Daroussin freebsd_committer freebsd_triage 2023-04-06 13:11:11 UTC
thank you I have fixed another way.
Comment 2 commit-hook freebsd_committer freebsd_triage 2023-04-06 13:11:17 UTC
A commit in branch main references this bug:

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

commit ea5eba5c4dace0b04f8f6bb3d1bc697f03bacc79
Author:     Baptiste Daroussin <bapt@FreeBSD.org>
AuthorDate: 2023-04-06 13:07:15 +0000
Commit:     Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2023-04-06 13:10:43 +0000

    shells/zsh: cache the utx.active location

    On fresh jails or chroot the /var/run/utx.active might not exist (like
    in poudriere for example) but configure script is looking for its
    existance to determine its existance and activate the build of the
    utmx logging feature internally.

    Caching it makes the configure script always build the logging features.

    While here, make ZSH_VER use the distversion, which fixes the usecase of
    building snapshots of zsh via the port.

    PR:     268714
    Reported by:    okiddle@yahoo.co.uk

 shells/zsh/Makefile | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)