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

liblktlang did not build #659

Closed
tinomai opened this issue Nov 29, 2024 · 5 comments
Closed

liblktlang did not build #659

tinomai opened this issue Nov 29, 2024 · 5 comments

Comments

@tinomai
Copy link

tinomai commented Nov 29, 2024

The liblktlang build part fails with the following error:

Generating source for liblktlang...
Traceback (most recent call last):
  File "/var/tmp/venv/lib/python3.11/site-packages/langkit/libmanage.py", line 691, in run_no_exit
    parsed_args.func(parsed_args, unknown_args)
  File "/var/tmp/venv/lib/python3.11/site-packages/langkit/libmanage.py", line 353, in wrapper
    cb_single(parsed_args)
  File "/var/tmp/venv/lib/python3.11/site-packages/langkit/libmanage.py", line 1167, in do_make
    self.do_generate(args)
  File "/var/tmp/venv/lib/python3.11/site-packages/langkit/libmanage.py", line 796, in do_generate
    self.context.emit()
  File "/var/tmp/venv/lib/python3.11/site-packages/langkit/compile_context.py", line 2090, in emit
    self.run_passes(self.all_passes)
  File "/var/tmp/venv/lib/python3.11/site-packages/langkit/compile_context.py", line 2422, in run_passes
    pass_manager.run(self)
  File "/var/tmp/venv/lib/python3.11/site-packages/langkit/passes.py", line 78, in run
    p.run(context)
  File "/var/tmp/venv/lib/python3.11/site-packages/langkit/passes.py", line 273, in run
    self.pass_fn(context.emitter, context)
  File "/var/tmp/venv/lib/python3.11/site-packages/langkit/emitter.py", line 403, in merge_support_libraries
    error(
  File "/var/tmp/venv/lib/python3.11/site-packages/langkit/diagnostics.py", line 376, in error
    check_source_language(False, message, ok_for_codegen=ok_for_codegen)
  File "/var/tmp/venv/lib/python3.11/site-packages/langkit/diagnostics.py", line 431, in check_source_language
    location = get_current_location()
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/venv/lib/python3.11/site-packages/langkit/diagnostics.py", line 345, in get_current_location
    assert ctx
           ^^^
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/tmp/langkit/contrib/python/./manage.py", line 23, in <module>
    Manage().run()
  File "/var/tmp/venv/lib/python3.11/site-packages/langkit/libmanage.py", line 622, in run
    return_code = self.run_no_exit(argv)
                  ^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/venv/lib/python3.11/site-packages/langkit/libmanage.py", line 717, in run_no_exit
    check_source_language(False, str(e), do_raise=False)
  File "/var/tmp/venv/lib/python3.11/site-packages/langkit/diagnostics.py", line 431, in check_source_language
    location = get_current_location()
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/venv/lib/python3.11/site-packages/langkit/diagnostics.py", line 345, in get_current_location
    assert ctx
           ^^^
AssertionError
Traceback (most recent call last):
  File "/var/tmp/langkit/manage.py", line 435, in <module>
    args.func(args, unknown_args)
  File "/var/tmp/langkit/manage.py", line 135, in wrapper
    fn(args)
  File "/var/tmp/langkit/manage.py", line 343, in make
    assert m1.returncode == 0
           ^^^^^^^^^^^^^^^^^^
AssertionError

The langkit-support part builds fine.

I build langkit with

pip install -r requirements-pypi.txt
pip install .
python3 manage.py make --no-mypy --library-types=static,static-pic,relocatable

This issue affects at least 25.0.0 and master.

@pmderodat
Copy link
Member

Hello,

The assertion failure is clearly a bug in Langkit: we are in the process of fixing it. After the fix, the actual issue is correctly reported:

error: AdaSAT must be checked out at '<langkit_root>/langkit/adasat' or its project file be reachable from the 'GPR_PROJECT_PATH' environment variable in order to build a standalone library.

I suppose you need to follow the following setup step (from the README:

First, clone the adasat repository in the langkit subdirectory of the langkit repository:

$ (cd langkit; git clone https://github.com/AdaCore/adasat)

@pmderodat
Copy link
Member

The assertion failure should be fixed after bc34d8e

I’ll now close this, but please let us know if you still have trouble building Langkit. Thank you for reporting this!

@andrewathalye
Copy link

This isn’t fixed as far as I can tell, I still run in to it just now when building libadalang instead

@pmderodat
Copy link
Member

Sorry, we can’t reproduce. Do you get exactly the same stack trace?

@andrewathalye
Copy link

Yes, exactly the same issue with assert ctx failing in get_current_location

I suspect it’s related to my other issue with adasat not being found properly

There’s probably not much to do from your end, but imo the dependency situation with AdaCore packages and libadalang isn’t ideal, it would be very nice if we could rewire Alire slightly and have it work as a makefile or ninja generator instead.

That’s out of scope though, thanks for trying to reproduce

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

3 participants