unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Vincent Belaïche" <vincent.b.1@hotmail.fr>
Cc: cedet-semantic@lists.sourceforge.net, deng@randomsample.de,
	emacs-devel@gnu.org
Subject: Re: [cedet-semantic] Latest CEDET on BZR does not compile with emacs 24.1
Date: Fri, 05 Oct 2012 10:10:38 +0200	[thread overview]
Message-ID: <83zk41730h.fsf@gnu.org> (raw)
In-Reply-To: <DUB102-W38B04989D4DE9F4C27C4A0848B0@phx.gbl>

> From: Vincent Belaïche <vincent.b.1@hotmail.fr>
> CC: "cedet-semantic@lists.sourceforge.net"
> 	<cedet-semantic@lists.sourceforge.net>, emacs-devel <emacs-devel@gnu.org>
> Date: Fri, 5 Oct 2012 07:18:53 +0200
> 
> Thank you Eli for your kind answer. I tried it with the mingw32-make a link to which you have sent to me. It is correct that it does not use MSYS paths like /c/Programme/GNU/installation/cedet-install/cedet/lisp/cedet/loaddefs.el, but the same kind of path that pwd -W outputs, i.e. c:/Programme/GNU/installation/cedet-install/cedet/lisp/cedet/loaddefs.el for the same file. EMACS is supposed to understand that kind of path. However that still does not work:

My crystal ball says that pwd is an MSYS program.  IOW, you still have
MSYS's /bin directory on your general PATH, and those MSYS tools,
especially Bash, are being invoked by the MinGW Make.

If you are invoking Make from the MSYS Bash console window, don't;
invoke it from a regular cmd window instead.  If you added MSYS's /bin
directory to your PATH such that even the cmd window gets that PATH,
edit your environment variables and remove the MSYS /bin directory
from the PATH.  Then these problems will go away, and you will be
faced only with real problems: the Unixy features used by the Makefile
that don't work on Windows.  These you will have to solve, but at
least you will be fighting known issues.

> Debugger entered--Lisp error: (file-error "Opening output file" "no such file or directory" "d:/devel/emacs/release/emacs24/emacs-24.1/lisp/c;c:msys.0ProgrammeGNUinstallationcedet-installcedetlispcedetloaddefs.el")
                                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

See this nonsense?  That's MSYS file syntax conversion in action.
Whenever an MSYS program (probably Bash in this case) invokes a native
Windows program (in this case Emacs), it converts any string that
looks like a Unixy file name with forward slashes and colons into a
Windows file name with backslashes and semi-colons.  But a single
backslash in a Lisp string is an escape character, so the file name is
butchered beyond repair by this conversion.

As long as you mix MSYS with native programs (with the exception of
MinGW compiler, linker, and other tools related to building software,
about which it is known in advance that their arguments are file
names), you will always see these problems, and you cannot possibly
work around them.  Again, MSYS was created for _building_ programs,
and it works very well in that domain.  But as soon as you leave the
domain of running the compiler and related tools, and start invoking
other native Windows programs, you are in trouble.

> What happens is that path  `c:/Programme/GNU/installation/cedet-install/cedet/lisp/cedet/loaddefs.el' in the command line transformed by EMACS into  `c;c:\msys\1.0\Programme\GNU\installation\cedet-install\cedet\lisp\cedet\loaddefs.el'.

Yes.  This is what MSYS does, and it does that for a good reason.  The
problem is that the algorithms MSYS applies for this conversion
misfire when the program being invoked has its own ideas about the
syntax of the command-line arguments.  This is one such case.
(Invoking a natively-compiled Sed is another prominent case where the
MSYS file-name conversion badly misfires.)

