Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building as in build.md fails #1213

Open
simonjwright opened this issue Oct 12, 2024 · 4 comments
Open

Building as in build.md fails #1213

simonjwright opened this issue Oct 12, 2024 · 4 comments

Comments

@simonjwright
Copy link
Contributor

macOS Sequoia 15.0.1, arm64.
GCC 14.2.0 (but see below)

The build failed (see below), so I created integration/vscode/ada/arm64/darwin by hand (I presume it would have happened automatically if the build had succeeded?).

The macOS build assumes it’s running on a workflow, so it tests $RUNNER_OS for macOS. I set it by hand.

The first build failure happened with the toolchain selecting gnat_external 14.2.0:

+ alr exec make -- VERSION= check
alr build -- -XVERSION= -XBUILD_DATE= -m -j0 
ERROR: Trying to set an already defined environment variable:
ERROR:    GNATCOLL_ICONV_ALIRE_PREFIX is already defined as
'/Users/simon/.local/share/alire/builds/gnatcoll_iconv_24.0.0_e90c5b4d/1154afd8dfb66c421cc7685cef5084404b77ddbd8e630b96ffd473827472b613' 
but new value is 
'/Users/simon/.local/share/alire/builds/gnatcoll_iconv_24.0.0_e90c5b4d/28af3b2569f112385848f68796844a7f805ae355c77ca942518966490616e05a'
make: *** [all] Error 1
ERROR: Command ["make", "VERSION=", "check"] exited with code 2

In case it was a toolchain issue, I deleted gnatcoll_iconv_24.0.0_e90c5b4d/ and selected gnat_native 14.2.1: same failure,

+ alr exec make -- VERSION= check
alr build -- -XVERSION= -XBUILD_DATE= -m -j0 
ERROR: Trying to set an already defined environment variable:
ERROR:    GNATCOLL_ICONV_ALIRE_PREFIX is already defined as 
'/Users/simon/.local/share/alire/builds/gnatcoll_iconv_24.0.0_e90c5b4d/83e37259a8a4195815f07097d699762f3496bc4a37792463d7afacc801362451' 
but new value is 
'/Users/simon/.local/share/alire/builds/gnatcoll_iconv_24.0.0_e90c5b4d/a7288f541c5173a48e4c7f07645bb184d59aeda3343cdf2e9b0cc60fda0e7154'
make: *** [all] Error 1
ERROR: Command ["make", "VERSION=", "check"] exited with code 2

The build directory gnatcoll_iconv_24.0.0_e90c5b4d contains 21 directories, all created since I deleted the parent, including a7288f5 but not including 83e3725.

@reznikmm
Copy link
Member

Hi @simonjwright !
Thank you for trying our new build script.
Did you run

alr settings --global --set dependencies.shared false

?

Can you remove (or temporary move/rename) /Users/simon/.local/share/alire/builds and /Users/simon/.local/share/alire/releases?

@simonjwright
Copy link
Contributor Author

I didn’t spot the --set dependencies.shared false.
I’ve done both of your suggestions, and now have different failures.

Note: Running pre-build actions for libadalang=24.0.0...
[...]
++ MYPYPATH=/Users/simon/Developer/ada_language_server/subprojects/langkit_support/contrib/python/build/python:/Users/simon/Developer/ada_language_server/subprojects/langkit_support/contrib/lkt/build/python:
++ export MYPYPATH
+ pip install -r REQUIREMENTS.dev
ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'REQUIREMENTS.dev'
[...]
+ python manage.py generate
__init__.py:374: error: dlopen(liblktlang.dylib, 0x0006): Library not loaded: @rpath/libgnatcoll_iconv.dylib
      Referenced from: <7CA777B1-072F-3B8C-9FAD-29608EE539A7> /Users/simon/Developer/ada_language_server/subprojects/langkit_support/contrib/lkt/build/lib/relocatable/dev/liblktlang.dylib
      Reason: tried: '/Users/simon/Developer/ada_language_server/subprojects/langkit_support/contrib/python/build/lib/relocatable/dev/libgnatcoll_iconv.dylib' (no such file),
[... etc etc]

Now, I have

venv) ramoth:ada_language_server simon$ find . -name libgnatcoll_iconv.dylib
./alire/cache/dependencies/gnatcoll_iconv_24.0.0_e90c5b4d/iconv/lib/relocatable/libgnatcoll_iconv.dylib

