comp.lang.ada
 help / color / mirror / Atom feed
* Using GPRbuild in GitLab build pipeline to build against a library that's not installed
@ 2020-05-01 14:05 Trescott Jensen
  2020-05-01 19:19 ` onox
  0 siblings, 1 reply; 4+ messages in thread
From: Trescott Jensen @ 2020-05-01 14:05 UTC (permalink / raw)


I've been reading the GPRbuild documentation trying to learn how to do 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.)

I'm playing with the basic GtkAda "hello world" example program.

I can build it on my local box (Linux), but the build pipeline on GitLab 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 have the library installed.

I have tried including the gtkada git repository as a sub-module in my git repository and building it with my project, but this leads to more dependency issues, when I don't really need to build the library in the first place.

I've tried including the compiled library in my git repository and copying/installing the files into the build pipeline's environment, but the build process does not have the needed permissions. (I didn't expect this to work.)

So, this leaves me wanting to tell GPRbuild to look in a non-standard location to find the library to build against.

How do I specify a path for libraries?

Am I going about this the wrong way? Is there a better way?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Using GPRbuild in GitLab build pipeline to build against a library that's not installed
  2020-05-01 14:05 Using GPRbuild in GitLab build pipeline to build against a library that's not installed Trescott Jensen
@ 2020-05-01 19:19 ` onox
  2020-05-01 22:39   ` Trescott Jensen
  0 siblings, 1 reply; 4+ messages in thread
From: onox @ 2020-05-01 19:19 UTC (permalink / raw)


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 do 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.)
> 
> I'm playing with the basic GtkAda "hello world" example program.
> 
> I can build it on my local box (Linux), but the build pipeline on GitLab 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 have the library installed.
> 
> I have tried including the gtkada git repository as a sub-module in my git repository and building it with my project, but this leads to more dependency issues, when I don't really need to build the library in the first place.
> 
> I've tried including the compiled library in my git repository and copying/installing the files into the build pipeline's environment, but the build process does not have the needed permissions. (I didn't expect this to work.)
> 
> So, this leaves me wanting to tell GPRbuild to look in a non-standard location to find the library to build against.
> 
> How do I specify a path for libraries?
> 
> Am I going about this the wrong way? Is there a better way?

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 displayed with gnatls -v. Library (.so files) paths can be set with LD_LIBRARY_PATH.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Using GPRbuild in GitLab build pipeline to build against a library that's not installed
  2020-05-01 19:19 ` onox
@ 2020-05-01 22:39   ` Trescott Jensen
  2020-05-02 18:27     ` Anh Vo
  0 siblings, 1 reply; 4+ messages in thread
