Subject: bug#48067: 28.0.50; Tramp error: cannot determine gio monitor

From: Michael Albinus <[email-masked]>
Date: Wed, 28 Apr 2021 09:38:27 +0200

Thierry Volpiatto <[email-masked]> writes:

>> Hi Michael,

Hi Thierry,

> More exactly, it seems gio command is correctly extracted in
> `tramp-sh-handle-file-notify-add-watch` with
> (tramp-get-remote-gio-monitor v) but later in the process filter
> (tramp-connection-property-p proc "gio-file-monitor") returns nil.

Does the appended patch fixes this?

> Thanks.

Best regards, Michael.

*** /tmp/ediffdHBFUW	2021-04-28 09:36:25.118483724 +0200
--- /home/albinus/src/tramp/lisp/tramp-sh.el	2021-04-28 09:36:03.920592244 +0200
***************
*** 3731,3737 ****
        ;; Determine monitor name.
        (unless (tramp-connection-property-p proc "gio-file-monitor")
          (cond
!          ;; We have seen this on cygwin gio and on emba.  Let's make some assumptions.
           ((string-match
             "Can't find module 'help' specified in GIO_USE_FILE_MONITOR" string)
            (cond
--- 3731,3738 ----
        ;; Determine monitor name.
        (unless (tramp-connection-property-p proc "gio-file-monitor")
          (cond
!          ;; We have seen this on cygwin gio and on emba.  Let's make
!          ;; some assumptions.
           ((string-match
             "Can't find module 'help' specified in GIO_USE_FILE_MONITOR" string)
            (cond
***************
*** 3741,3747 ****
             ((eq system-type 'cygwin)
              (tramp-set-connection-property
               proc "gio-file-monitor" 'GPollFileMonitor))
!            (t (tramp-error proc 'file-error "Cannot determine gio monitor"))))
           ;; TODO: What happens, if several monitor names are reported?
           ((string-match "\
  Supported arguments for GIO_USE_FILE_MONITOR environment variable:
--- 3742,3749 ----
             ((eq system-type 'cygwin)
              (tramp-set-connection-property
               proc "gio-file-monitor" 'GPollFileMonitor))
!            (t (tramp-set-connection-property
!                proc "gio-file-monitor" tramp-cache-undefined))))
           ;; TODO: What happens, if several monitor names are reported?
           ((string-match "\
  Supported arguments for GIO_USE_FILE_MONITOR environment variable: