[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gettext] /bin/sh calls in msginit.c on Windows
From: |
Michele Locati |
Subject: |
Re: [bug-gettext] /bin/sh calls in msginit.c on Windows |
Date: |
Sat, 4 May 2019 19:20:48 +0200 |
Hi Bruno!
> I wouldn't want to use wsl.exe from a mingw program.
> 1. Microsoft documents that accessing the same files from the Linux side
> and from the Windows side can lead to file system corruption. [1]
The reason why a patch is needed for Windows is because I have a
couple of warnings when running msginit.exe:
C:\Dev\test\bin>msginit.exe -i dictionary.pot -o language.po -l it_IT
msginit.exe: subprocess C:\Dev\test/lib/gettext/user-email failed: No
such file or directory
msginit.exe: subprocess
C:\Dev\test/share/gettext/projects/team-address failed: No such file
or directory
language.po created.
(messages were in Italian, I manually translated them to English in this email).
That's why I'd like to patch msginit.
About WSL:
WLS is installed via the Microsoft Store, and its filesystem is saved
at a location like this:
%LOCALAPPDATA%\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\LocalState\rootfs
Where %LOCALAPPDATA% usually is C:\Users\<username>\AppData\Local
What shouldn't be done is working on Linux files in that directory.
What's absolutely legal is to take advantage of the Windows/Linux
interoperability.
With the wsl.exe Windows command you can run Linux commands, as well
as opening a bash shell (which offers the very handy wslpath command).
Here's a sample cmd.exe + bash shell session:
C:\Users\miche>echo %OS%
Windows_NT
C:\Users\miche>wsl pwd
/mnt/c/Users/miche
C:\Users\miche>wsl
address@hidden:/mnt/c/Users/miche$ uname -a
Linux Chronos10 4.4.0-17763-Microsoft #379-Microsoft Wed Mar 06
19:16:00 PST 2019 x86_64 x86_64 x
86_64 GNU/Linux
address@hidden:/mnt/c/Users/miche$ cmd.exe /C echo %OS%
Windows_NT
address@hidden:/mnt/c/Users/miche$ wslpath -a
wslpath: Invalid argument
Usage:
-a force result to absolute path format
-u translate from a Windows path to a WSL path (default)
-w translate from a WSL path to a Windows path
-m translate from a WSL path to a Windows path, with '/' instead of '\'
EX: wslpath 'c:\users'
address@hidden:/mnt/c/Users/miche$ exit
logout
C:\Users\miche>wsl $(wslpath 'C:\\Dev\\test/lib/gettext/user-email')
Is the following your email address?
m@
Please confirm by pressing Return, or enter your email address.
m@
Please remark that
C:\\Dev\\\test/lib/gettext/user-email is the value of
relocate (LIBDIR "/gettext/user-email");
except that I manually doubled the backslashes.
> 2. The user experience is likely unexpected and unsatisfying, because
> wsl.exe is really a different world than the rest of Windows.
I'm sorry I don't understand what you mean... I'd use wsl just to run
the POSIX scripts project-id, user-email, and team-address.
--
Michele