From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a05:620a:1384:: with SMTP id k4mr8839732qki.423.1588444080213; Sat, 02 May 2020 11:28:00 -0700 (PDT) X-Received: by 2002:a9d:5cc1:: with SMTP id r1mr7768349oti.329.1588444079864; Sat, 02 May 2020 11:27:59 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!feeder1.feed.usenet.farm!feed.usenet.farm!tr3.eu1.usenetexpress.com!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 2 May 2020 11:27:59 -0700 (PDT) In-Reply-To: <9a3baf9e-c965-4fd0-8e7c-7d4f27fe5ef2@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=149.32.224.43; posting-account=Qh2kiQoAAADpCLlhT_KTYoGO8dU3n4I6 NNTP-Posting-Host: 149.32.224.43 References: <881e15f4-b250-443e-80a7-e1c867637176@googlegroups.com> <9a3baf9e-c965-4fd0-8e7c-7d4f27fe5ef2@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <1aac42ed-c83f-4056-9523-2ed3ad150427@googlegroups.com> Subject: Re: Using GPRbuild in GitLab build pipeline to build against a library that's not installed From: Anh Vo Injection-Date: Sat, 02 May 2020 18:28:00 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:58554 Date: 2020-05-02T11:27:59-07:00 List-Id: On Friday, May 1, 2020 at 3:39:41 PM UTC-7, Trescott Jensen wrote: > On Friday, May 1, 2020 at 1:19:43 PM UTC-6, onox wrote: > > On Friday, May 1, 2020 at 4:05:46 PM UTC+2, Trescott Jensen wrote: > > > I've been reading the GPRbuild documentation trying to learn how to d= o this, but I'm not finding what I need. (Or maybe I'm not recognizing it. = My experience is with the Green Hills build tools.) > > >=20 > > > I'm playing with the basic GtkAda "hello world" example program. > > >=20 > > > I can build it on my local box (Linux), but the build pipeline on Git= Lab fails on the with "gtkada" line in the gpr file. I recognize that this = is because the environment that the build pipeline is running in does not h= ave the library installed. > > >=20 > > > I have tried including the gtkada git repository as a sub-module in m= y git repository and building it with my project, but this leads to more de= pendency issues, when I don't really need to build the library in the first= place. > > >=20 > > > I've tried including the compiled library in my git repository and co= pying/installing the files into the build pipeline's environment, but the b= uild process does not have the needed permissions. (I didn't expect this to= work.) > > >=20 > > > So, this leaves me wanting to tell GPRbuild to look in a non-standard= location to find the library to build against. > > >=20 > > > How do I specify a path for libraries? > > >=20 > > > Am I going about this the wrong way? Is there a better way? > >=20 > > You can specify the search paths with ADA_PROJECT_PATH (multiple paths = separated by a colon). The search paths that gprbuild will use can be displ= ayed with gnatls -v. Library (.so files) paths can be set with LD_LIBRARY_P= ATH. >=20 > I forgot to mention that I had tried using LD_LIBRARY_PATH, but I didn't = know about ADA_PROJECT_PATH or gnatls -v. >=20 > I used gnatls -v on my local box: > GNATLS 9.3.0 > Copyright (C) 1997-2019, Free Software Foundation, Inc. >=20 > Source Search Path: > > /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/adainclude >=20 >=20 > Object Search Path: > > /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/adalib >=20 >=20 > Project Search Path: > > /usr/x86_64-pc-linux-gnu/lib/gnat > /usr/x86_64-pc-linux-gnu/share/gpr > /usr/share/gpr > /usr/lib/gnat >=20 >=20 > Which lead to finding /usr/lib/gnat/gtkada.gpr Which showed me what files= I had missed before and cleared up a lot of confusion about how to use som= e of the options in the gpr file. >=20 > I added all the GtkAda files to my git repository so that the relative pa= ths would match the gtkada.gpr file and added the ADA_PROJECT_PATH and LD_L= IBRARY_PATH to the environment. >=20 > *The build pipeline now see GtkAda.* >=20 > Now I have to resolve a GNAT version discrepancy between the library and = the pipeline. But for that one I know what to do... >=20 > Thank you Onox for your guidance. You have save me a lot of time and pain= . I am glad that Onox helped you out. If you have read the "GPRbuild and GPR = Companion Tools User=E2=80=99s Guide", you would have spotted this informat= ion. By the way, ADA_PROJECT_PATH environment is used for compatibility. Th= e prefered one is GPR_PROJECT_PATH. Gpr build document can be found at AdaCore site, https://docs.adacore.com/l= ive/wave/gprbuild/html/gprbuild_ug/gprbuild_ug.html. In addition, it also c= omes with GNAT, and it can be invoked thru GPS Help menu as Help -> GNAT ->= Gprbuild and GNAT Project Files. Anh Vo