X-Recipient: archive-cygwin@delorie.com
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 766CF3858031
Authentication-Results: sourceware.org;
 dmarc=none (p=none dis=none) header.from=ajrh.net
Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=anthony@ajrh.net
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ajrh.net; h=
 mime-version:message-id:in-reply-to:references:date:from:to
 :subject:content-type; s=mesmtp; bh=N6BMGK2NF2IdD6AT4bfKKb4fHX6r
 iqhEdP/F+ksD9qY=; b=YSCjBq/HDejfE4g+76Lyc0bWUhtGNIT38nCgoiGO6CMq
 yOP5hzyhMS7rfEy6Y+2oD9tqlyenIRc9/21mpKTInL9rs5qVqKd4sIEUDIhMr3pv
 fvaxHo2KhCjOdxKSDdRRJk54Bt3VavIDdlSvQfYuE6BottLp5Kamcyd0YMPn7EY=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=content-type:date:from:in-reply-to
 :message-id:mime-version:references:subject:to:x-me-proxy
 :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=N6BMGK
 2NF2IdD6AT4bfKKb4fHX6riqhEdP/F+ksD9qY=; b=HUHIF4j6G+LwF0/vwGftJX
 w4KU4hkRWoxQLsuMTtJ8fRgZu2p1LcBcxKw/HWZODq7jqeT45ObPEiioxyx2SqOU
 rcSg18NaDeRcbd52iVIvqDM4jJ7cb8jwSUWCKutZgYq8OCQv6aUd97fApgvCxGCN
 uCpuxF6Ztxh+IlI09zrSseSVvgsqTyDB5E5mURRTumFOUWgQvxU7RNhxpNdkf/EO
 cbxPJ7X9REMQIBA5F82Il2RVSMUfMdofOf5oTDkhcfLbbh9sqJPIuc1iYZiRfmEZ
 7sffZ33q2fnoN7ynBqnC3QOMRZbBAAAEDIHIL9Ayi1W0+C98ktQRQcIgLTecCIvA
 ==
X-ME-Sender: <xms:JT4LYKFJnK5bRwfOk3zM107yLZTKc_6YhGcN9SmskGTnTDhW5c45pw>
 <xme:JT4LYLUbFIkSumpplvqEUgKpCbl26oRv5Ofo61_rP2B97_fB1chIbpXLabbHcOmp_
 YdSY0TQe2JZp5Ub>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudeigdduheduucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdetnhht
 hhhonhihucfjvggrughinhhgfdcuoegrnhhthhhonhihsegrjhhrhhdrnhgvtheqnecugg
 ftrfgrthhtvghrnhepfeefhefgtdefkeejfeffveekuddvgeekteeukeejieehiedvgefg
 leegkeekkeejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh
 homheprghnthhhohhnhiesrghjrhhhrdhnvght
X-ME-Proxy: <xmx:Jj4LYELCsOaJsFsCupen3oI7jorNm2EPyG6JnlPkw2jXz-ftIBOJ_w>
 <xmx:Jj4LYEFuhZ0otU9lFjPxs_gxrh9kjwRuCvtRDzESj_uSQ4Cse618dA>
 <xmx:Jj4LYAUcDjHI1nKq2BT4VfKtwBIF38C5JF97LHWuqjkQXFAZQ_Jn0g>
 <xmx:Jj4LYJclR7_gLVbSnyPQLFt-BzyArlCIzRzgDe5ImRGvzVstquACKw>
X-Mailer: MessagingEngine.com Webmail Interface
User-Agent: Cyrus-JMAP/3.5.0-alpha0-78-g36b56e88ef-fm-20210120.001-g36b56e88
Mime-Version: 1.0
Message-Id: <e8bc4b16-b459-4e89-b6b3-6b80e7f9a933@www.fastmail.com>
In-Reply-To: <87czxw3gu0.fsf@Rainer.invalid>
References: <ce12be86-779e-41cc-af80-ba0ecb2b210a@www.fastmail.com>
 <87czxw3gu0.fsf@Rainer.invalid>
Date: Fri, 22 Jan 2021 21:05:21 +0000
From: "Anthony Heading" <anthony@ajrh.net>
To: "Marco Atzeri via Cygwin" <cygwin@cygwin.com>
Subject: Re: missing perl directories
X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, DKIM_SIGNED,
 DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,
 RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS,
 TXREP autolearn=ham autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
 server2.sourceware.org
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cygwin-bounces@cygwin.com
Sender: "Cygwin" <cygwin-bounces@cygwin.com>

On Fri, Jan 22, 2021, at 7:35 PM, Achim Gratz wrote:
> 
> For good measure I repeated this with /usr/local not existing at all and
> the result stays the same.

Achim,  that was a helpful test, thankyou.   Digging further, the triggering perl code in /usr/share/perl5/5.30/CPAN/FirstTime.pm,  so to replicate I also need to delete my ~/.cpan directory.   Could you try doing that too and see if you agree?

Here's the fuller problem, which is more than a cosmetic warning:

================

% cpan install Win32::Symlink
Loading internal logger. Log::Log4perl recommended for better logging

CPAN.pm requires configuration, but most of it can be done automatically.
If you answer 'no' below, you will enter an interactive dialog for each
configuration option instead.

Would you like to configure as much as possible automatically? [yes]
Use of uninitialized value $what in concatenation (.) or string at /usr/share/perl5/5.30/App/Cpan.pm line 679, <STDIN> line 1.

Warning: You do not have write permission for Perl library directories.

To install modules, you need to configure a local Perl library directory or
escalate your privileges.  CPAN can help you by bootstrapping the local::lib
module or by configuring itself to use 'sudo' (if available).  You may also
resolve this problem manually if you need to customize your setup.

What approach do you want?  (Choose 'local::lib', 'sudo' or 'manual')
 [local::lib]
[...]

================

So the _apparent_ lack of write permission triggers a whole load of privilege escalation machinery which is unnecessary.

This code is in 

    unless ( $matcher
        || _can_write_to_libdirs() || _using_installbase() || _using_sudo()
    ) {
        local $auto_config = 0; # We *must* ask, even under autoconfig
        local *_real_prompt;    # We *must* show prompt
        my_prompt_loop(install_help => 'local::lib', $matcher,
                   'local::lib|sudo|manual');
    }

and the core test on that looks like this:

sub _can_write_to_libdirs {
    return -w $Config{installprivlib}
        && -w $Config{installarchlib}
        && -w $Config{installsitelib}
        && -w $Config{installsitearch}
}

hence there is an assumption that these directories exist.

--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple
