[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] [lmi-commits] master aee9f4d 10/11: For cygwin, add msw system
From: |
Vadim Zeitlin |
Subject: |
Re: [lmi] [lmi-commits] master aee9f4d 10/11: For cygwin, add msw system directory to minimal path |
Date: |
Wed, 8 May 2019 23:52:31 +0200 |
On Wed, 8 May 2019 19:43:16 +0000 Greg Chicares <address@hidden> wrote:
GC> On 2019-05-08 19:02, Vadim Zeitlin wrote:
GC> > On Wed, 8 May 2019 13:23:25 -0400 (EDT) Greg Chicares <address@hidden>
wrote:
GC> [...]
GC> > GC> +case "$lmi_build_type" in
GC> > GC> + (*-*-cygwin*)
GC> > GC> + minimal_path="$minimal_path:/cygdrive/c/Windows/system32"
GC> > GC> + ;;
GC> > GC> +esac
GC> >
GC> > This is probably never going to be a concern in practice,
GC>
GC> Until we move to 64-bit cygwin and demons fly out our noses.
If you're worried about "32" part of "system32", it's actually invariant
due to the paths virtualization under MSW 64 which maps this path
differently for 32- and 64-bit processes. This is pretty nice from
compatibility point of view, although it can also be really, really
confusing, especially because the contents of $WINDIR/system32, which
contains 64-bit files, and $WINDIR/syswow64, which, as its name so clearly
indicates, contains 32-bit files (actually I'm not totally fair here, it
really does: WoW stands for "Windows on Windows" and not World of Warcraft
as any reasonable person would have thought, so it's "Windows [32] on
Windows 64") is similar but not the same. Still, I won't be throwing stones
at MSW 32/64 multiarch handling knowing how suboptimally the same thing is
implemented in most Linux distributions.
GC> > Using `cygpath -u "$WINDIR\\system32"` (or the same thing with
GC> > $SYSTEMROOT) should work anywhere and wouldn't require much more work
GC> > however.
GC>
GC> I no longer know this msw stuff; I was thinking
GC> cygpath -u "%windir%\SysWOW64;%windir%\System32"
GC> or something like that,
Why would you use "%VAR%" syntax in install_msw.sh, which is a Unix shell
command file?
GC> but that's just a shot in the dark, and I don't know whether 'cygpath'
GC> handles multiple semicolon-separated directories
No, cygpath only handles (filesystem) paths.
GC> (I guess $WINDIR is better because cygwin presumably puts that in the
GC> environment).
Cygwin inherits the environment from its parent process, which has WINDIR
in it because it's defined in the environment of the windows shell process
(not speaking of the command shell here, but of what launches the session
for the current user). As for SYSTEMROOT it's actually even more
fundamental because it's always available in the environment, even if it's
not defined there, it's a kind of "virtual environment variable" (AFAIK it
and SYSTEMDRIVE are the only ones of this kind).
GC> If you would give me the magic string to insert here:
GC>
GC> - minimal_path="$minimal_path:/cygdrive/c/Windows/system32"
GC> + minimal_path="$minimal_path:...just add magic..."
GC>
GC> then I'd be glad to apply it.
I'd use just what I wrote above, i.e.:
---------------------------------- >8 --------------------------------------
diff --git a/install_msw.sh b/install_msw.sh
index b47524719..a1f7c1045 100755
--- a/install_msw.sh
+++ b/install_msw.sh
@@ -40,7 +40,7 @@ minimal_path=${MINIMAL_PATH:-"/usr/bin:/bin:/usr/sbin:/sbin"}
case "$lmi_build_type" in
(*-*-cygwin*)
- minimal_path="$minimal_path:/cygdrive/c/Windows/system32"
+ minimal_path="$minimal_path:$(cygpath --unix "$SYSTEMROOT\\system32")"
;;
esac
---------------------------------- >8 --------------------------------------
I haven't really tested this (i.e. I didn't rerun install_msw.sh with this
change), but it does result in the expected minimal_path value if I just
cut and paste this command into my Cygwin shell.
Thanks,
VZ