Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not hard-code DOS paths in libintl-8.dll #776

Merged
merged 1 commit into from
Sep 10, 2015

Conversation

dscho
Copy link
Contributor

@dscho dscho commented Sep 10, 2015

The libintl-8.dll file from mingw-w64-x86_64-gettext 0.19.5.1-1 has
the path D:/develop/msys64/mingw64/share/locale hard-coded. As a
consequence, programs that link to libintl-8.dll may try to open said
directory. In many setups, D:\ actually refers to a CD/DVD drive which
means that the user may see this nasty error message:

There is no disk in the drive. Please insert a disk into drive D:

Let's not do that, but instead hard-code the POSIX path into that
.dll file, i.e. /mingw64/share/locale.

This fixes git-for-windows/git#329

Signed-off-by: Johannes Schindelin johannes.schindelin@gmx.de

The `libintl-8.dll` file from mingw-w64-x86_64-gettext 0.19.5.1-1 has
the path `D:/develop/msys64/mingw64/share/locale` hard-coded. As a
consequence, programs that link to libintl-8.dll may try to open said
directory. In many setups, `D:\` actually refers to a CD/DVD drive which
means that the user may see this nasty error message:

	There is no disk in the drive. Please insert a disk into drive D:

Let's not do that, but instead hard-code the *POSIX* path into that
`.dll` file, i.e. `/mingw64/share/locale`.

This fixes git-for-windows/git#329

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho
Copy link
Contributor Author

dscho commented Sep 10, 2015

I obviously did not really have time to look into this more closely, i.e. whether the updated hard-coded _nl_default_dirname variable and locale_alias_path variable are handled properly, or whether the absolute path is misinterpreted to be relative to whatever is the current DOS drive.

However, be that as it may, with this patch, the original issue (that semi-random programs ask for a CD or DVD to be inserted) should be fixed by this patch.

@mingwandroid
Copy link
Member

Won't this just result in not finding locale when it looks in C:\mingw64\share\locale\locale.alias? Usually we have to implement relocation support for this kind of thing, basing it off the result of calling GetModuleFileName.

Though I admit, not finding it in one place is only as bad as not finding it in another. (edit: Yeah, ok changing drives is worse .. so I will merge this as the lesser wrong).

An example of adding relocation support is Alexpux@a711734

@DavidEGrayson
Copy link
Contributor

The MinGW.org folks were struggling with this same issue for a long time, as shown in this thread on SourceForge: #2108 No Disk error when running g++ from cmd/tcc while a card reader with empty slots is connected..

The following command can be run to check for absolute Windows path strings in a DLL:

strings libintl-8.dll | grep -i '[a-z]:/'

mingwandroid added a commit that referenced this pull request Sep 10, 2015
Do not hard-code DOS paths in libintl-8.dll
@mingwandroid mingwandroid merged commit c69875d into msys2:master Sep 10, 2015
@mingwandroid
Copy link
Member

Ah crap, you forgot to bump pkgrel (and I forgot to check that :-)), I'll sort it out later unless you get to it first.

@dscho
Copy link
Contributor Author

dscho commented Sep 10, 2015

Oh right, sorry!

@Alexpux
Copy link
Member

Alexpux commented Sep 10, 2015

@dscho
Copy link
Contributor Author

dscho commented Sep 10, 2015

strings libintl-8.dll | grep -i '[a-z]:/'

@DavidEGrayson that's exactly what we did in the ticket I linked...

As I remember this patch https://github.com/Alexpux/MINGW-packages/blob/master/mingw-w64-gettext/00-relocatex-libintl-0.18.3.1.patch do relocation support for libintl.

@Alexpux thanks! From the name, I had suspected already, but I was busy elsewhere so I could not look closer.

@mingwandroid
Copy link
Member

@dscho I just built gettext and a test program without your new patch and there was no access to my build drive or folder when looking for locale.alias.

More testing is needed but as @Alexpux said, relocation for this should work already! Hmm.

@mingwandroid
Copy link
Member

.. actually I need to do more testing on this.

@DavidEGrayson
Copy link
Contributor

I double-clicked on /mingw32/bin/gcc.exe today using Windows Explorer, and it gave the following error: "There is no disk in the drive. Please insert a disk into drive D:." All my packages are up-to-date. Should I make a new Github issue?

This issue makes cmake-gui practically unusable, because when you click "Configure", it invokes the compiler many times, and you will see this error message pop up every time it does so.

I had a general idea to help prevent these types of problems from happening that I wrote about here: Alexpux/MSYS2-pacman#16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

git ask for a dvd in dvd player.
4 participants