Package Details: libadalang 2020-1

Git Clone URL: https://aur.archlinux.org/libadalang.git (read-only, click to copy)
Package Base: libadalang
Description: A high performance semantic engine for the Ada programming language.
Upstream URL: https://github.com/AdaCore/libadalang
Licenses: GPL
Submitter: charlie5
Maintainer: charlie5 (xiretza)
Last Packager: xiretza
Votes: 4
Popularity: 0.082200
First Submitted: 2017-06-05 06:00
Last Updated: 2020-05-23 19:08

Sources (37)

Latest Comments

1 2 3 4 Next › Last »

xiretza commented on 2020-06-27 11:24

@tfl5034 - yeah, that was my conclusion as well, see also my rejected PR here (which also sets a few more -X... flags): https://github.com/AdaCore/ada_language_server/pull/470

tfl5034 commented on 2020-06-27 11:21

Thanks for the help! Figured the issue out: I had to explicitly set the make variable LIBRARY_TYPE=relocatable to build and then I had to patch the Makefile to add a variable to a gprbuild command. https://aur.archlinux.org/packages/ada_language_server/

pmderodat commented on 2020-06-16 09:47

Hello,

There’s a known bug somewhere between GCC and GPRbuild: one one hand some Linux distros (ArchLinux and Ubuntu at least) configure GCC to automatically pass -pie when linking, and on the other hand, for GPRbuild passes the -r option to do a partial link when building standalone libraries in static mode (and Libadalang is a a standalone library).

Since -r and -pie are mutually incompatible, building Libadalang in static mode does not work on such distros. This is what I have documented in the libadalang-git package, and very likely why this package does not build LAL in static mode.

Now, if I understand correctly, ArchLinux packages should contain dynamically linked programs (to save disk space, avoid rebuilds on dependency update, …). So shouldn’t ada_language_server be built in dynamic mode, working around this static link issue?

If that helps, I’m also available on IRC (pmderodat@freenode, on #ada) :-)

xiretza commented on 2020-06-14 21:41

@tfl5034: ah, I get it now! That's a weird one. Most of the Ada packages are built in three versions - static, static-pic and relocatable. Picking out xmlada_dom as a random example, the xmlada PKGBUILD builds both a usr/lib/xmlada/xmlada_dom.static/libxmlada_dom.a (static) as well as a usr/lib/xmlada/xmlada_dom.relocatable/libxmlada_dom.so (relocatable), so I'm really not sure what it's complaining about there.

One thing I noticed in that log is that it's building with -XBUILD_MODE=dev, might want to use make BUILD_MODE=prod.

I'd gladly assist with bug hunting (I have some experience now after updating all the AdaCore packages to 2020...), just poke me on IRC (lambda@freenode) if you want.

tfl5034 commented on 2020-06-14 20:43

@xiretza I wanted to clarify that this is not necessarily an issue building your libadalang package. It builds and installs fine. What I want to do is leverage this package to build ada_language_server version 21.0.11. I am creating a PKGBUILD for ada_language_server and it fails on the build step when executing make. The error is as follows:

==> Extracting sources...
  -> Extracting 21.0.11.tar.gz with bsdtar
==> Starting build()...
gprbuild -j0 -P gnat/spawn_tests.gpr -p -XBUILD_MODE=dev -XOS=unix
Setup
   [mkdir]        object directory for project Spawn
   [mkdir]        object directory for project Spawn_Tests
Compile
   [Ada]          spawn_test.adb
   [c]            posix_const.c
   [Ada]          spawn.ads
   [Ada]          spawn-processes__posix.adb
   [Ada]          spawn-processes-monitor_loop.adb
   [Ada]          spawn-string_vectors.ads
   [Ada]          spawn-processes-monitor__posix.adb
   [Ada]          spawn-posix.ads
   [Ada]          spawn-environments.adb
   [Ada]          spawn-internal__posix.adb
   [Ada]          spawn-environments-internal__posix.adb
Bind
   [gprbind]      spawn_test.bexch
   [Ada]          spawn_test.ali
Link
   [archive]      libspawn_tests.a
   [index]        libspawn_tests.a
   [link]         spawn_test.adb
gprbuild -j0 -P gnat/tester.gpr -p -XBUILD_MODE=dev -XOS=unix
Setup
   [mkdir]        object directory for project LSP
   [mkdir]        object directory for project LSP_Client
   [mkdir]        object directory for project Tester
Compile
   [Ada]          tester-run.adb
   [Ada]          tester.ads
   [Ada]          tester-macros.adb
   [Ada]          tester-tests.adb
   [Ada]          uris.adb
   [Ada]          lsp.ads
   [Ada]          lsp-raw_clients.adb
Bind
   [gprbind]      tester-run.bexch
   [Ada]          tester-run.ali
Link
   [archive]      libtester.a
   [index]        libtester.a
   [link]         tester-run.adb
gprbuild -j0 -d -ws -c -u -P gnat/lsp_server.gpr -p -XBUILD_MODE=dev -XOS=unix s-memory.adb
Setup
   [mkdir]        object directory for project LSP_Server
libadalang.gpr:14:17: shared library project "libadalang" cannot import static library project "gnatcoll_gmp"
libadalang.gpr:14:17: shared library project "libadalang" cannot import static library project "gnatcoll"
libadalang.gpr:14:17: shared library project "libadalang" cannot import static library project "xmlada_dom"
libadalang.gpr:14:17: shared library project "libadalang" cannot import static library project "xmlada_input"
libadalang.gpr:14:17: shared library project "libadalang" cannot import static library project "xmlada_unicode"
libadalang.gpr:14:17: shared library project "libadalang" cannot import static library project "xmlada_sax"
libadalang.gpr:14:17: shared library project "libadalang" cannot import static library project "xmlada_schema"
libadalang.gpr:14:17: shared library project "libadalang" cannot import static library project "gpr"
libadalang.gpr:14:17: shared library project "libadalang" cannot import static library project "gnatcoll_iconv"
langkit_support.gpr:12:17: shared library project "langkit_support" cannot import static library project "gnatcoll"
langkit_support.gpr:12:17: shared library project "langkit_support" cannot import static library project "xmlada_dom"
langkit_support.gpr:12:17: shared library project "langkit_support" cannot import static library project "xmlada_input"
langkit_support.gpr:12:17: shared library project "langkit_support" cannot import static library project "xmlada_unicode"
langkit_support.gpr:12:17: shared library project "langkit_support" cannot import static library project "xmlada_sax"
langkit_support.gpr:12:17: shared library project "langkit_support" cannot import static library project "xmlada_schema"
langkit_support.gpr:12:17: shared library project "langkit_support" cannot import static library project "gpr"
langkit_support.gpr:12:17: shared library project "langkit_support" cannot import static library project "gnatcoll_iconv"
gprbuild: "gnat/lsp_server.gpr" processing failed
make: *** [Makefile:72: all] Error 4
==> ERROR: A failure occurred in build().
    Aborting...
==> ERROR: Build failed, check /home/tim/.cache/clean-chroot-manager/tim/build

xiretza commented on 2020-06-14 12:16

@tfl5034: please post the error you get when building the actual package, without messing around in the sources yourself. FWIW it builds fine in a clean chroot here.

tfl5034 commented on 2020-06-14 11:27

I'm getting an error when using this package to compile ada_language_server. The error is that libadalang is compiled as a shared project while seemingly every other dependency of ada_language_server is static. I tried adding --library-type static to all the ada/manage.py commands, but got the following linking error. Got any idea on a fix?

/usr/bin/ld: -r and -pie may not be used together
collect2: error: ld returned 1 exit status
gprlib: call to linker driver /usr/bin/gcc failed
gprbuild: raised CONSTRAINT_ERROR : gprbuild-post_compile.adb:1113 range check failed
0x5559284879cd
0x55592849f0fa
0x5559284a5e72
0x5559284aedc2
0x5559284aff5d
0x55592840a284
0x5559283f8319
[/usr/lib/libc.so.6]
0x7fb71dc2e000
0x5559283f838c
0xfffffffffffffffe

Build failed: error while running gprbuild -p -j16 -P/home/tim/.cache/yay/libadalang/src/libadalang-2020-20200429-19982-src/build/lib/gnat/libadalang.gpr -XBUILD_MODE=prod -XLIBRARY_TYPE=static -XGPR_BUILD=static -XXMLADA_BUILD=static -XLIBADALANG_WARNINGS=true -R -cargs -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -largs -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -gargs:
    Command '['gprbuild', '-p', '-j16', '-P/home/tim/.cache/yay/libadalang/src/libadalang-2020-20200429-19982-src/build/lib/gnat/libadalang.gpr', '-XBUILD_MODE=prod', '-XLIBRARY_TYPE=static', '-XGPR_BUILD=static', '-XXMLADA_BUILD=static', '-XLIBADALANG_WARNINGS=true', '-R', '-cargs', '-march=x86-64', '-mtune=generic', '-O2', '-pipe', '-fno-plt', '-largs', '-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now', '-gargs']' returned non-zero exit status 4
==> ERROR: A failure occurred in build().
    Aborting...

krouziciorel commented on 2020-06-11 08:47

Thank you very much for the quick answer, I would like to wait a few days to update the gnatcoll-iconv package, so far I can use eg VSCode with ADA extension.

xiretza commented on 2020-06-10 21:43

@krouziciorel: as the error says, files from gnatcoll-iconv and libadalang were compiled with different GNAT/compiler versions - you probably have to rebuild gnatcoll-iconv. You can either do that manually right now or wait a few days for a TU to accept the open merge request into gnatcoll-bindings, at which point I'll bump the pkgrel and your AUR helper will presumably update it anyway.

krouziciorel commented on 2020-06-10 21:38

Dear Xiretza,

I tried to build actual libadalang package, all dependencies are installed properly. During building I got the following error:


...

[Ada] libadalang-introspection.adb

libadalang-implementation.ads:20:18: warning: license of withed unit

"GNATCOLL.GMP.Integers" may be inconsistent

Build Libraries

[gprlib] langkit_support.lexch

[gprlib] adalang.lexch

[bind SAL] langkit_support

error: "gnatcoll-iconv.adb" and "langkit_support-adalog-abstract_relation.adb" compiled with different GNAT versions

error: "gnatcoll-traces.adb" must be compiled

error: ("/usr/lib/gnatcoll.relocatable/gnatcoll-traces.ali" is obsolete and read-only)

error: "gnatcoll-refcount.adb" must be compiled

error: ("/usr/lib/gnatcoll.relocatable/gnatcoll-refcount.ali" is obsolete and read-only)

error: "gnatcoll-storage_pools-headers.adb" has been modified and must be recompiled

error: "gnatcoll-iconv.adb" must be compiled

error: ("/usr/lib/gnatcoll_iconv.relocatable/gnatcoll-iconv.ali" is obsolete and read-only)

gprlib: invocation of /usr/bin/gnatbind failed

gprbuild: raised CONSTRAINT_ERROR : gprbuild-post_compile.adb:1113 range check failed

0x560208f089cd

0x560208f200fa

0x560208f26e72

0x560208f2fdc2

0x560208f30f5d

0x560208e8b284

0x560208e79319

[/usr/lib/libc.so.6]

0x7f5ca7bb8000

0x560208e7938c

0xfffffffffffffffe

Build failed: error while running gprbuild -p -j2 -P/home/wanbli/tmp_aur/libadalang/src/libadalang-2020-20200429-19982-src/build/lib/gnat/libadalang.gpr -XBUILD_MODE=prod -XLIBRARY_TYPE=relocatable -XGPR_BUILD=relocatable -XXMLADA_BUILD=relocatable -XLIBADALANG_WARNINGS=true -R -cargs -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -largs -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -gargs:

Command '['gprbuild', '-p', '-j2', '-P/home/wanbli/tmp_aur/libadalang/src/libadalang-2020-20200429-19982-src/build/lib/gnat/libadalang.gpr', '-XBUILD_MODE=prod', '-XLIBRARY_TYPE=relocatable', '-XGPR_BUILD=relocatable', '-XXMLADA_BUILD=relocatable', '-XLIBADALANG_WARNINGS=true', '-R', '-cargs', '-march=x86-64', '-mtune=generic', '-O2', '-pipe', '-fno-plt', '-largs', '-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now', '-gargs']' returned non-zero exit status 4

==> Error: There is error in build().

Cancelling...

Error making: libadalang


Have you ever encountered this error? I am unable to build gnat-gps without this package. Installing huge binary community package from Adacore is OK, but i prefer using AUR together with other Ada packages.