emacsPackages: respect turnCompilationWarningToError and ignoreCompilationError at bytecompile time

Previously, these two attributes were only respected at nativecompile
time.
This commit is contained in:
Lin Jian 2024-09-23 16:14:55 +08:00
parent bc2ab9c42c
commit 2f7cc5a781
No known key found for this signature in database
GPG Key ID: A6698D36434F75A5
2 changed files with 11 additions and 2 deletions

View File

@ -31,3 +31,12 @@ The file can either be a tar file or an Emacs Lisp file."
;; Allow installing package tarfiles larger than 10MB
(setq large-file-warning-threshold nil)
(let ((flag (getenv "turnCompilationWarningToError")))
(when (and flag
(not (string-empty-p flag)))
(setq byte-compile-error-on-warn t)))
(let ((flag (getenv "ignoreCompilationError")))
(when (string-empty-p flag)
(setq byte-compile-debug t)))

View File

@ -64,6 +64,8 @@ libBuildHelper.extendMkDerivation' stdenv.mkDerivation (finalAttrs:
setupHook = args.setupHook or setupHook;
inherit turnCompilationWarningToError ignoreCompilationError;
meta = {
broken = false;
platforms = emacs.meta.platforms;
@ -76,8 +78,6 @@ libBuildHelper.extendMkDerivation' stdenv.mkDerivation (finalAttrs:
addEmacsNativeLoadPath = args.addEmacsNativeLoadPath or true;
inherit turnCompilationWarningToError ignoreCompilationError;
postInstall = ''
# Besides adding the output directory to the native load path, make sure
# the current package's elisp files are in the load path, otherwise