Bug 2524933
| Summary: | emacs warns missing lexical-binding cookie in rpmdev-init.el | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Akira TAGOH <tagoh> |
| Component: | rpmdevtools | Assignee: | Neal Gompa <ngompa13> |
| Status: | NEW --- | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | rawhide | CC: | bugs.michael, decathorpe, gojun077, kevin, mattias.ellert, mavit, ngompa13, stephen, twoerner |
| Target Milestone: | --- | Flags: | fedora-admin-xmlrpc:
mirror+
|
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | --- | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | Type: | --- | |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 2545603 | ||
|
Description
Akira TAGOH
2026-08-27 11:36:01 UTC
There's a partial workaround in https://src.fedoraproject.org/rpms/rpmdevtools/pull-request/14, in that it allows one to uninstall rpmdev-init.el without uninstalling the rest of rpmdevtools. rpmdevtools: rpmdev-init.el lacks lexical-binding cookie, Emacs 30+ warns at every startup Description of problem: /usr/share/emacs/site-lisp/site-start.d/rpmdev-init.el has no "lexical-binding" file-local variable cookie. Since Emacs 30, loading an Elisp file without the cookie emits a warning, and because this file is in site-start.d it is loaded on every Emacs startup, so every user who has rpmdevtools installed sees: Warning (files): Missing 'lexical-binding' cookie in "/usr/share/emacs/site-lisp/site-start.d/rpmdev-init.el". The file is part of the upstream rpmdevtools tarball, so this may need forwarding to https://pagure.io/rpmdevtools. Version-Release number of selected component: rpmdevtools-9.6-15.fc45.noarch emacs-common-31.1-8.fc45.aarch64 How reproducible: Always Steps to Reproduce: 1. dnf install emacs rpmdevtools 2. Start Emacs normally (not with -Q, which skips site-start) 3. Look at the *Warnings* buffer Actual results: A "Missing 'lexical-binding' cookie" warning for rpmdev-init.el is shown at every startup. Expected results: No warning. Additional info: Adding a first line is enough: ;;; rpmdev-init.el --- rpmdevtools integration for rpm-spec-mode -*- lexical-binding: t; -*- Lexical binding changes no behavior here: the only let-binding (`packager' in rpmdev-init-packager) is purely local, and the rpmdev-packager-* variables are declared with defvar. With the cookie added, Emacs 31.1 byte-compiles the file with only two warnings, both present without the cookie too: Warning: reference to free variable 'rpm-spec-user-mail-address' Warning: reference to free variable 'rpm-spec-user-full-name' Free variable references stay dynamic under lexical binding, so these are harmless; adding (defvar rpm-spec-user-mail-address) (defvar rpm-spec-user-full-name) near the top would silence them as well. |