The temporary-file-directory on my host is "/tmp/", current function trancates the first charactor of the directory name, cause the directory not exist error.

Below patch removes the folder separator of the temporary-file-directory, works fine in my environment.

diff --git a/lisp/progmodes/flymake-proc.el b/lisp/progmodes/flymake-proc.el
index 7cdbb266fe..f0b979185e 100644
--- a/lisp/progmodes/flymake-proc.el
+++ b/lisp/progmodes/flymake-proc.el
@@ -886,7 +886,7 @@ can also be executed interactively independently of
 
 (defun flymake-proc--delete-temp-directory (dir-name)
   "Attempt to delete temp dir created by `flymake-proc-create-temp-with-folder-structure', do not fail on error."
-  (let* ((temp-dir    temporary-file-directory)
+  (let* ((temp-dir    (directory-file-name temporary-file-directory))
         (suffix      (substring dir-name (1+ (length temp-dir)))))
 
     (while (> (length suffix) 0)