GNU bug report logs - #75939
bug in compile wrapper when using MSVC from Msys2

Previous Next

Package: automake;

Reported by: Kirill Makurin <maiddaisuki <at> outlook.com>

Date: Thu, 30 Jan 2025 04:59:02 UTC

Severity: normal

Done: Karl Berry <karl <at> freefriends.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Kirill Makurin <maiddaisuki <at> outlook.com>
Subject: bug#75939: closed (Re: bug#75939: setting $MSYS2_ARG_CONV_EXCL in
 compile script?)
Date: Mon, 03 Feb 2025 22:21:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#75939: bug in compile wrapper when using MSVC from Msys2

which was filed against the automake package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 75939 <at> debbugs.gnu.org.

-- 
75939: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=75939
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Karl Berry <karl <at> freefriends.org>
To: bruno <at> clisp.org, maiddaisuki <at> outlook.com, 75939 <at> debbugs.gnu.org
Subject: Re: bug#75939: setting $MSYS2_ARG_CONV_EXCL in compile script?
Date: Mon, 3 Feb 2025 23:20:02 +0100
    the three patches from the preceding mail are ready to commit.

Thanks very much for all your work (and explanations) on this, Bruno.
Committed. -k

[Message part 3 (message/rfc822, inline)]
From: Kirill Makurin <maiddaisuki <at> outlook.com>
To: "bug-automake <at> gnu.org" <bug-automake <at> gnu.org>
Subject: bug in compile wrapper when using MSVC from Msys2
Date: Wed, 29 Jan 2025 23:09:40 +0000
[Message part 4 (text/plain, inline)]
Hi,

I would like to report one quite annoying issue related to Automake's `compile` wrapper when it is used with `cl.exe` to compile some C++ files from Msys2.

I was building some GNU packages with MSVC's `cl.exe`, and compilation of some C++ source files was failing with `cl.exe` reporting non-sensual filenames like `H:E:/Msys2/{builddir}/somefile.cxx`.

Apparently, the issue is double conversion of a unix-style filename by Msys2's shell. In example above, Msys2 is installed to `E:/Msys2` and builddir is `/h/{builddir}`.

As I figured out later, it was happening because `compile` was converting `/h/{builddir}/somefile.cxx` to `H:/{builddir}/somefile.cxx` and passing it as `-TpH:/{builddir}/somefile.cxx` to `cl.exe`. However, Msys2 was interpreting `/{builddir}/somefile.cxx` as a unix-style path and converted it again, resulting in `-TpH:E:/Msys2/{builddir}/somefile.cxx`.

One way to work around this issue is :

```
export MSYS2_ARG_CONV_EXCL='-Tp'
```

However, this must be set by the user, which is inconvenient. I wonder if anything can be done in the `compile` wrapper to fix this.

I am using latest versions of MSVC tools and `cl.exe` allows to pass argument to `-Tp` as a separate argument and this seems to work correctly. However, I don't know whether older versions of `cl.exe` allow it.

- Kirill Makurin
[Message part 5 (text/html, inline)]

This bug report was last modified 185 days ago.

Previous Next


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