Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 659724 - dev-lang/spark-2017: gnatprove ignores -aP option
Summary: dev-lang/spark-2017: gnatprove ignores -aP option
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Linux ADA team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-01 01:06 UTC by Sergey 'L29Ah' Alirzaev
Modified: 2024-12-31 16:45 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey 'L29Ah' Alirzaev 2018-07-01 01:06:57 UTC
Small reproducer:

‰ cat repro.sh 
#!/bin/sh
mkdir dir1 dir2
cat > dir1/gfxinit.gpr << EOF
with "libhw";
library project gfxinit is
   for Library_Name use "gfxinit";
end gfxinit;
EOF
cat > dir2/libhw.gpr << EOF
library project libhw is
   for Library_Name use "hw";
end libhw;
EOF
cd dir1
gnatprove -Pgfxinit.gpr -aP=../dir2

‰ ./repro.sh 
gnatprove: gfxinit.gpr:1:06: unknown project file: "libhw"

Error while loading project file: gfxinit.gpr
Comment 1 Tupone Alfredo gentoo-dev 2018-07-08 10:07:43 UTC
Does this work with the adacore binary?
Comment 2 Sergey 'L29Ah' Alirzaev 2018-07-08 12:24:31 UTC
I haven't tested it, but another user told me it works fine for him apparently:
> I use the binary spark-gpl-2017 with z3 (theorem prover) of my Linux distribution
Comment 3 Tupone Alfredo gentoo-dev 2018-07-15 14:21:02 UTC
I retested with spark-2018 getting the same error.

If I run 
GPR_PROJECT_PATH=../dir2 gnatprove -aP /home/alfredo/dir2/ -P gfxinit.gpr
I instead get
gnatprove: gfxinit.gpr:2:17: attribute Library_Dir not declared

gnatprove: libhw.gpr:1:17: attribute Library_Dir not declared

Phase 1 of 2: generation of Global contracts ...
gfxinit.gpr:2:17: attribute Library_Dir not declared
libhw.gpr:1:17: attribute Library_Dir not declared
gprbuild: "gfxinit.gpr" processing failed
gnatprove: error during generation of Global contracts

Adding the Library_Dir declaration I finally get:

gnatprove -aP /home/alfredo/dir2/ -P gfxinit.gpr
Phase 1 of 2: generation of Global contracts ...
Phase 2 of 2: flow analysis and proof ...
warning: no bodies have been analyzed by GNATprove
enable analysis of a body using SPARK_Mode

So it is only a misleading error message
Comment 4 Tupone Alfredo gentoo-dev 2018-07-15 14:24:57 UTC
No. -aP does not work :(
I had  GPR_PROJECT_PATH in the environment
Comment 5 Tupone Alfredo gentoo-dev 2018-07-16 06:37:23 UTC
Raised an issue upstream
https://github.com/AdaCore/spark2014/issues/4
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-12-31 16:45:52 UTC
I'm assuming this is fixed in spark-2021 given the upstream bug is closed (admittedly with them unable to repro anymore).