From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by sourceware.org (Postfix) with ESMTP id 7751939450DC for ; Mon, 6 Apr 2020 16:43:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7751939450DC Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=cygwin.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=yselkowitz@cygwin.com Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-98-RC5T5_0vNROjSOMye4t-Rg-1; Mon, 06 Apr 2020 12:43:16 -0400 X-MC-Unique: RC5T5_0vNROjSOMye4t-Rg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A1F3219057AB for ; Mon, 6 Apr 2020 16:43:15 +0000 (UTC) Received: from ovpn-117-48.rdu2.redhat.com (ovpn-117-48.rdu2.redhat.com [10.10.117.48]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4C36F5C1B2 for ; Mon, 6 Apr 2020 16:43:15 +0000 (UTC) Message-ID: Subject: Re: Mingw pkg-config not working From: Yaakov Selkowitz To: cygwin@cygwin.com Date: Mon, 06 Apr 2020 12:43:14 -0400 In-Reply-To: References: <9f22993d-13d1-de2e-74ff-e9d08ec504ed@dronecode.org.uk> User-Agent: Evolution 3.34.4 (3.34.4-1.fc31) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: cygwin.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NEUTRAL, TXREP autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2020 16:43:21 -0000 On Sun, 2020-04-05 at 15:51 +0200, Carlo B. via Cygwin wrote: > I wanted to report that I received a reply on the issue that I had opened= here: >=20 > https://todo.sr.ht/~kaniini/pkgconf/10#comment-7894 Thanks for following up. > The report has been closed and I got this reply: >=20 > "You should use a symlink instead of a wrapper script when using the > personality feature." >=20 > I hope that somebody has understood what he means (posix is not > exactly my primary platform) and it could be useful for fixing the > issue. Yes, that gave me the information I needed. There is actually code within pkgconf to automatically load $PREFIX.personality when called as $PREFIX-pkg-config. This requires a packaging change on our end, which I'm incorporating into the latest release. > Il giorno gio 26 mar 2020 alle ore 14:07 Carlo B. > ha scritto: > > Hello, > > I implemented the solution to this problem as a patch to > > pkgconf.cygport as requested. > > I attached small patch to this email, which resolved the troubles with > > CMake and Meson. > > I hope that you will find it useful and some developers will gently > > apply the correction to fix the issue. > >=20 > > Thank you very much for your time and your support. > > Sincerely, > >=20 > > Carlo Bramini. > >=20 > > Il giorno sab 22 feb 2020 alle ore 18:47 Jon Turney > > ha scritto: > > > On 20/02/2020 11:06, Carlo B. wrote: > > > [...] > > > > x86_64-w64-mingw32-pkg-config are emulated with a shell script, for > > > > example the one for i686 is: > > > >=20 > > > > #!/bin/sh > > > > exec pkgconf --personality=3Di686-w64-mingw32 $@ > > > >=20 > > > > But while this solution mostly works when you exec it from the comm= and > > > > line, it makes impossible to detect the presence of the tool from > > > > meson and cmake build systems. > > > > If you try to do this on the bash prompt, you get: > > > >=20 > > > > $ i686-w64-mingw32-pkg-config --version > > > > pkgconf: --version specified with other options or module names, > > > > assuming --modversion. > > > > Please specify at least one package name on the command line. > > > >=20 > > > > and this is exactly what happens with those build systems (and perh= aps > > > > others, I don't know): it tries to call pkg-config with "--version" > > > > and it executes the above script that calls pkgconf. But sadly, the > > > > presence of the "--personality" option makes the process to fail, > > > > because the "--version" is currently allowed only when no other > > > > options are added. > > > > And, for this reason, meson and cmake fail the detection of the too= l. > > > >=20 > > > > I have also filed an issue here for pkgconf: > > > > https://todo.sr.ht/~kaniini/pkgconf/10 > > > > because the solution is actually to ignore the presence of the > > > > "--personality" option when the "--version" is written, but > > > > unfortunately I have not received any feedback. > > > >=20 > > > > So, I'm also writing here, with the hope that you could find a solu= tion. > > > [...] > > >=20 > > > Thanks for reporting this issue. > > >=20 > > > I guess the alternative to fixing pkgconf would be to modify those > > > wrapper scripts to detect when the parameters are just '--version' (o= r > > > equivalent) and not use --personality in that case? > > >=20 > > > These wrapper scripts are specific to cygwin (generated by the cygpor= t, > > > see [1]) > > >=20 > > > It's possible other distros have more sophisticated wrapper scripts, > > > which avoid this problem? > > >=20 > > > If you do write or discover some improved wrapper scripts, a patch to > > > [1] to update them would be appreciated. > > >=20 > > > [1] > > > https://cygwin.com/git-cygwin-packages/?p=3Dgit/cygwin-packages/pkgco= nf.git;a=3Dblob;f=3Dpkgconf.cygport#l84 -- Yaakov