AdaCore / gprbuild

GPRbuild is an advanced build system designed to help automate the construction of multi-language systems.
Other
65 stars 21 forks source link

Msys2: gprbuild bootstrap.sh issue, gnatbind errors with elaboration circularity detected. #74

Closed nthcomputing closed 4 years ago

nthcomputing commented 4 years ago

Hi, Using newest msys2 version in Windows 10 1903 with Msys2 provided FSF GCC 9.2 compiler, looks like the msys2 gprbuild package was removed a couple of years ago (I haven't updated in about two years, it used to be there). I'm compiling in 32bit mode (x86) by using and x86 msys2 console.

So I decide to build it myself.

Git cloned xmlada and gprbuild from github, then went inside gprbuild directory, issued:

./bootstrap.sh --with-xmlada=../xmlada --prefix=./bootstrap

Starts compiling files, gets to the gnatbind stage and errors with convoluted elaboration issue, I spent some time on it but it wasn't easy to fix. Handling off to the people that know more than me.

gnatbind -IC:/Users/joshk/Downloads/gprbuild/src -IC:/Users/joshk/Downloads/gprbuild/gpr/src -I../xmlada/sax -I../xmlada/dom -I../xmlada/schema -I../xmlada/unicode -I../xmlada/input_sources -x gprbuild-main.ali error: elaboration circularity detected info: "gpr_build_util (body)" must be elaborated before "gpr.util (body)" info: reason: implicit Elaborate_All in unit "gpr.util (body)" info: recompile "gpr.util (body)" with -gnatel for full details info: "gpr_build_util (body)" info: must be elaborated along with its spec: info: "gpr_build_util (spec)" info: which is withed by: info: "gpr.util (body)" info: which must be elaborated along with its spec: info: "gpr.util (spec)" info: which is withed by: info: "gpr.opt (spec)" info: which is withed by: info: "gpr (body)" info: which must be elaborated along with its spec: info: "gpr (spec)" info: which is withed by: info: "gpr.names (spec)" info: which is withed by: info: "gpr.util (body)"

info: "gpr.com (spec)" must be elaborated before "gpr_build_util (body)" info: reason: with clause

info: "gpr.util (body)" must be elaborated before "gpr.com (spec)" info: reason: implicit Elaborate_All in unit "gpr.com (spec)" info: recompile "gpr.com (spec)" with -gnatel for full details info: "gpr.util (body)" info: must be elaborated along with its spec: info: "gpr.util (spec)" info: which is withed by: info: "gpr.opt (spec)" info: which is withed by: info: "gpr (body)" info: which must be elaborated along with its spec: info: "gpr (spec)" info: which is withed by: info: "gpr.osint (spec)" info: which is withed by: info: "gpr.com (spec)"

gnatmake: *** bind failed.

Please see if this can be resolved as I don't receive any compilation errors before hand. I cannot continue development on Msys2 because I guess they don't provide full Ada support anymore, so we need to build these binaries to get back our GPR support.

Thanks

nthcomputing commented 4 years ago

As an update, since I saw no movement on my issue, I performed a quick git bisect in hopes the damage was done recently, I got lucky...the damage was done very recently! If I'm reading his right, the most recent commit broke this functionality.

last good commit to successfully build on Msys2 GCC 9.2 was: 007b8aea6d6a171d7552c48ccf2cf09d53032cb5 gprbuild_ug/gnat_project_manager.rst: fix the ** pattern example

nthcomputing commented 4 years ago

Yep, I've been compiling Ada code with gprbuild project files with no issues all day today on Msys2. The commit I linked to 007b8aea6d6a171d7552c48ccf2cf09d53032cb5 built gprbuild via bootstrap just fine.

You don't give any info on your error, was it the same elaboration error I posted? Please be more specific on your request, I may be able to help but yeah, I posted the comment because it really did work for me. Though, I've seen nothing from the devs on fixing the actual issue going forward (so it's short-term solution right now).

ComaEcho commented 4 years ago

I use suse-linux, bootstrap.sh tells 'error: elaboration circularity detected' and the infoes like yours. I tried the commit above, but didn't work. However, I don't really need it to program, but to build the gtkada for ada's GUI ,instead of Qt. Gnat is enough for me without GUI. Maybe I'll try again later.

nthcomputing commented 4 years ago

Ah, You're on a completely different platform. I specified Msys2 Shell via Windows 10, not even on a Linux distro.

I'd recommend you try to git bisect like I did, go back in time until it works (hopefully). I find it odd that SUSE does't have this in its packaging system. But I'm a Debian user due to this and many other FSF conformant reasons.

I found these instructions (didn't really read them) for GTKADA installation on SUSE, perhaps this will get you somewhere: https://github.com/Blunk-electronic/M-1/blob/master/SW/gtkada_install.txt

anisimkov commented 4 years ago

Looks like the last commit "Fix errors with --implicit-with= parameter" fixed this issue. I tried GCC 7 with Ada on OpenSUSE 15.0. I saw the problem before the commit and did not see it after.

nthcomputing commented 4 years ago

Thank you for getting on this issue. I'll have to confirm at my end before I close this out.

nthcomputing commented 4 years ago

Yes, the lastest pull is now working for me in msys2.