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

Unable to run gnatprove on projects importing GNATCOLL #98

Open
docandrew opened this issue Jan 7, 2025 · 2 comments
Open

Unable to run gnatprove on projects importing GNATCOLL #98

docandrew opened this issue Jan 7, 2025 · 2 comments
Assignees

Comments

@docandrew
Copy link

I'm using Alire to import the GNATCOLL database libraries, which depend on GNATCOLL Core. However, the GNATCOLL crate has a dependency on libgpr which appears to prevent gnatprove from working.

This can be reproduced with:

alr init --bin testcase
alr with gnatcoll
alr with gnatprove
# edit main subprogram to add "with SPARK_Mode"
alr build
alr gnatprove

Phase 1 of 3: generation of data representation information ...
generation of data representation information failed
continuing analysis with partial data representation
for details, see log file gnatprove/data_representation_generation.log
Phase 2 of 3: generation of Global contracts ...

gpr-err-scanner.adb:2421:15: error: choice given in case statement is not static
 2421 |         when Name_Abort =>
      |              ^~~~~~~~~~

gpr-err-scanner.adb:2421:15: error: "Name_Abort" is not a static constant (RM 4.9(5))
 2421 |         when Name_Abort =>
      |              ^~~~~~~~~~

gpr-err-scanner.adb:2423:15: error: choice given in case statement is not static
 2423 |         when Name_Abs =>
      |              ^~~~~~~~
...
<many more lines>

One solution may be to disable SPARK_Mode on libgpr, alternatively a solution to either skip imported project or exclude specific project files when calling gnatprove might be useful.

Relevant forum threads:

@docandrew
Copy link
Author

Also worth noting I've been able to reproduce this on both Windows and Linux.

@Nikokrock
Copy link
Collaborator

We have started separating gnatcoll-core in several projects, you should depends only on gnatcoll_core.gpr rather than gnatcoll.gpr and this will remove the need for project support and thus libgpr dep

@Nikokrock Nikokrock self-assigned this Jan 9, 2025
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