Re: [PATCH spice-server v4 1/2] Add support for building with meson/ninja

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

 



> 
> > 
> > In a comparison with current autotools build system, meson/ninja
> > provides a huge improvement in build speed, while keeping the same
> > functionalities currently available and being considered more user
> > friendly.
> > 
> > The new system coexists within the same repository with the current one,
> > so we can do more extensive testing of its functionality before deciding
> > if the old system can be removed, or for some reason, has to stay for
> > good.
> > 
> > - Meson: https://mesonbuild.com
> > 
> >   This is the equivalent of autogen/configure step in autotools. It
> >   generates the files that will be used by ninja to actually build the
> >   source code.
> > 
> >   The project has received lots of traction recently, with many GNOME
> >   projects willing to move to this new build system. The following wiki
> >   page has more details of the status of the many projects being ported:
> > 
> >     https://wiki.gnome.org/Initiatives/GnomeGoals/MesonPorting
> > 
> >   Meson has a python-like syntax, easy to read, and the documentation
> >   on the project is very complete, with a dedicated page on how to port
> >   from autotools, explaining how most common use cases can be
> >   implemented using meson.
> > 
> >     http://mesonbuild.com/Porting-from-autotools.html
> > 
> >   Other important sources of information:
> > 
> >     http://mesonbuild.com/howtox.html
> >     http://mesonbuild.com/Syntax.html
> >     http://mesonbuild.com/Reference-manual.html
> > 
> > - Ninja: https://ninja-build.org
> > 
> >   Ninja is the equivalent of make in an autotools setup, which actually
> >   builds the source code. It has being used by large and complex
> >   projects such as Google Chrome, Android and LLVM. There is not much to
> >   say about ninja (other than it is much faster than make) because we
> >   won't interact directly with it as much, as meson does the middle man
> >   job here. The reasoning for creating ninja in the first place is
> >   explained on the following post:
> > 
> >     http://neugierig.org/software/chromium/notes/2011/02/ninja.html
> > 
> >   Also its manual provides more in-depth information about the design
> >   principles:
> > 
> >     https://ninja-build.org/manual.html
> > 
> > - Basic workflow:
> > 
> >   Meson package is available for most if not all distros, so, taking
> >   Fedora as an example, we only need to run:
> > 
> >     # dnf -y install meson ninja-build.
> > 
> >   With Meson, building in-tree is not possible at all, so we need to
> >   pass a directory as argument to meson where we want the build to be
> >   done. This has the advantage of creating builds with different options
> >   under the same parent directory, e.g.:
> > 
> >     $ meson ./build --prefix=/usr
> >     $ meson ./build-extra -Dextra-checks=true -Dalignment-checks=true
> > 
> >   After configuration is done, we call ninja to actually do the build.
> > 
> >     $ ninja -C ./build
> >     $ ninja -C ./build install
> > 
> >   Ninja defaults to parallel builds, and this can be changed with the -j
> >   flag.
> > 
> >     $ ninja -j 10 -C ./build
> > 
> > - Hacking:
> > 
> >   * meson.build: Mandatory for the project root and usually found under
> >                  each directory you want something to be built.
> > 
> >   * meson_options.txt: Options that can interfere with the result of the
> >                        build.
> > 
> > Signed-off-by: Eduardo Lima (Etrunko) <etrunko@xxxxxxxxxx>
> > Signed-off-by: Christophe Fergeau <cfergeau@xxxxxxxxxx>
> > Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
> 
> Does not build for me:
> 
> $ ninja -C build -j1
> ninja: Entering directory `build'
> [1/50] Linking target server/libspice-server.so.1.12.4.
> FAILED: server/libspice-server.so.1.12.4
> ccache cc  -o server/libspice-server.so.1.12.4
> 'server/server@@spice-server@sha/meson-generated_.._spice-server-enums.c.o'
> 'server/server@@spice-server@sha/agent-msg-filter.c.o'
> 'server/server@@spice-server@sha/char-device.c.o'
> 'server/server@@spice-server@sha/common-graphics-channel.c.o'
> 'server/server@@spice-server@sha/cursor-channel.c.o'
> 'server/server@@spice-server@sha/cursor-channel-client.c.o'
> 'server/server@@spice-server@sha/dcc.c.o'
> 'server/server@@spice-server@sha/dcc-send.c.o'
> 'server/server@@spice-server@sha/dispatcher.c.o'
> 'server/server@@spice-server@sha/display-channel.c.o'
> 'server/server@@spice-server@sha/event-loop.c.o'
> 'server/server@@spice-server@sha/glz-encoder.c.o'
> 'server/server@@spice-server@sha/glz-encoder-dict.c.o'
> 'server/server@@spice-server@sha/image-cache.c.o'
> 'server/server@@spice-server@sha/image-encoders.c.o'
> 'server/server@@spice-server@sha/inputs-channel.c.o'
> 'server/server@@spice-server@sha/inputs-channel-client.c.o'
> 'server/server@@spice-server@sha/jpeg-encoder.c.o'
> 'server/server@@spice-server@sha/main-channel.c.o'
> 'server/server@@spice-server@sha/main-channel-client.c.o'
> 'server/server@@spice-server@sha/main-dispatcher.c.o'
> 'server/server@@spice-server@sha/memslot.c.o'
> 'server/server@@spice-server@sha/mjpeg-encoder.c.o'
> 'server/server@@spice-server@sha/net-utils.c.o'
> 'server/server@@spice-server@sha/pixmap-cache.c.o'
> 'server/server@@spice-server@sha/red-channel.c.o'
> 'server/server@@spice-server@sha/red-channel-capabilities.c.o'
> 'server/server@@spice-server@sha/red-channel-client.c.o'
> 'server/server@@spice-server@sha/red-client.c.o'
> 'server/server@@spice-server@sha/red-parse-qxl.c.o'
> 'server/server@@spice-server@sha/red-pipe-item.c.o'
> 'server/server@@spice-server@sha/red-qxl.c.o'
> 'server/server@@spice-server@sha/red-record-qxl.c.o'
> 'server/server@@spice-server@sha/red-replay-qxl.c.o'
> 'server/server@@spice-server@sha/reds.c.o'
> 'server/server@@spice-server@sha/red-stream.c.o'
> 'server/server@@spice-server@sha/red-worker.c.o'
> 'server/server@@spice-server@sha/sound.c.o'
> 'server/server@@spice-server@sha/spice-bitmap-utils.c.o'
> 'server/server@@spice-server@sha/spicevmc.c.o'
> 'server/server@@spice-server@sha/stat-file.c.o'
> 'server/server@@spice-server@sha/stream-channel.c.o'
> 'server/server@@spice-server@sha/red-stream-device.c.o'
> 'server/server@@spice-server@sha/sw-canvas.c.o'
> 'server/server@@spice-server@sha/tree.c.o'
> 'server/server@@spice-server@sha/utils.c.o'
> 'server/server@@spice-server@sha/video-stream.c.o'
> 'server/server@@spice-server@sha/zlib-encoder.c.o'
> 'server/server@@spice-server@sha/lz4-encoder.c.o'
> 'server/server@@spice-server@sha/smartcard.c.o'
> 'server/server@@spice-server@sha/smartcard-channel-client.c.o'
> 'server/server@@spice-server@sha/gstreamer-encoder.c.o' -Wl,--no-undefined
> -Wl,--as-needed -shared -fPIC -Wl,--start-group
> -Wl,-soname,libspice-server.so.1
> subprojects/spice-common/common/libspice-common-server.a
> subprojects/spice-common/common/libspice-common.a
> -Wl,--no-copy-dt-needed-entries -Wl,-z,relro -Wl,-z,now
> -Wl,--version-script=/home/freddy/work/spice-server/server/spice-server.syms
> -lm -Wl,--end-group /usr/lib64/libglib-2.0.so /usr/lib64/libgio-2.0.so
> /usr/lib64/libgobject-2.0.so /usr/lib64/libgthread-2.0.so -pthread
> /usr/lib64/libpixman-1.so /usr/lib64/libssl.so /usr/lib64/libcrypto.so
> /usr/lib64/libcelt051.so /usr/lib64/libm.so /usr/lib64/libopus.so
> /home/freddy/install/lib/libcacard.so /usr/lib64/libssl3.so
> /usr/lib64/libsmime3.so /usr/lib64/libnss3.so /usr/lib64/libnssutil3.so
> /usr/lib64/libplds4.so /usr/lib64/libplc4.so /usr/lib64/libnspr4.so
> /usr/lib64/libpthread.so /usr/lib64/libdl.so /usr/lib64/libjpeg.so
> /usr/lib64/libz.so /usr/lib64/librt.so /usr/lib64/libgstreamer-1.0.so
> /usr/lib64/libgstbase-1.0.so /usr/lib64/libgstapp-1.0.so
> /usr/lib64/libgstvideo-1.0.so /usr/lib64/liborc-0.4.so /usr/lib64/liblz4.so
> /usr/lib64/libsasl2.so -lm -pthread -lm -pthread
> server/server@@spice-server@sha/dcc.c.o: In function
> `display_channel_client_class_init':
> /home/freddy/work/spice-server/build/../server/dcc.c:139: undefined reference
> to `spice_image_compression_t_spice_image_compression_t_get_type'
> /home/freddy/work/spice-server/build/../server/dcc.c:149: undefined reference
> to `spice_wan_compression_t_spice_wan_compression_t_get_type'
> /home/freddy/work/spice-server/build/../server/dcc.c:159: undefined reference
> to `spice_wan_compression_t_spice_wan_compression_t_get_type'
> collect2: error: ld returned 1 exit status
> ninja: build stopped: subcommand failed.
> 
> 
> Frediano

Apparently got confused by existence of server/spice-server-enums.[ch] files.
Removing them fix the issue.

Frediano
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]