Re: [PATCH v5] libtracefs: Add initial support for meson

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 04, 2023 at 12:44:14PM -0500, Steven Rostedt wrote:
> On Wed, 4 Jan 2023 18:19:39 +0100
> Daniel Wagner <dwagner@xxxxxxx> wrote:
 > setup. Basically with
> > 
> > 
> >   'meson setup .build --wrap-mode=forcefallback'
> > 
> > in trace-cmd meson would download, setup and build libtraceevent and libtracefs
> > within the trace-cmd build. This is makes the whole development process
> > between these project way smoother. And if you would configure the build
> > with
> 
> I'm not sure that would make it easier for me. I work on each separately.
> And I don't always want them linked together, but sometimes I do!

Meson doesn't force you here how you prefer you workflow. If you want to
stick with your development steps all should be fine. I just recommend to give
those subproject a try. IMO it makes things simpler, e.g. building all code in
debug mode and being able to single step through is nice. And if you find a bug
or want to change a line in the libraries, just change the line recompile the
main project and that's all. No installing or fiddling with some $PATHs. All works
out of the box.

> To
> control what gets linked to trace-cmd, I use dynamic libraries, and only
> install what I want to use there. That is, they really are three different
> projects! I use libtracefs on several other tools, not just trace-cmd.

Depending on the default settings, the libraries are either dynamically or
statically linked. Meson takes care of all those path issues. For example for
the nmve-cli project I have following linking situation:

$ ldd .build/nvme
        linux-vdso.so.1 (0x00007ffd9975f000)
        libnvme.so.1 => /home/wagi/work/nvme-cli/.build/subprojects/libnvme/src/libnvme.so.1 (0x00007fb934141000)
        libnvme-mi.so.1 => /home/wagi/work/nvme-cli/.build/subprojects/libnvme/src/libnvme-mi.so.1 (0x00007fb934135000)
        libjson-c.so.5 => /lib64/libjson-c.so.5 (0x00007fb9340fe000)
        libz.so.1 => /lib64/libz.so.1 (0x00007fb9340e2000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fb933ee7000)
        libcrypto.so.3 => /lib64/libcrypto.so.3 (0x00007fb933a00000)
        libdbus-1.so.3 => /lib64/libdbus-1.so.3 (0x00007fb933e94000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fb934169000)
        libsystemd.so.0 => /lib64/libsystemd.so.0 (0x00007fb93392e000)
        libcap.so.2 => /lib64/libcap.so.2 (0x00007fb933e88000)
        libgcrypt.so.20 => /lib64/libgcrypt.so.20 (0x00007fb9337e5000)
        liblzma.so.5 => /lib64/liblzma.so.5 (0x00007fb933e54000)
        libzstd.so.1 => /lib64/libzstd.so.1 (0x00007fb933733000)
        liblz4.so.1 => /lib64/liblz4.so.1 (0x00007fb93370f000)
        libgpg-error.so.0 => /lib64/libgpg-error.so.0 (0x00007fb9336e9000)

In this scenario libnvme is linked in as dynamic library.

> >   'meson setup .build --wrap-mode=forcefallback --default-library=static'
> > 
> > would staticly link all subprojects into the trace-cmd binary.
> > 
> > I haven't added this part to the initial mesonizing of the projects. Keep
> > things simple to begin with.
> 
> For the environment that we require a static build, that isn't really
> needed. It would only make the initial setup easier, but that's a one time
> deal. After that, everything is automated.

Before you spend too much time in writing scripts aroudn Meson, you should
really have a look at subproject. You get the dependencies management for little
costs.



[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux