all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Barry OReilly <gundaetiapo@gmail.com>
Cc: 13921@debbugs.gnu.org
Subject: bug#13921: 24.2; Misbehavior of expand-file-name on Cygwin with Emacs 24.2
Date: Mon, 11 Mar 2013 18:30:37 +0200	[thread overview]
Message-ID: <83boapx5jm.fsf@gnu.org> (raw)
In-Reply-To: <CAFM41H34Xttos5wJpzBtR-=qdxkBviHkHEVC8p+XsCfRzpxv_g@mail.gmail.com>

> Date: Sun, 10 Mar 2013 22:03:31 -0400
> From: Barry OReilly <gundaetiapo@gmail.com>
> 
> When I attempted to build CEDET from their bzr trunk (revno 8498), the
> build failed due to expand-file-name function returning an incorrect "d:"
> prefix.  Under other conditions expand-file-name returns the correct "c:"
> prefix.  Some command line IO will illustrate:
> 
> [CEDET build issues this:]
>  emacs -batch --no-site-file --eval '(setq debug-on-error t)' -l
> "../../cedet-remove-builtin.el" -L . --eval '(progn (require (quote
> cedet-compat)) (require (quote mode-local)))' -L ../eieio/ -L ./ -L ./
> --eval '(progn  (setq generated-autoload-file
> "/home/epich/sw/cedet/lisp/cedet/loaddefs.el"))' -f batch-update-autoloads
> /home/epich/sw/cedet/lisp/cedet
> Debugger entered--Lisp error: (file-error "Opening output file" "no such
> file or directory" "d:/home/epich/sw/cedet/lisp/cedet/loaddefs.el")
>   write-region(";;; loaddefs.el --- automatically extracted
> autoloads\n;;\n;;; Code:\n\n\f\n(provide 'loaddefs)\n;; Local
> Variables:\n;; version-control: never\n;; no-byte-compile: t\n;;
> no-update-autoloads: t\n;; coding: utf-8\n;; End:\n;;; loaddefs.el ends
> here\n" nil "d:/home/epich/sw/cedet/lisp/cedet/loaddefs.el")
> 
> autoload-ensure-default-file("d:/home/epich/sw/cedet/lisp/cedet/loaddefs.el")
>   autoload-find-generated-file()
>   update-directory-autoloads("/home/epich/sw/cedet/lisp/cedet")
>   apply(update-directory-autoloads "/home/epich/sw/cedet/lisp/cedet")
>   batch-update-autoloads()
>   command-line-1(("--eval" "(setq debug-on-error t)" "-l"
> "../../cedet-remove-builtin.el" "-L" "." "--eval" "(progn (require (quote
> cedet-compat)) (require (quote mode-local)))" "-L" "../eieio/" "-L" "./"
> "-L" "./" "--eval" "(progn  (setq generated-autoload-file
> \"/home/epich/sw/cedet/lisp/cedet/loaddefs.el\"))" "-f"
> "batch-update-autoloads" "/home/epich/sw/cedet/lisp/cedet"))
>   command-line()
>   normal-top-level()
> 
> Comparing the backtrace above with the source code, it's evident
> expand-file-name prepended the "d:" to the filename to get:
> "d:/home/epich/sw/cedet/lisp/cedet/loaddefs.el".
> 
> However, when I evaluate (expand-file-name
> "/home/epich/sw/cedet/lisp/cedet") in the the scratch, I get
> "c:/home/epich/sw/cedet/lisp/cedet".

This is not a bug in Emacs.  You are invoking a native Windows build
of Emacs from the Cygwin shell, which passes to Emacs Posix-style
absolute file names like /home/epich/sw/cedet/lisp/cedet.  But the
native Windows build of Emacs does not understand the Cygwin mounts,
so it cannot resolve such file names correctly.  What it does is
simply prepend the current drive's letter to the file name.

So when you expand-file-name in *scratch*, it takes the drive letter
of the default-directory defined in *scratch*, which is C:, because of
this:

> epich@laptop02 ~/sw/cedet/lisp/cedet $ ls -l `which emacs`
> lrwxrwxrwx 1 epich None 51 Nov  5 22:02 /home/epich/bin/emacs -> /cygdrive/c/Users/epich/sw/emacs-24.2/bin/emacs.exe

This tells me that Emacs comes up in a directory on drive C:, and thus
its default-directory in *scratch will be something on C:.

By contrast, compilation of CEDET was probably run somewhere on drive
D:, so /home/epich/sw/cedet/lisp/cedet/loaddefs.el got D: prepended to
it.

I don't know why you invoke Emacs from the Cygwin Bash.  I suggest not
to, or to switch to a Cygwin build of Emacs.  Mixing these two
environments is asking for trouble.

IOW, this is pilot error, not a bug.





  reply	other threads:[~2013-03-11 16:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-11  2:03 bug#13921: 24.2; Misbehavior of expand-file-name on Cygwin with Emacs 24.2 Barry OReilly
2013-03-11 16:30 ` Eli Zaretskii [this message]
2013-03-11 17:21   ` Barry OReilly
2013-03-11 17:43     ` Eli Zaretskii
2013-03-11 17:54       ` Eli Zaretskii
2013-03-13  0:45         ` Barry OReilly
2013-03-13  3:52           ` Eli Zaretskii
2013-03-13 17:54             ` Eli Zaretskii
2013-03-14 12:16               ` Barry OReilly
2013-03-14 16:38                 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83boapx5jm.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=13921@debbugs.gnu.org \
    --cc=gundaetiapo@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.