From: Trescott Jensen @ 2020-05-01 22:39 UTC (permalink / raw)


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 do 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.)
> > 
> > I'm playing with the basic GtkAda "hello world" example program.
> > 
> > I can build it on my local box (Linux), but the build pipeline on GitLab 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 have the library installed.
> > 
> > I have tried including the gtkada git repository as a sub-module in my git repository and building it with my project, but this leads to more dependency issues, when I don't really need to build the library in the first place.
> > 
> > I've tried including the compiled library in my git repository and copying/installing the files into the build pipeline's environment, but the build process does not have the needed permissions. (I didn't expect this to work.)
> > 
> > So, this leaves me wanting to tell GPRbuild to look in a non-standard location to find the library to build against.
> > 
> > How do I specify a path for libraries?
> > 
> > Am I going about this the wrong way? Is there a better way?
> 
> 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 displayed with gnatls -v. Library (.so files) paths can be set with LD_LIBRARY_PATH.

I forgot to mention that I had tried using LD_LIBRARY_PATH, but I didn't know about ADA_PROJECT_PATH or gnatls -v.

I used gnatls -v on my local box:
GNATLS 9.3.0
Copyright (C) 1997-2019, Free Software Foundation, Inc.

Source Search Path:
   <Current_Directory>
   /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/adainclude


Object Search Path:
   <Current_Directory>
   /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/adalib


Project Search Path:
   <Current_Directory>
   /usr/x86_64-pc-linux-gnu/lib/gnat
   /usr/x86_64-pc-linux-gnu/share/gpr
   /usr/share/gpr
   /usr/lib/gnat


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 some of the options in the gpr file.

I added all the GtkAda files to my git repository so that the relative paths would match the gtkada.gpr file and added the ADA_PROJECT_PATH and LD_LIBRARY_PATH to the environment.

*The build pipeline now see GtkAda.*

Now I have to resolve a GNAT version discrepancy between the library and the pipeline. But for that one I know what to do...

Thank you Onox for your guidance. You have save me a lot of time and pain.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Using GPRbuild in GitLab build pipeline to build against a library that's not installed
  2020-05-01 22:39   ` Trescott Jensen
@ 2020-05-02 18:27     ` Anh Vo
  0 siblings, 0 replies; 4+ messages in thread
From: Anh Vo @ 2020-05-02 18:27 UTC (permalink / raw)


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 do 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.)
> > > 
> > > I'm playing with the basic GtkAda "hello world" example program.
> > > 
> > > I can build it on my local box (Linux), but the build pipeline on GitLab 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 have the library installed.
> > > 
> > > I have tried including the gtkada git repository as a sub-module in my git repository and building it with my project, but this leads to more dependency issues, when I don't really need to build the library in the first place.
> > > 
> > > I've tried including the compiled library in my git repository and copying/installing the files into the build pipeline's environment, but the build process does not have the needed permissions. (I didn't expect this to work.)
> > > 
> > > So, this leaves me wanting to tell GPRbuild to look in a non-standard location to find the library to build against.
> > > 
> > > How do I specify a path for libraries?
> > > 
> > > Am I going about this the wrong way? Is there a better way?
> > 
> > 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 displayed with gnatls -v. Library (.so files) paths can be set with LD_LIBRARY_PATH.
> 
> I forgot to mention that I had tried using LD_LIBRARY_PATH, but I didn't know about ADA_PROJECT_PATH or gnatls -v.
> 
> I used gnatls -v on my local box:
> GNATLS 9.3.0
> Copyright (C) 1997-2019, Free Software Foundation, Inc.
> 
> Source Search Path:
>    <Current_Directory>
>    /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/adainclude
> 
> 
> Object Search Path:
>    <Current_Directory>
>    /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/adalib
> 
> 
> Project Search Path:
>    <Current_Directory>
>    /usr/x86_64-pc-linux-gnu/lib/gnat
>    /usr/x86_64-pc-linux-gnu/share/gpr
>    /usr/share/gpr
>    /usr/lib/gnat
> 
> 
> 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 some of the options in the gpr file.
> 
> I added all the GtkAda files to my git repository so that the relative paths would match the gtkada.gpr file and added the ADA_PROJECT_PATH and LD_LIBRARY_PATH to the environment.
> 
> *The build pipeline now see GtkAda.*
> 
> Now I have to resolve a GNAT version discrepancy between the library and the pipeline. But for that one I know what to do...
> 
> 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’s Guide", you would have spotted this information. By the way, ADA_PROJECT_PATH environment is used for compatibility. The prefered one is GPR_PROJECT_PATH.

Gpr build document can be found at AdaCore site, https://docs.adacore.com/live/wave/gprbuild/html/gprbuild_ug/gprbuild_ug.html. In addition, it also comes with GNAT, and it can be invoked thru GPS Help menu as Help -> GNAT -> Gprbuild and GNAT Project Files.

Anh Vo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-02 18:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-01 14:05 Using GPRbuild in GitLab build pipeline to build against a library that's not installed Trescott Jensen
2020-05-01 19:19 ` onox
2020-05-01 22:39   ` Trescott Jensen
2020-05-02 18:27     ` Anh Vo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox