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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 968661382C5 for ; Wed, 6 Jan 2021 23:18:19 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 209D3E08C4; Wed, 6 Jan 2021 23:18:16 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E033FE089C for ; Wed, 6 Jan 2021 23:18:15 +0000 (UTC) Received: by mail-io1-f42.google.com with SMTP id t8so4371453iov.8 for ; Wed, 06 Jan 2021 15:18:14 -0800 (PST) X-Gm-Message-State: AOAM53214DRTYU+AYPLTEChWaZenAajWKojcMAcxq7dr+0P8nG5zKfIf QIlG1TXKw+BFxsAzN3YMs6P3OXW9ZFKRXwSVg7w= X-Google-Smtp-Source: ABdhPJyFBBT0pJ7hpVDjzVzWvdcIFRJGggKChKdSeRaBy2As64KPQcRVnBuONBdAHXh05T5M1kqh0zxSm1IyvlSf+V0= X-Received: by 2002:a6b:8e41:: with SMTP id q62mr4586553iod.5.1609975092677; Wed, 06 Jan 2021 15:18:12 -0800 (PST) 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 References: <20210103010904.1158863-1-floppym@gentoo.org> <20210103125208.0694a788@symphony.aura-online.co.uk> <20210104231826.3781d650@symphony.aura-online.co.uk> <20210106224711.70b8b8e5@symphony.aura-online.co.uk> In-Reply-To: <20210106224711.70b8b8e5@symphony.aura-online.co.uk> From: Mike Gilbert Date: Wed, 6 Jan 2021 18:18:01 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [gentoo-dev] [PATCH] systemd.eclass: remove SYSROOT from pkg-config output To: Gentoo Dev Content-Type: text/plain; charset="UTF-8" X-Archives-Salt: e93b4535-df76-441d-9674-88d518bcb9fe X-Archives-Hash: ad66e7870b7bb9dfb30940efccb2b7a0 On Wed, Jan 6, 2021 at 5:47 PM James Le Cuirot wrote: > > On Mon, 4 Jan 2021 19:28:37 -0500 > Mike Gilbert wrote: > > > On Mon, Jan 4, 2021 at 6:45 PM Mike Gilbert wrote: > > > > > > On Mon, Jan 4, 2021 at 6:18 PM James Le Cuirot wrote: > > > > $ PKG_CONFIG_SYSROOT_DIR=/foo pkg-config --variable=udevdir udev > > > > /lib/udev > > > > > > > > The udevdir variable is not affected by PKG_CONFIG_SYSROOT_DIR at all. > > > > And why would it be? The man page says that this variable is only > > > > applied to -I and -L flags. I don't know for sure but I suspect that > > > > pkg-config just sees this as some arbitrary variable with no special > > > > path handling at all. I wonder what led you to think that this fix was > > > > necessary? > > > > > > Interesting! > > > > > > pkg-config behaves differently on my system: > > > > > > % PKG_CONFIG_SYSROOT_DIR=/foo pkg-config --variable=udevdir udev > > > /foo/lib/udev > > > > > > This appears to be a difference in behavior between dev-util/pkgconfig > > > and dev-util/pkgconf. I am using pkgconf, and I would guess you are > > > using pkgconfig. > > > > > > I guess I will ask pkgconf upstream for help on this; it seems like > > > this is probably an unintended behavior. > > > > It seems that the pkgconf behavior is intentional. > > > > https://github.com/pkgconf/pkgconf/issues/69 > > > > I opened an issue to see if we can get some kind of opt-out. > > > > https://github.com/pkgconf/pkgconf/issues/205 > > Hmmm. At this point, I'm thinking maybe we should just address this in > cross-pkg-config. It seems unfair to ask upstream to accommodate this > when the tool is just doing what we asked it to. Perhaps it could > respect PKG_CONFIG_SYSROOT_DIR if it is already set, even when empty. > It wouldn't allow to you set this differently for the build host but > you shouldn't ever have to. I think I'd prefer this over adding yet > another confusing variable. The same could be applied to > PKG_CONFIG_LIBDIR and PKG_CONFIG_SYSTEM_LIBRARY_PATH for consistency. > What do you think? I like the idea of having cross-pkg-config respect PKG_CONFIG_SYSROOT_DIR from the calling environment (even if it is empty). That's just a more flexible design overall. However, I think there's a fundamental design conflict here. Prefixing all pkgconfig variables that happen to start with a slash is problematic, and the desired result depends on the context in which it will be used. If the result is going to be used to find some existing file in SYSROOT (like the SDK example included in issue 69 from above), then we want it to be prefixed with SYSROOT. If the result is going to be used to install new files, we don't want SYSROOT in the result. The package manager is responsible for prefixing the paths with ROOT when merging the files. We could apply workarounds in ebuilds/eclasses to make this distinction in Gentoo by setting PKG_CONFIG_SYSROOT_DIR selectively. However, I wonder if there is a workable solution to this that could be applied in upstream projects.