guix_mirror_bot pushed a commit to branch master
in repository guix.

commit f47cb2d4e7a997f22d21f1d6465d8fc39008bdaf
Author: Tomas Volf <[email protected]>
AuthorDate: Thu Jul 16 21:26:53 2026 +0200

    gnu: emacs-projectile: Skip some tests under native compilation.
    
    * gnu/packages/emacs-xyz.scm (emacs-projectile)[arguments]<#:phases>
    {fix-failing-test}: Skip few tests when native compiling.
    <#:modules>: Add (rnrs io ports), (ice-9 popen).
    
    Signed-off-by: Liliana Marie Prikler <[email protected]>
    Merges: guix/guix#9988
---
 gnu/packages/emacs-xyz.scm | 41 +++++++++++++++++++++++++++++++++++++++--
 1 file changed, 39 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 42977706f7..8011bf2d17 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -19182,8 +19182,8 @@ like @code{org-edit-src-code} but for arbitrary 
regions.")
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/bbatsov/projectile";)
-             (commit (string-append "v" version))))
+              (url "https://github.com/bbatsov/projectile";)
+              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
         (base32
@@ -19192,10 +19192,47 @@ like @code{org-edit-src-code} but for arbitrary 
regions.")
     (arguments
      (list
       #:test-command #~(list "buttercup" "-L" "." "-L" "test")
+      #:modules '((rnrs io ports)
+                  (ice-9 popen)
+                  (guix build emacs-build-system)
+                  (guix build utils)
+                  (guix build emacs-utils))
       #:phases
       #~(modify-phases %standard-phases
           (add-before 'check 'fix-failing-test
             (lambda _
+              (let* ((port
+                      (open-pipe* OPEN_READ
+                                  "emacs" "-Q" "--batch" "--eval"
+                                  "(princ system-configuration-features)"))
+                     (features (get-string-all port))
+                     (status (close-pipe port)))
+                (unless (zero? (status:exit-val status))
+                  (error "emacs failed"))
+                (when (string-contains features "NATIVE_COMP")
+                  ;; These tests are problematic under native compilation due
+                  ;; to spying on file-exists-p.  Some of them fail already,
+                  ;; some could fail in the future.  So just disable them.
+                  ;;
+                  ;; Upstream bug report:
+                  ;;     https://github.com/bbatsov/projectile/issues/2100
+                  (let-syntax ((disable
+                                (syntax-rules ()
+                                  ((_ file it ...)
+                                   (substitute* file
+                                     ((it all)
+                                      (string-append "x" all)) ...)))))
+                    (disable
+                     "test/projectile-ignore-test.el"
+                     "it \"parses dirconfig and returns directories to "
+                     "it \"skips leading whitespace before dispatching ")
+                    (disable
+                     "test/projectile-relation-test.el"
+                     "it \"dir-fn and filename-fn applied correctly"
+                     "it \"returns nil when src-dir function result is not an"
+                     "it \"returns file relative to project root"
+                     "it \"returns result of projectile--complementary-file "
+                     "it \"error when test file does not exist and "))))
               (substitute* "test/projectile-indexing-test.el"
                 (("user-emacs-directory") "\".\"")))))))
     (native-inputs

Reply via email to