GNU bug report logs - #9311
23.3.50; Can't load some byte-compiled files on Windows

Previous Next

Package: emacs;

Reported by: Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>

Date: Wed, 17 Aug 2011 00:28:02 UTC

Severity: normal

Found in version 23.3.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 9311 in the body.
You can then email your comments to 9311 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9311; Package emacs. (Wed, 17 Aug 2011 00:28:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 17 Aug 2011 00:28:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>
To: bug-gnu-emacs <at> gnu.org
Subject: 23.3.50; Can't load some byte-compiled files on Windows
Date: Wed, 17 Aug 2011 09:24:43 +0900
I wrote c:/test.el as below and byte-compiled it.

(defun test ()
  (let ((l 1))
    (dotimes (i 100)
      nil)))

When I load it by load function with absolute path as below, I can't
load it and below message is displayed.  But it doesn't raise error.

(load "c:/test")
-> End of file during parsing: c:/test.elc

It doesn't occur with relative path from home directory or Linux
environment.  I confirmed it occurs with Windows environment and
absolute path, and it depends on the content of .el file (i.e. not all
.elc files can't be read).  It also occurs with pre-compiled binary
(*1).

(*1) http://ftp.gnu.org/pub/gnu/emacs/windows/emacs-23.3-bin-i386.zip

-- 
Kazuhiro Ito




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Wed, 17 Aug 2011 08:59:02 GMT) Full text and rfc822 format available.

Notification sent to Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>:
bug acknowledged by developer. (Wed, 17 Aug 2011 08:59:02 GMT) Full text and rfc822 format available.

Message #10 received at 9311-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>, Michael Albinus <michael.albinus <at> gmx.de>
Cc: 9311-done <at> debbugs.gnu.org
Subject: Re: bug#9311: 23.3.50; Can't load some byte-compiled files on Windows
Date: Wed, 17 Aug 2011 11:55:22 +0300
> Date: Wed, 17 Aug 2011 09:24:43 +0900
> From: Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>
> 
> I wrote c:/test.el as below and byte-compiled it.
> 
> (defun test ()
>   (let ((l 1))
>     (dotimes (i 100)
>       nil)))
> 
> When I load it by load function with absolute path as below, I can't
> load it and below message is displayed.  But it doesn't raise error.
> 
> (load "c:/test")
> -> End of file during parsing: c:/test.elc

This happens because Emacs thinks this file is remote.  It is almost a
duplicate of bug#5303, except that 5303 talked about files without an
extension, while this one is specific to .elc files.

I fixed this in revision 105479 on the trunk, by handling the DOS_NT
specific situation where `openp' returns -2, but there's no `load'
handler for the file.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9311; Package emacs. (Fri, 19 Aug 2011 12:30:02 GMT) Full text and rfc822 format available.

Message #13 received at 9311 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Eli Zaretskii <eliz <at> gnu.org>, Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>
Cc: Michael Albinus <michael.albinus <at> gmx.de>, 9311 <at> debbugs.gnu.org
Subject: Re: bug#9311: 23.3.50; Can't load some byte-compiled files on Windows
Date: Wed, 17 Aug 2011 14:50:31 +0200
Hi Eli,

I'm on a bike tour these days, being back end of next week. I'll have a look on this then.

C:/test shouldn't be regarded as remote. 

Best regards,  Michael.

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9311; Package emacs. (Tue, 30 Aug 2011 13:49:02 GMT) Full text and rfc822 format available.

Message #16 received at 9311 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>, 9311 <at> debbugs.gnu.org
Subject: Re: bug#9311: 23.3.50; Can't load some byte-compiled files on Windows
Date: Tue, 30 Aug 2011 15:45:40 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> This happens because Emacs thinks this file is remote.  It is almost a
> duplicate of bug#5303, except that 5303 talked about files without an
> extension, while this one is specific to .elc files.

In the discussion of bug#5303 there was the proposal to remove the
volume letter from `tramp-completion-file-name-regexp'. This was
postponed, because we were in pretest phase.

But we haven't done it after that release.

Shall we try it now? Somehow, we are still before a pretest ...

Best regards, Michael.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9311; Package emacs. (Tue, 30 Aug 2011 14:38:01 GMT) Full text and rfc822 format available.

Message #19 received at 9311 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>,
	9311 <at> debbugs.gnu.org
Subject: Re: bug#9311: 23.3.50; Can't load some byte-compiled files on Windows
Date: Tue, 30 Aug 2011 10:33:55 -0400
>> This happens because Emacs thinks this file is remote.  It is almost a
>> duplicate of bug#5303, except that 5303 talked about files without an
>> extension, while this one is specific to .elc files.
> In the discussion of bug#5303 there was the proposal to remove the
> volume letter from `tramp-completion-file-name-regexp'. This was
> postponed, because we were in pretest phase.
> But we haven't done it after that release.
> Shall we try it now? Somehow, we are still before a pretest ...

Coulf you post a sample patch, together with a discussion of the impact?


        Stefan




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9311; Package emacs. (Tue, 30 Aug 2011 15:30:03 GMT) Full text and rfc822 format available.

Message #22 received at 9311 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>,
	9311 <at> debbugs.gnu.org
Subject: Re: bug#9311: 23.3.50; Can't load some byte-compiled files on Windows
Date: Tue, 30 Aug 2011 17:26:38 +0200
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> In the discussion of bug#5303 there was the proposal to remove the
>> volume letter from `tramp-completion-file-name-regexp'. This was
>> postponed, because we were in pretest phase.
>> But we haven't done it after that release.
>> Shall we try it now? Somehow, we are still before a pretest ...
>
> Coulf you post a sample patch, together with a discussion of the impact?

Sometimes (I cannot reproduce it persistently), there are situations
that `expand-file-name' prefixes a remote file name by a volume
letter. Happens on win32 only, of course, and confuses Tramp.

In order to let Tramp continue its work, we have accepted remote file
names with a leading volume letter, which are removed by Tramp
then. This worked almost OK, except such cases as discussed in the
current (and earlier) bug reports.

Eli did suggest to remove this hack from Tramp, and to see during the
test where the unexpected volume letter prefix happens. Problems shall
be fixed there.

The following patch does it, in its final version there could be some
additional minor polishing.

--8<---------------cut here---------------start------------->8---
*** /home/albinus/src/tramp/lisp/tramp.el.~2.843~	2011-08-30 17:10:16.058151065 +0200
--- /home/albinus/src/tramp/lisp/tramp.el	2011-08-30 17:07:38.841961797 +0200
***************
*** 861,873 ****
  Also see `tramp-file-name-structure'.")
  
  ;;;###autoload
! (defconst tramp-root-regexp
!   (if (memq system-type '(cygwin windows-nt))
!       "\\`\\([a-zA-Z]:\\)?/"
!     "\\`/")
!   "Beginning of an incomplete Tramp file name.
! Usually, it is just \"\\\\`/\".  On W32 systems, there might be a
! volume letter, which will be removed by `tramp-drop-volume-letter'.")
  
  ;;;###autoload
  (defconst tramp-completion-file-name-regexp-unified
--- 861,868 ----
  Also see `tramp-file-name-structure'.")
  
  ;;;###autoload
