Forwarding:
- Gentoo bug <https://bugs.gentoo.org/965834>
- Emacs bug <https://bugs.gnu.org/79801>
Building of Emacs fails when the SHELL environment variable points to a
non-existent file:
'../src/emacs' -batch --no-site-file --no-site-lisp --eval "(setq
load-prefer-newer t byte-compile-warnings 'all)" --eval "(setq
org--inhibit-version-check t)" -f batch-byte-compile org/org-timer.el
In toplevel form:
org/org-timer.el:42:11: Error: Searching for program: No such file or
directory, /usr/bin/nonexistent
make[3]: *** [Makefile:336: org/org-timer.elc] Error 1
make[3]: Leaving directory
'/tmp/portage/app-editors/emacs-31.0.9999/work/emacs/lisp'
make[2]: *** [Makefile:366: compile-main] Error 2
make[2]: Leaving directory
'/tmp/portage/app-editors/emacs-31.0.9999/work/emacs/lisp'
make[1]: *** [Makefile:529: lisp] Error 2
make[1]: Leaving directory
'/tmp/portage/app-editors/emacs-31.0.9999/work/emacs'
Of course, SHELL should normally point to something valid. Nevertheless,
it shouldn't leak into the build, especially when all Makefiles set the
variable to something well defined.
AFAICS the problem is triggered by this code in org/org-clock.el:
(defvar org-x11idle-exists-p
;; Check that x11idle exists. But don't do that on DOS/Windows,
;; since the command definitely does NOT exist there, and invoking
;; COMMAND.COM on MS-Windows is a bad idea -- it hangs.
(and (null (memq system-type '(windows-nt ms-dos)))
(eq 0 (call-process-shell-command
(format "command -v %s" org-clock-x11idle-program-name)))
;; Check that x11idle can retrieve the idle time
;; FIXME: Why "..-shell-command" rather than just `call-process'?
(eq 0 (call-process-shell-command org-clock-x11idle-program-name))))
I wonder if the first call-process-shell-command could be replaced by
executable-find, and the second one by call-process (as the comment
above it says)?