From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by sourceware.org (Postfix) with ESMTPS id 6F7D438582BE for ; Wed, 24 Aug 2022 08:27:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6F7D438582BE Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=mattwilson.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mattwilson.org Received: by mail-pf1-x434.google.com with SMTP id 67so7617284pfv.2 for ; Wed, 24 Aug 2022 01:27:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mattwilson.org; s=google; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc; bh=gM3wx9KZf/YRnUnJcz5tnlsuTvBZXAHLPIjDm9dnKbY=; b=iWp2t6HZFr0qgJHJOUQ5G5MPz6jpo66o3Q3g5tcN7wbB5EOH+TSW5qfUavgrF/OIoy F+zlkjuabhjaRkEu0dCF3loeRE3Fj12ggDQdfnbB27XyC0tC0gEL77xkOez+MaTgYsc9 +zAeTjqj1d2uQp6YqPSq5xOuA6X79aKjBV5zM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc; bh=gM3wx9KZf/YRnUnJcz5tnlsuTvBZXAHLPIjDm9dnKbY=; b=C74eV6zmhfYcxmYEPV56LW/YlfvDtZcUI1nHs51xJM90h+/nsl11dnUF9Y9z5HAUj6 vJ/KHWoAvOZgU+eOqmHIf4n+uPOqoaBRJbhuBzGOivsiv9vN+ghbAg9m1vdENiHIT/sK Q34jcFmbM46d8yvJDj4D9DtL6AgF0EUXOYCG2QAW6Jq6XnPszMNXiGCP5cHy1+DtEGF6 aDRf0XS3KZyo+uxtlTgx2wNJsTPSRBV8G1lgV/iMpql+4fyr3OqI3MiOIl/lnIGgEfSA Kv+vDaSQy0lTBCGNQFJNH0DdJ+nL4VviNChxw+PGBDv+AMBGjLeT8Sfv6xj+eW8HoXGm PEUQ== X-Gm-Message-State: ACgBeo03RqPWash9PeiiyO4/b8wXi1JwwrZCNG5atXsdJYGKdUT/CUJU iDuMUugdc5KH4TDNWb5BEXbhJQ== X-Google-Smtp-Source: AA6agR4RgPkKgMzZtv+zC2JfRZtJQlJiYOr1sXohGXyLyMNLYKJ0F5v4jsjacc2JFHzh8hH6TGw2Pw== X-Received: by 2002:a65:5a0c:0:b0:429:c80e:959c with SMTP id y12-20020a655a0c000000b00429c80e959cmr24105138pgs.279.1661329665262; Wed, 24 Aug 2022 01:27:45 -0700 (PDT) Received: from mattwilson.org ([50.45.185.53]) by smtp.gmail.com with ESMTPSA id l18-20020a170903005200b001712c008f99sm11879603pla.11.2022.08.24.01.27.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 01:27:44 -0700 (PDT) Date: Wed, 24 Aug 2022 01:27:43 -0700 From: "Matthew R. Wilson" To: Xi Ruoyao Cc: Dennis Clarke , gcc-help@gcc.gnu.org Subject: Re: one of those annoying little things Message-ID: <20220824082743.3jqs3owseaulpjh7@mattwilson.org> References: <49c6528e-13d9-fcff-2046-6a0a167c3fea@blastwave.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=2.3 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_INVALID,DKIM_SIGNED,KAM_DMARC_STATUS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Dennis and Xi, On 08.24.2022 13:20, Xi Ruoyao via Gcc-help wrote: >On Wed, 2022-08-24 at 00:21 -0400, Dennis Clarke via Gcc-help wrote: >>      Not sure who else have been doing bootstraps on machines wherein the >> common sense thing to do is protect the source tree. What I mean is that >> I extract the gcc 12.2.0 tarball of joy as the root user. >> >> mkdir: .am388: Permission denied >> ../../../gcc-12.2.0/mpfr/doc/mpfr.info: Permission denied > >> Turns out, wild, but that directory for the mpfr doc stuff has files >> that no user has rights to other than root. That has to be a bug right? >> Could be the mpfr guys but hey this seems weird. > >In MPFR Makefile.in there is: > >$(srcdir)/mpfr.info: mpfr.texi $(mpfr_TEXINFOS) > >and > >mpfr_TEXINFOS = texinfo.tex fdl.texi > >So mpfr.info is only regenerated if it does not exist, or its timestamp >is older than mpfr.texi, texinfo.tex, or fdl.texi. This should not >happen if you extract mpfr from a release tarball, where: > >2019-01-07 21:49 fdl.texi >2020-07-10 19:59 mpfr.info >2020-07-10 19:52 mpfr.texi >2020-04-14 19:12 texinfo.tex > >We can see mpfr.info is already up-to-date so make should not regenerate >it. > >Maybe your patch changed mpfr.texi (you forgot to add the URL of "[1]" >so I cannot know :), or you've messed up the timestamp of those files >somehow (one notable case: using "cp -r" to copy the MPFR source tree >can reset the timestamps to current system time). I suspect this is indeed the case. The instructions on the MPFR patch download page for the cumulative patch against the 4.1.0 release explicitly tell you to use the following patch command: patch -N -Z -p1 < path_to_patches_file The -Z is what's critical here: it sets the timestamps of the patched files to the timestamps included in the patch itself. The cumulative patch indeed patches mpfr.info and mpfr.texi; with the correct timestamps, the patch maintains the correct sequencing of these files so that it's a "clean" source tree that doesn't require the documentation to be regenerated (since the patch includes the regenerated .info output file that corresponds to the patches to the .texi files). If you patch without the -Z, I'm guessing you hit the condition in the MPFR makefile that thinks you need to regenerate the documentation in the source tree. I have prepared a write-protected GCC source tree on a Solaris 11.4/SPARC system using the following steps, and I was then able to perform an out-of-tree build as an unprivileged user without encountering any permissions problems: As root: # mkdir -p /export/build/gcc # cd /export/build/gcc # curl -LO ftp://ftp.gnu.org/gnu/gcc/gcc-12.2.0/gcc-12.2.0.tar.gz # curl -LO https://www.mpfr.org/mpfr-current/allpatches # gtar xzf gcc-12.2.0.tar.gz # cd gcc-12.2.0 # ./contrib/download_prerequisites # cd mpfr # patch -N -Z -p1 < ../../allpatches # cd ../.. # chown -R root:root gcc-12.2.0 # chmod -R -w gcc-12.2.0 -Matthew