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

Cannot build langkit #235

Closed
Lucretia opened this issue Nov 5, 2019 · 2 comments
Closed

Cannot build langkit #235

Lucretia opened this issue Nov 5, 2019 · 2 comments

Comments

@Lucretia
Copy link

Lucretia commented Nov 5, 2019

With GCC-7.4.0 using these GNATColl commit ID's

$ cd langkit
$ export PYTHONPATH=$(pwd)
$ python2.7 scripts/build-langkit_support.py generate
$ python2.7 scripts/build-langkit_support.py --library-types relocatable build --build-mode=prod --gargs="-R"
Setup
   [mkdir]        object directory for project Langkit_Support
   [mkdir]        library directory for project Langkit_Support
Compile
   [Ada]          langkit_support-vectors.adb
   [Ada]          langkit_support-lexical_env.adb
   [Ada]          langkit_support-tree_traversal_iterator.adb
   [Ada]          langkit_support-token_data_handlers.adb
   [Ada]          langkit_support-symbols.adb
   [Ada]          langkit_support-adalog-unify_one_side.adb
   [Ada]          langkit_support-adalog-operations.adb
   [Ada]          langkit_support-adalog-abstract_relation.adb
   [Ada]          langkit_support.ads
   [Ada]          langkit_support-types.ads
   [Ada]          langkit_support-text.adb
   [Ada]          langkit_support-slocs.adb
   [Ada]          langkit_support-relative_get.adb
   [Ada]          langkit_support-packrat.adb
   [Ada]          langkit_support-iterators.adb
   [Ada]          langkit_support-images.adb
   [Ada]          langkit_support-hashes.adb
   [Ada]          langkit_support-diagnostics.adb
   [Ada]          langkit_support-cheap_sets.adb
   [Ada]          langkit_support-bump_ptr.adb
   [Ada]          langkit_support-bump_ptr-vectors.adb
   [Ada]          langkit_support-boxes.adb
   [Ada]          langkit_support-array_utils.adb
   [Ada]          langkit_support-adalog.ads
   [Ada]          langkit_support-adalog-unify_lr.adb
   [Ada]          langkit_support-adalog-unify.adb
   [Ada]          langkit_support-adalog-relations.adb
   [Ada]          langkit_support-adalog-pure_relations.adb
   [Ada]          langkit_support-adalog-predicates.adb
   [Ada]          langkit_support-adalog-main_support.adb
   [Ada]          langkit_support-adalog-logic_var.ads
   [Ada]          langkit_support-adalog-logic_ref.adb
   [Ada]          langkit_support-adalog-eq_same.adb
   [Ada]          langkit_support-adalog-debug.adb
langkit_support-adalog-eq_same.ads:126:14: implicit conversion of anonymous access value not allowed
langkit_support-adalog-eq_same.ads:126:14: implicit conversion of anonymous access value not allowed

   compilation of langkit_support-adalog-eq_same.adb failed
   compilation of langkit_support-adalog-main_support.adb failed

gprbuild: *** compilation phase failed
Build failed: error while running gprbuild -p -j8 -Pbuild/lib/gnat/langkit_support.gpr -XBUILD_MODE=prod -XLIBRARY_TYPE=relocatable -XGPR_BUILD=relocatable -XXMLADA_BUILD=relocatable -R:
    Command '['gprbuild', '-p', '-j8', '-Pbuild/lib/gnat/langkit_support.gpr', '-XBUILD_MODE=prod', '-XLIBRARY_TYPE=relocatable', '-XGPR_BUILD=relocatable', '-XXMLADA_BUILD=relocatable', '-R']' returned non-zero exit status 4
@Lucretia
Copy link
Author

Lucretia commented Nov 5, 2019

Requires a simple patch to fix:

--- a/langkit/support/langkit_support-adalog-eq_same.ads
+++ b/langkit/support/langkit_support-adalog-eq_same.ads
@@ -123,7 +123,7 @@ package Langkit_Support.Adalog.Eq_Same is
          Eq_Data   : Equals_Data;
          Sloc_Info : String_Access := null) return Relation
       is
-        (Impl.Equals (L, R, Data, Eq_Data, Sloc_Info));
+        (Relation (Impl.Equals (L, R, Data, Eq_Data, Sloc_Info)));
 
       function Create
         (L         : LR_Type;

pmderodat added a commit to pmderodat/langkit that referenced this issue Nov 5, 2019
Some versions of GNAT are known to complain about these and anyway they
are almost never correct: they are supposed to return an allocation
whose lifetime is bound to the caller's whereas we generally return
allocations whose lifetime is not statically known.

Just replace these anonymous access types with named access types,
creating some if needed. Behavior should not change.

For GitHub issue AdaCore#235
pmderodat added a commit that referenced this issue Nov 12, 2019
Some versions of GNAT are known to complain about these and anyway they
are almost never correct: they are supposed to return an allocation
whose lifetime is bound to the caller's whereas we generally return
allocations whose lifetime is not statically known.

Just replace these anonymous access types with named access types,
creating some if needed. Behavior should not change.

For GitHub issue #235
@pmderodat
Copy link
Member

This should be fixed on the master branch. Thanks for reporting this issue!

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