From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-40140.protonmail.ch (mail-40140.protonmail.ch [185.70.40.140]) by sourceware.org (Postfix) with ESMTPS id 6CC753858C62 for ; Thu, 15 Sep 2022 19:38:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6CC753858C62 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=proton.me Date: Thu, 15 Sep 2022 19:38:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1663270695; x=1663529895; bh=a9SwL3L0kcNRYW1KFDk/itStUIfWkCRpNKt2m1OjEtU=; h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID; b=QegY5enpY7TaD6aD5C5aatlx7bqmIpi9cZ+oaOOkXkCEXirUstxGmTpvggYzupadL xt1cu2QVH9FSpA/ViDSFTYIhdsLXxaVnrmz+NqyG/KFqdMHIAQ/2xYB3pRLLHq9dVC a1SvI8eWnQDKlyymnZkEWHplvLDI6uG4liGehsmvxcuInOvXJTe7S1neg/HgsuCo4+ skJcMWlq3It3/+Mu387ebvEhkBgg0Xbr4TZPIm96DfNfkc6h3H0K2Kiae0ArCx03qW RDe6c2HfQdHOCqDHwj0r3zUipvBJzxIpBso7JN0chYpXXCWtLLW9vK+45irOQRoXPf Tv2H55Udu/A8Q== To: "cygwin-apps@cygwin.com" From: William Hu Subject: Cygport Bug: "find: No such file" Errors When Packaging Message-ID: Feedback-ID: 51238035:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_INFOUSMEBIZ,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hello, I think I've found a (relatively innocuous) bug in cygport. It can be repro= duced=20 by compiling the OCaml package without having OCaml installed (which doesn'= t=20 sound like an unreasonable thing to try; it'd be odd if OCaml depended on= =20 itself). This results in many unattractive errors at the end of the `cygpor= t=20 package` stage when cygport searches for dependencies: *** Info: Tagging package hint files as test: find: =E2=80=98/usr/lib/ocaml=E2=80=99: No such file or directory find: =E2=80=98/usr/lib/ocaml=E2=80=99: No such file or directory >>> ocaml requires: cygwin libgcc1 flexdll ocaml-runtime find: =E2=80=98/usr/lib/ocaml=E2=80=99: No such file or directory find: =E2=80=98/usr/lib/ocaml=E2=80=99: No such file or directory >>> ocaml-runtime requires: cygwin libgcc1 find: =E2=80=98/usr/lib/ocaml=E2=80=99: No such file or directory find: =E2=80=98/usr/lib/ocaml=E2=80=99: No such file or directory >>> ocaml-compiler-libs requires: ocaml-runtime ocaml find: =E2=80=98/usr/lib/ocaml=E2=80=99: No such file or directory find: =E2=80=98/usr/lib/ocaml=E2=80=99: No such file or directory >>> ocaml-ocamldoc requires: cygwin libgcc1 ocaml-compiler-libs ocaml-runti= me find: =E2=80=98/usr/lib/ocaml=E2=80=99: No such file or directory find: =E2=80=98/usr/lib/ocaml=E2=80=99: No such file or directory >>> ocaml-source requires: find: =E2=80=98/usr/lib/ocaml=E2=80=99: No such file or directory find: =E2=80=98/usr/lib/ocaml=E2=80=99: No such file or directory >>> ocaml-doc requires: Looking at cygport's code=20 it seems cygport checks for the existence of ocamlc.opt on PATH. Because t= he=20 (package being built)'s install directory is appended to PATH by cygport, t= his=20 will always be true in my case. OCaml's compilers hardcode their location at compile time, so ocamlc.opt be= lieves=20 the standard library lives in "/usr/lib/ocaml" which is placed in `mldir`. Cygport checks one more time to make sure mldir exists in the package being= built=20 (this second check is why those errors are hard to trigger on a non-OCaml p= ackage)=20 and then calls `find` on both ${D}${mldir} and ${mldir}. Of course, since t= he=20 *real* /usr/lib/ocaml won't exist if OCaml isn't installed on your actual s= ystem=20 when you build it, find will output an error when run on those two director= ies. Two ways to fix this would be to either remove the ${mldir} argument from f= ind or=20 test if ${mldir} exists and set it to the empty string if it doesn't. The s= econd=20 would likely preserve compatibility if there exist packages that depend on = find=20 searching both directories. The buggy test was added in=20 .=20 Does anyone else have any insights or suggestions or does the above fix sou= nd reasonable? Thanks, William