[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/native-comp 4a1bb46 7/7: * Native compiling do not target a dire
From: |
Andrea Corallo |
Subject: |
feature/native-comp 4a1bb46 7/7: * Native compiling do not target a directory with no write permission |
Date: |
Tue, 6 Oct 2020 12:37:44 -0400 (EDT) |
branch: feature/native-comp
commit 4a1bb4626053d5be5d3e869d6b7049dc3269d812
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>
* Native compiling do not target a directory with no write permission
* src/comp.c (Fcomp_el_to_eln_filename): Check for write
permission while choosing the output directory in
`comp-eln-load-path'.
---
src/comp.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/src/comp.c b/src/comp.c
index 076236e..ba4089e 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -4080,8 +4080,22 @@ If BASE-DIR is nil use the first entry in
`comp-eln-load-path'. */)
separator);
Lisp_Object hash = concat3 (path_hash, separator, content_hash);
filename = concat3 (filename, hash, build_string (NATIVE_ELISP_SUFFIX));
+
+ /* If base_dir was not specified search inside Vcomp_eln_load_path
+ for the first directory where we have write access. */
if (NILP (base_dir))
- base_dir = XCAR (Vcomp_eln_load_path);
+ {
+ Lisp_Object eln_load_paths = Vcomp_eln_load_path;
+ FOR_EACH_TAIL (eln_load_paths)
+ if (!NILP (Ffile_writable_p (XCAR (eln_load_paths))))
+ {
+ base_dir = XCAR (eln_load_paths);
+ break;
+ }
+ /* If we can't find it return Nil. */
+ if (NILP (base_dir))
+ return Qnil;
+ }
if (!file_name_absolute_p (SSDATA (base_dir)))
base_dir = Fexpand_file_name (base_dir, Vinvocation_directory);
- feature/native-comp updated (3232000 -> 4a1bb46), Andrea Corallo, 2020/10/06
- feature/native-comp ad5a2bb 1/7: Revert "Add `advice-flet' macro", Andrea Corallo, 2020/10/06
- feature/native-comp f43dbe6 5/7: Add a test for primitive redefinition, Andrea Corallo, 2020/10/06
- feature/native-comp 4a1bb46 7/7: * Native compiling do not target a directory with no write permission,
Andrea Corallo <=
- feature/native-comp 0b58be4 3/7: Rename comp-subr-safe-advice -> comp-subr-trampoline-install, Andrea Corallo, 2020/10/06
- feature/native-comp b3ade4d 2/7: Revert "Use `advice-flet' in place of `cl-letf' to avoid primitive..., Andrea Corallo, 2020/10/06
- feature/native-comp 87c6aa1 4/7: Make primitive redefinition effective through trampoline synthesis, Andrea Corallo, 2020/10/06
- feature/native-comp 29f7024 6/7: * Fix a test in test/lisp/subr-tests.el, Andrea Corallo, 2020/10/06