and I have 2 similar references in the [etc etc] above,

@executable_path/../../../../../../../..//alire/cache/dependencies/gnatcoll_iconv_24.0.0_e90c5b4d/iconv/lib/relocatable/libgnatcoll_iconv.dylib
@executable_path/../../../../../../../..//alire/cache/dependencies/gnatcoll_iconv_24.0.0_e90c5b4d/iconv/lib/relocatable/libgnatcoll_iconv.dylib

(in fact they’re the same).
Now, that should have worked if @executable_path is the directory in which the loading dylib is found (/Users/simon/Developer/ada_language_server/subprojects/langkit_support/contrib/lkt/build/lib/relocatable/dev/liblktlang.dylib), disregarding any possible effect of the //, but the library’s envoked via dlopen(), so what’s @executable_path?

I’m wondering what’s different about how I build libadalang in the compiler packages I distribute :-(

@reznikmm
Copy link
Member

I guess this is because libadalang team changes something in the build procedure. I suggest you to build ALS 25.0.20240915 until we fix our script. To do this, create deps.txt file before running build_als.sh:

cd ada_language_server
git checkout 25.0.20240915
git show 25.0.20240915 |grep '^[a-zA-Z-]*=' > deps.txt
python -m venv venv
source venv/bin/activate
./scripts/build_als.sh

reznikmm added a commit to reznikmm/ada_language_server that referenced this issue Oct 21, 2024
Also
* use Alire 2.0.2
* fix `pip install` error on istalling libadalang dependencies.

Refs
* AdaCore#1212
* AdaCore#1213

Fixes ada_language_server#1471
adacore-bot pushed a commit that referenced this issue Oct 22, 2024
Also
* use Alire 2.0.2
* fix `pip install` error on istalling libadalang dependencies.

Refs
* #1212
* #1213

Fixes ada_language_server#1471
@simonjwright
Copy link
Contributor Author

I’m still pursuing this, with many difficulties with the Alire compiler download vs. my local build, and gprconfig/linker.xml using @executable_path vs. @loader_path (that seems to have been a red herring).

Now using my local compiler and 25.0.20241014 with your suggestion for deps.txt; liblktlang.dylib builds OK, but

[...]
lal_refactor.ads:65:66: error: possible interpretation at laltools-common.ads:59
lal_refactor.ads:65:66: error: possible interpretation at langkit_support-slocs.ads:90
lal_refactor.ads:65:66: error: ambiguous expression (cannot resolve "<")
lal_refactor.ads:65:66: error: possible interpretation at laltools-common.ads:59
lal_refactor.ads:65:66: error: possible interpretation at langkit_support-slocs.ads:90
lal_refactor.ads:65:66: error: ambiguous expression (cannot resolve "<")
lal_refactor.ads:65:66: error: possible interpretation at laltools-common.ads:59
lal_refactor.ads:65:66: error: possible interpretation at langkit_support-slocs.ads:90
lal_refactor.ads:65:66: error: ambiguous expression (cannot resolve "<")
lal_refactor.ads:65:66: error: possible interpretation at laltools-common.ads:59
lal_refactor.ads:65:66: error: possible interpretation at langkit_support-slocs.ads:90
lal_refactor.ads:65:66: error: ambiguous expression (cannot resolve "<")
lal_refactor.ads:65:66: error: possible interpretation at laltools-common.ads:59
lal_refactor.ads:65:66: error: possible interpretation at langkit_support-slocs.ads:90
lal_refactor.ads:65:66: error: ambiguous expression (cannot resolve "<")
lal_refactor.ads:65:66: error: possible interpretation at laltools-common.ads:59
lal_refactor.ads:65:66: error: possible interpretation at langkit_support-slocs.ads:90

   compilation of lsp-ada_driver.adb failed
   compilation of lal_refactor-subprogram_signature-change_parameters_type.adb failed
   compilation of lal_refactor-auto_import.adb failed
   compilation of lal_refactor-suppress_separate.adb failed
   compilation of lal_refactor-tools-array_aggregates_tool.adb failed
   compilation of lal_refactor-tools.adb failed

gprbuild: *** compilation phase failed
ERROR: Command ["gprbuild", "-s", "-j0", "-p", "-P", "/Users/simon/Developer/adacore/ada_language_server/gnat/lsp_server.gpr", "-XVERSION=", "-XBUILD_DATE=", "-m", "-j0"] exited with code 4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants