From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 9891C158087 for ; Thu, 20 Jan 2022 05:58:58 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8D1292BC00A; Thu, 20 Jan 2022 05:58:51 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 87DF72BC002 for ; Thu, 20 Jan 2022 05:58:50 +0000 (UTC) From: Sam James Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_36879D80-B50C-4107-8787-6CFDE5C289D5"; protocol="application/pgp-signature"; micalg=pgp-sha512 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.40.0.1.81\)) Subject: Re: [gentoo-dev] [PATCH 1/4] autotools.eclass: don't inject -I${SYSROOT} to aclocal Date: Thu, 20 Jan 2022 05:58:38 +0000 In-Reply-To: Cc: cross@gentoo.org, base-system@gentoo.org, chewi@gentoo.org To: gentoo-dev@lists.gentoo.org References: <20220117110950.139015-1-sam@gentoo.org> X-Mailer: Apple Mail (2.3693.40.0.1.81) X-Archives-Salt: 15381ac6-4d4d-4d46-9f58-ee14b46f78e2 X-Archives-Hash: cef0d8ff562c76213ead4cb5f7653a4f --Apple-Mail=_36879D80-B50C-4107-8787-6CFDE5C289D5 Content-Type: multipart/alternative; boundary="Apple-Mail=_2DE5B281-25AF-482E-8986-ADF0F8E07ABD" --Apple-Mail=_2DE5B281-25AF-482E-8986-ADF0F8E07ABD Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On 19 Jan 2022, at 06:35, Mike Frysinger wrote: >=20 > On 17 Jan 2022 11:09, Sam James wrote: >> When -I${SYSROOT} is injected, it'll override the default of -Im4, = which >> results in trying to install macros to ${SYSROOT} (a sandbox = violation) >> when they can't be found. >>=20 >> =46rom aclocal(1): >> ``` >> -I DIR add directory to search list for .m4 files >>=20 >> --install >> copy third-party files to the first -I directory >> ``` >>=20 >> The first directry is normally -Im4 if anything, whereas when = injected >> (when ${SYSROOT} is defined), it ends up being ${SYSROOT}, not m4 (so >> we try to copy macros to somewhere outside of the build directory). >=20 > we should define the semantics we want and bring it upstream to get = into > automake. although it seems like ACLOCAL_PATH might work well enough > for us now to switch to that. >=20 > as a stop gap, it seems like the use of --install is pretty low ? = we're > cross-compiling about ~2.5k packages in CrOS every day and never seen = a > failure here. so the few packages which are running into troubles can > workaround it by setting AT_SYS_M4DIR right ? I've only seen it in the wild with: - app-crypt/tpm2-tss (https://bugs.gentoo.org/756211 = ) - another package which I hit during "normal" use but I'm afraid I can't recall what. I suspect I hit it before Python grew a BDEPEND on = autoconf-archive so we're less likely to hit it now. But I accept it's niche. See below though, I think we agree that = AT_SYS_M4DIR / system acdir should be satisfactory here. I don't mind keeping the old logic for < EAPI 7 if that'll help you in = CrOS though. >=20 >> In EAPI 7+, this is almost always the case! We don't generally expect >> to find macros (particularly things like autoconf-archive) in = ${SYSROOT} >> because that's for DEPEND-class dependencies, then they end up being >> copied in unnecessarily and wrongly. >=20 > i think this optimism is misplaced. libraries often install m4 files > which is precisely why this logic is in here. > https://bugs.gentoo.org/677002#c10 = >=20 > deleting this check will break things. prob more than we're fixing. Sorry, you're absolutely right here! But I think it's addressed by the system-acdir commit that follows it = up. i.e. the commit message is totally wrong (and I'll fix this), but the = change is correct given we follow it up with seemingly a better way of handling the original case. Does that sound right? Best, sam --Apple-Mail=_2DE5B281-25AF-482E-8986-ADF0F8E07ABD Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii

On 19 Jan 2022, at 06:35, Mike Frysinger <vapier@gentoo.org> = wrote:

On 17 Jan 2022 = 11:09, Sam James wrote:
When -I${SYSROOT} is injected, it'll override the default of = -Im4, which
results in trying to install macros to = ${SYSROOT} (a sandbox violation)
when they can't be = found.

=46rom aclocal(1):
```
      -I DIR = add directory to search list for .m4 files

      --install
          &nb= sp;  copy third-party files to the first -I directory
```

The first directry is = normally -Im4 if anything, whereas when injected
(when = ${SYSROOT} is defined), it ends up being ${SYSROOT}, not m4 (so
we try to copy macros to somewhere outside of the build = directory).

we should define = the semantics we want and bring it upstream to get into
automake.  although it seems like ACLOCAL_PATH might = work well enough
for us now to switch to that.

as a stop gap, it seems like the use of = --install is pretty low ?  we're
cross-compiling = about ~2.5k packages in CrOS every day and never seen a
failure here.  so the few packages which are running = into troubles can
workaround it by setting AT_SYS_M4DIR = right ?

I've only seen it in the wild with:
- = app-crypt/tpm2-tss (https://bugs.gentoo.org/756211)
- another = package which I hit during "normal" use but I'm afraid I = can't
recall what. I suspect I hit it before Python grew a = BDEPEND on autoconf-archive
so we're less likely to hit it = now.

But I accept it's niche. See = below though, I think we agree that AT_SYS_M4DIR /
system = acdir should be satisfactory here.

I = don't mind keeping the old logic for < EAPI 7 if that'll help you in = CrOS though.


In EAPI 7+, this is = almost always the case! We don't generally expect
to find = macros (particularly things like autoconf-archive) in ${SYSROOT}
because that's for DEPEND-class dependencies, then they end = up being
copied in unnecessarily and wrongly.

i think this optimism is = misplaced.  libraries often install m4 files
which is = precisely why this logic is in here.
https://bugs.gentoo.org/677002#c10

deleting this check will break things.  prob more than = we're fixing.

Sorry, you're absolutely right here!

But I think it's addressed by the system-acdir = commit that follows it up.

i.e. the = commit message is totally wrong (and I'll fix this), but the change is = correct
given we follow it up with seemingly a better way of = handling
the original case.

Does that sound right?

Best,
sam

= --Apple-Mail=_2DE5B281-25AF-482E-8986-ADF0F8E07ABD-- --Apple-Mail=_36879D80-B50C-4107-8787-6CFDE5C289D5 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEEYOpPv/uDUzOcqtTy9JIoEO6gSDsFAmHo+g5fFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDYw RUE0RkJGRkI4MzUzMzM5Q0FBRDRGMkY0OTIyODEwRUVBMDQ4M0IACgkQ9JIoEO6g SDuHGggAgwspxY09IzcOTNOiOkaQX60HLwW5/4iSXSAUb2cVYjKqDMQeTGu2yugS wLqeRn9wMSIKWwvKP1+C3FMyDe/OPxa4pucftAMZgjgM6av7otLbsNRoAU6O6i36 irJkUkOsyUqqx+dsPWKoVqAey5surALuc62JWdf3TBY6/Y1YK7qWowDVdbJtdOS4 T0nTbIRNwD4CHpVMAXapOvd/EP80+xjuFJUEIqQvmTv52oe2gKRsC54MFXHCP+aX g12VmE4UulFZiBgDrZpUyQ6Qg/76LqajPrU+0z228/X+VfDw3GDZMhg/LvKtHevw Hp0yVYGhKTz4kbesjbPDj5k0SLzkXQ== =Plum -----END PGP SIGNATURE----- --Apple-Mail=_36879D80-B50C-4107-8787-6CFDE5C289D5--