! (defconst tramp-root-regexp "\\`/"
!   "Beginning of an incomplete Tramp file name.")
  
  ;;;###autoload
  (defconst tramp-completion-file-name-regexp-unified
***************
*** 1503,1509 ****
  but the remote system is Unix, this introduces a superfluous drive
  letter into the file name.  This function removes it."
  	(save-match-data
! 	  (if (string-match tramp-root-regexp name)
  	      (replace-match "/" nil t name)
  	    name)))
  
--- 1498,1504 ----
  but the remote system is Unix, this introduces a superfluous drive
  letter into the file name.  This function removes it."
  	(save-match-data
! 	  (if (string-match "\\`[a-zA-Z]:/" name)
  	      (replace-match "/" nil t name)
  	    name)))
  
--8<---------------cut here---------------end--------------->8---

>         Stefan

Best regards, Michael.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9311; Package emacs. (Tue, 30 Aug 2011 16:35:02 GMT) Full text and rfc822 format available.

Message #25 received at 9311 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>,
	9311 <at> debbugs.gnu.org
Subject: Re: bug#9311: 23.3.50; Can't load some byte-compiled files on Windows
Date: Tue, 30 Aug 2011 12:31:05 -0400
> In order to let Tramp continue its work, we have accepted remote file
> names with a leading volume letter, which are removed by Tramp
> then. This worked almost OK, except such cases as discussed in the
> current (and earlier) bug reports.
> Eli did suggest to remove this hack from Tramp, and to see during the
> test where the unexpected volume letter prefix happens. Problems shall
> be fixed there.