> Probably the reason for doing that is quite valid: the path should have been ` c:\Programme\GNU\installation\cedet-install\cedet\lisp\cedet\loaddefs.el' in the first place.

No.  (Btw, using "D:/foo/bar" syntax of file names is perfectly OK on
Windows, because the Windows file I/O APIs understand forward slashes
very well, but that's not the issue here.)  The problem is elsewhere:
this command-line argument is _not_ a file name.  It is a Lisp string
that will be interpreted as a file name by Emacs.  But MSYS does not
(and cannot) have the slightest idea about valid syntax of Lisp
strings; in particular, it doesn't know that a backslash in a Lisp
string needs to be doubled.  So it ruins the command line by its
simplistic conversion.

>My thought are rather that is it hard to write makefile that are portable because GNU Make is lacking the following features:
> 
> 
> - a predefined variable, e.g. $(FS) expanding to the file separator, i.e. \ for MSWindows and / for Unixy shell

Why do you need this?  As I said, Windows programs, Emacs included,
understand forward slashes in file names quite well.  The only one
that might have problems is cmd.exe, but you should not need to invoke
cmd.exe's commands too much, if at all.  And if you do need internal
cmd commands, there are the 'subst' and 'patsubst' Make functions you
can use to convert forward slashes to backslashes on the cmd command
lines.

Also, do you know that Make converts all environment variables to Make
variables, and expands them?

> - a predefined variable, e.g. $(CFS), expanding to the file separator within a C-string-like environment, i.e. \\ for MSWindows and / for Unixy shell 

Again, you should not need this at all.  This problem does not exist,
as long as you invoke Emacs from the Makefile.

> - a function, e.g. $(pathconvert ...) to convert a path name in the the Unixy like format that make internally uses with wildcards and $(abspath ...) returned value into the format used on the platform where make is running, i.e. in my case  `c:/Programme/GNU/installation/cedet-install/cedet/lisp/cedet/loaddefs.el' would be converted to  `c:\Programme\GNU\installation\cedet-install\cedet\lisp\cedet\loaddefs.el'

Not needed, see above.

> - and a function, e.g. $(cpathconvert ...) which would do the same thing but with output to go within some C-string-like environement, i.e. in my case 
> `c:/Programme/GNU/installation/cedet-install/cedet/lisp/cedet/loaddefs.el' would be converted to   `c:\\Programme\\GNU\\installation\\cedet-install\\cedet\\lisp\\cedet\\loaddefs.el'

Again, not needed.

> Without those basic things, one has no other resorts than the kind  of tricks which I played to make the Makefile platform independent, and which, I agree, may be fragile, though working ones.

You will have to explain why you at all need these basic things.

> Please note that this is why I mentioned ant: in contrast to GNU Make, ant has that sort of tricks that allow to do path name manipulations.

GNU Make has enough up its sleeve for this job, and many similar ones,
believe me.





  reply	other threads:[~2012-10-05  8:10 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <80627pfvx8.fsf@gmail.com>
     [not found] ` <DUB102-W64E66C3E35B19D545EE372849D0@phx.gbl>
     [not found]   ` <87k3vhesof.fsf@randomsample.de>
     [not found]     ` <DUB102-W11A887FEC4D1B295EE9797849C0@phx.gbl>
     [not found]       ` <877grgdmcd.fsf@randomsample.de>
     [not found]         ` <DUB102-W3A224ABBF13767707549184830@phx.gbl>
     [not found]           ` <87mx0bcioh.fsf@randomsample.de>
     [not found]             ` <DUB102-W9B28CE0238E27638C391684800@phx.gbl>
     [not found]               ` <87sj9yb4kw.fsf@randomsample.de>
2012-10-02 20:31                 ` Latest CEDET on BZR does not compile with emacs 24.1 Vincent Belaïche
2012-10-02 21:10                   ` [cedet-semantic] " Eli Zaretskii
2012-10-03 20:02                     ` Vincent Belaïche
2012-10-03 20:28                       ` Eli Zaretskii
2012-10-05  5:18                         ` Vincent Belaïche
2012-10-05  8:10                           ` Eli Zaretskii [this message]
2012-10-06 21:41                             ` [cedet-semantic] " Vincent Belaïche
2012-10-07  7:06                               ` Eli Zaretskii
2012-10-07 12:29                                 ` Vincent Belaïche
2012-10-07 14:28                                   ` Eli Zaretskii
2012-10-07  7:52                         ` Vincent Belaïche
2012-10-07  8:42                           ` Eli Zaretskii
2012-10-07 11:49                             ` Vincent Belaïche
2012-10-07 14:18                               ` Eli Zaretskii
2012-10-07 16:37                                 ` Vincent Belaïche
2012-10-07 17:07                                   ` Eli Zaretskii
2012-10-07 19:36                                     ` Vincent Belaïche
2012-10-06 10:25                       ` David Engster
2012-10-06 19:47                         ` Vincent Belaïche
2012-10-06 19:56                           ` David Engster
2012-10-06 20:11                             ` Vincent Belaïche
2012-10-02 21:57                   ` David Engster

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=83zk41730h.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=cedet-semantic@lists.sourceforge.net \
    --cc=deng@randomsample.de \
    --cc=emacs-devel@gnu.org \
    --cc=vincent.b.1@hotmail.fr \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).