msys2 / msys2-launcher

Helper for launching MSYS2 shells

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"/mingwXX.exe" names/location conflicts with "/mingwXX" directory prefix

jenisys opened this issue · comments

The location and/or filenames "/mingw64.exe", "/mingw32.exe" conflict with "/mingw64", "/mingw32/" directory prefix.

HOW TO REPEAT (in a clean system without msys/mingw64):

  1. Install "msys2" into "C:/msys64" (and perform the normal msys2 setup).
  2. Install "msys2-launcher" with "pacman -Su msys2-launcher"
  3. Install a mingw64 package from mingw64 package repository with pacman
    => Last steps fails

After you rename the "/mingw64.exe" to "/mingw64_shell.exe" and repeat step 3, everything is fine. The mingw64 package installs under "/mingw64" directory (which will be created in this process).

POSSIBLE REASON FOR PROBLEM:
msys2 tools probably often strip ".exe" suffix to get normal UNIX behavior in the shell.
For example, "type -a mintty" finds "mintty.exe" (or needs to find it).

WORKAROUND (or potential solution):
Rename the "mingw*.exe" files or move them to another location (in the future).
And/or the "problem" in msys2 related to filename/path-matching should be fixed, too.

Sorry for the late response. Your analysis looks good.

Ideas:

  • moving the launchers away from the *_shell.bat files seems disorganized (could be solved by also moving or deprecating the batch files)
  • renaming the launchers is counter-productive; the names are currently descriptive and simple to write
  • dealing with the .exe coercion is a huge undertaking and no-one's proposed a good solution yet

I'll try to think about the options, but I'm not exactly liking any of these.

The msys2-launcher could depend on a package that provides empty directories for /mingw32 and /mingw64. Perhaps the filesystem package should do that.

Actually, I don't know if pacman makes an effort to install dependencies before the packages that depend on them. It might be safer to use a pre-install script in the msys2-launcher package that simply runs mkdir /mingw32 /mingw64.

@DavidEGrayson, pacman does honor dependencies when deciding the install order (you'll see warnings if there's a dependency cycle that prevents it). I think the directories need to be put either in filesystem or in msys2-launcher.

Was solved on filesystem side. It's not a great solution, but works. Other options would need cooperation or at least approval from MSYS2 anyway, so I don't see a reason to keep this open here.