Sounds good.  We should fix it right instead of using the current workaround.

> @@ -861,13 +861,8 @@
>  Also see `tramp-file-name-structure'.")
 
>  ;;;###autoload
> -(defconst tramp-root-regexp
> -  (if (memq system-type '(cygwin windows-nt))
> -      "\\`\\([a-zA-Z]:\\)?/"
> -    "\\`/")
> -  "Beginning of an incomplete Tramp file name.
> -Usually, it is just \"\\\\`/\".  On W32 systems, there might be a
> -volume letter, which will be removed by `tramp-drop-volume-letter'.")
> +(defconst tramp-root-regexp "\\`/"
> +  "Beginning of an incomplete Tramp file name.")

Looks OK.

> @@ -1503,7 +1498,7 @@
>  but the remote system is Unix, this introduces a superfluous drive
>  letter into the file name.  This function removes it."
>  	(save-match-data
> -	  (if (string-match tramp-root-regexp name)
> +	  (if (string-match "\\`[a-zA-Z]:/" name)
>  	      (replace-match "/" nil t name)
>  	    name)))
 
Shouldn't tramp-drop-volume-letter disappear completely?


        Stefan


PS: by the way, here's a tiny informational patch about common
subexpression elimination and about how to silence the compiler
without a hack.


=== modified file 'lisp/net/tramp.el'
--- lisp/net/tramp.el	2011-07-24 14:57:37 +0000
+++ lisp/net/tramp.el	2011-08-30 16:27:59 +0000
@@ -871,9 +871,8 @@
 
 ;;;###autoload
 (defconst tramp-completion-file-name-regexp-unified
-  (if (memq system-type '(cygwin windows-nt))
-      (concat tramp-root-regexp "[^/]\\{2,\\}\\'")
-    (concat tramp-root-regexp "[^/]*\\'"))
+  (concat tramp-root-regexp (if (memq system-type '(cygwin windows-nt))
+                                "[^/]\\{2,\\}\\'" "[^/]*\\'"))
   "Value for `tramp-completion-file-name-regexp' for unified remoting.
 GNU Emacs uses a unified filename syntax for Tramp and Ange-FTP.
 See `tramp-file-name-structure' for more explanations.
@@ -1494,9 +1493,9 @@
 (tramp-compat-font-lock-add-keywords
  'emacs-lisp-mode '("\\<tramp-with-progress-reporter\\>"))
 
-(eval-and-compile			;; Silence compiler.
+(defalias 'tramp-drop-volume-letter
   (if (memq system-type '(cygwin windows-nt))
-      (defun tramp-drop-volume-letter (name)
+      (lambda (name)
 	"Cut off unnecessary drive letter from file NAME.
 The functions `tramp-*-handle-expand-file-name' call `expand-file-name'
 locally on a remote file name.  When the local system is a W32 system
@@ -1506,8 +1505,7 @@
 	  (if (string-match tramp-root-regexp name)
 	      (replace-match "/" nil t name)
 	    name)))
-
-    (defalias 'tramp-drop-volume-letter 'identity)))
+    #'identity))
 
 ;;; Config Manipulation Functions:
 





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9311; Package emacs. (Tue, 30 Aug 2011 17:59:01 GMT) Full text and rfc822 format available.

