public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Michael Wild <themiwi@gmail.com>
To: The Cygwin Mailing List <cygwin@cygwin.com>
Subject: Re: Forcing setup.exe not to create WSL symlinks
Date: Thu, 27 Aug 2020 14:48:51 +0200	[thread overview]
Message-ID: <CAALQ5rn5=oqGOge7mTFGoDeJCxD6H4=cFN3Mww+My4DMxNPsEQ@mail.gmail.com> (raw)
In-Reply-To: <CAALQ5rmB41AaANP6n3GNWbO4zLUjSyuuJ+2WwS=PWNqWbp7hXA@mail.gmail.com>

On Thu, Aug 27, 2020 at 11:44 AM Michael Wild wrote:

>
> On Thu, Aug 27, 2020 at 11:02 AM Corinna Vinschen wrote:
>
>> On Aug 27 07:48, Michael Wild via Cygwin wrote:
>> > On Wed, Aug 26, 2020 at 10:57 PM Jon Turney wrote:
>> >
>> > >
>> > > It turns out to be the case that setup doesn't propagate the CYGWIN
>> > > environment variable into the environment for scripts it runs, so
>> > > setting that isn't going to make any difference.  That should probably
>> > > be considered a bug.
>> > >
>> > > However, even if that's fixed, there's no value for winsymlinks in
>> > > CYGWIN env var to specify the behaviour of Cygwin 3.1.4 and previous
>> > > (i.e. always create traditional symlinks, don't use WSL symlink
>> reparse
>> > > points)
>> > >
>> >
>> > Thanks Jon for the elaboration. Isn't winsymlinks=lnk supposed to do
>> this
>> > per the documentation? Could Corinna be convinced to include an option
>> > where this can be done? To be honest, my hopes are greater to get this
>> > worked-around in a useful timeframe from the Cygwin side than getting
>> the
>> > proper fix into Docker.
>>
>> Isn't it sufficient to fix setup so you can create lnk-style symlinks in
>> your scenario?  The CYGWIN env variable and the number of options is
>> such a mess.
>>
>>
>> Corinna
>>
>
> I am right now modifying setup to not sanitize CYGWIN away when invoking
> the post-install scripts and then will report back.
>
> Michael
>

Hmm, OK, changing script.cc to not strip out CYGWIN is trivial. But the
harder part is that main.cc uses ShellExecuteEx() with
SHELLEXECUTEINFO.verb set to "runas" in order to re-run setup elevated.
This resets all environment variables back to default. In my instance I can
circumvent this by passing --no-admin and running from an elevated shell
where CYGWIN is set already. And indeed, this works and resolves my Docker
problem. I attached this fix as a patch. But on the other hand, I find this
behavior to be a bit confusing. However, I don't see an easy way of
resolving the "runas" issue, because it is by design. An option would be
that the calling process passes the CYGWIN variable as a command line
argument to the elevated process. But that is also ugly. What do you guys
think?

Michael

  reply	other threads:[~2020-08-27 12:49 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-26 12:14 Michael Wild
2020-08-26 15:19 ` Andrey Repin
2020-08-26 15:24   ` Michael Wild
2020-08-26 18:29 ` Achim Gratz
2020-08-26 19:06   ` Michael Wild
2020-08-26 20:15     ` Michael Wild
2020-08-26 20:55   ` Jon Turney
2020-08-27  5:48     ` Michael Wild
2020-08-27  9:00       ` Corinna Vinschen
2020-08-27  9:38         ` Andrey Repin
2020-08-27  9:44         ` Michael Wild
2020-08-27 12:48           ` Michael Wild [this message]
2020-08-27 12:49             ` Michael Wild
2020-08-30 20:24               ` Jon Turney
2020-09-06 14:44             ` Jon Turney
2020-08-30 20:24       ` Jon Turney
2020-08-31  4:51         ` Michael Wild

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAALQ5rn5=oqGOge7mTFGoDeJCxD6H4=cFN3Mww+My4DMxNPsEQ@mail.gmail.com' \
    --to=themiwi@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).