Subject: 28.0.50; [PATCH] [native-comp] Improve backtraces from async workers
From: Phil Brown <[email-masked]>
To: [email-masked]
Date: Fri, 15 Jan 2021 10:19:37 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi bug list,

I've been happily using the native-comp branch and it works well. Attached
is a tiny change to set `backtrace-line-length' in comp.el's async workers.
I was debugging a few failed compilations and had run `(setq
backtrace-line-length 0)` in an attempt to see the full path of the
offending files (turned out to be autoloads). The setting was having no
effect on the async compile errors and I realized the batch-mode worker
processes weren't inheriting it.

I haven't signed CA papers since this change is so small, but am happy to
if that's needed.

Thanks!
-Phil

In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.5,
cairo version 1.16.0)
 of 2020-12-23 built on mars
Repository revision: ffcd490cb49ba86d625288ea425d98e8cac22a05
Repository branch: feature/native-comp
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description: Debian GNU/Linux 10 (buster)

Configured using:
 'configure --prefix=/home/phil/local/emacs-28-snapshot-native-comp
 --with-nativecomp'
From 24da03e0992e02a3bad9aac76706ad84bab6baa0 Mon Sep 17 00:00:00 2001
From: Philip Brown <[email-masked]>
Date: Fri, 15 Jan 2021 00:35:36 -0800
Subject: [PATCH] Set backtrace-line-length in async worker processes

* lisp/emacs-lisp/comp.el (comp-run-async-workers): Set
backtrace-line-length in async worker processes.

Copyright-paperwork-exempt: yes
---
 lisp/emacs-lisp/comp.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 875f15aa75..c974a09f6d 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -3802,6 +3802,8 @@ comp-run-async-workers
                    source-file (comp-el-to-eln-filename source-file)))
          do (let* ((expr `(progn
                             (require 'comp)
+                            ,(when (boundp 'backtrace-line-length)
+                               `(setq backtrace-line-length ,backtrace-line-length))
                             (setf comp-speed ,comp-speed
                                   comp-debug ,comp-debug
                                   comp-verbose ,comp-verbose
-- 
2.20.1