Message #28 received at 9311 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: kzhr <at> d1.dion.ne.jp, 9311 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: Re: bug#9311: 23.3.50; Can't load some byte-compiled files on Windows
Date: Tue, 30 Aug 2011 20:54:18 +0300
> From: Michael Albinus <michael.albinus <at> gmx.de>
> Cc: Eli Zaretskii <eliz <at> gnu.org>,  Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>,  9311 <at> debbugs.gnu.org
> Date: Tue, 30 Aug 2011 17:26:38 +0200
> 
> The following patch does it, in its final version there could be some
> additional minor polishing.
> 
> --8<---------------cut here---------------start------------->8---
> *** /home/albinus/src/tramp/lisp/tramp.el.~2.843~	2011-08-30 17:10:16.058151065 +0200
> --- /home/albinus/src/tramp/lisp/tramp.el	2011-08-30 17:07:38.841961797 +0200
> ***************
> *** 861,873 ****
>   Also see `tramp-file-name-structure'.")
>   
>   ;;;###autoload
> ! (defconst tramp-root-regexp
> !   (if (memq system-type '(cygwin windows-nt))
> !       "\\`\\([a-zA-Z]:\\)?/"
> !     "\\`/")
> !   "Beginning of an incomplete Tramp file name.
> ! Usually, it is just \"\\\\`/\".  On W32 systems, there might be a
> ! volume letter, which will be removed by `tramp-drop-volume-letter'.")
>   
>   ;;;###autoload
>   (defconst tramp-completion-file-name-regexp-unified
> --- 861,868 ----
>   Also see `tramp-file-name-structure'.")
>   
>   ;;;###autoload
> ! (defconst tramp-root-regexp "\\`/"
> !   "Beginning of an incomplete Tramp file name.")
>   
>   ;;;###autoload
>   (defconst tramp-completion-file-name-regexp-unified
> ***************
> *** 1503,1509 ****
>   but the remote system is Unix, this introduces a superfluous drive
>   letter into the file name.  This function removes it."
>   	(save-match-data
> ! 	  (if (string-match tramp-root-regexp name)
>   	      (replace-match "/" nil t name)
>   	    name)))
>   
> --- 1498,1504 ----
>   but the remote system is Unix, this introduces a superfluous drive
>   letter into the file name.  This function removes it."
>   	(save-match-data
> ! 	  (if (string-match "\\`[a-zA-Z]:/" name)
>   	      (replace-match "/" nil t name)
>   	    name)))
>   
> --8<---------------cut here---------------end--------------->8---

Thanks, this looks good to me.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9311; Package emacs. (Wed, 31 Aug 2011 10:00:02 GMT) Full text and rfc822 format available.

Message #31 received at 9311 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>,
	9311 <at> debbugs.gnu.org
Subject: Re: bug#9311: 23.3.50; Can't load some byte-compiled files on Windows
Date: Wed, 31 Aug 2011 11:56:18 +0200
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> Eli did suggest to remove this hack from Tramp, and to see during the
>> test where the unexpected volume letter prefix happens. Problems shall
>> be fixed there.
>
> Sounds good.  We should fix it right instead of using the current workaround.

I've committed the patch (slightly polished, as said). Let's see how it
goes on. I cannot test anything myself, I don't use Windows machines.

> Shouldn't tramp-drop-volume-letter disappear completely?

Unfortunately, not. In tramp-*-handle-expand-file-name, expand-file-name
is called for the local part of a remote file name in order to handle
"./" and "../". On Windows, this prefixes the result with the volume
letter, which must be removed afterwards.

>         Stefan
>
> PS: by the way, here's a tiny informational patch about common
> subexpression elimination and about how to silence the compiler
> without a hack.

Thanks, applied.

Best regards, Michael.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 28 Sep 2011 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 236 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.