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

Error while running bootstrap #93

Closed wnklmnn closed 3 years ago

wnklmnn commented 3 years ago

Hi, I just tried to bootstrap gprbuild on my debian system and ran into the following issue:

da/schema -I../xmlada/unicode -I../xmlada/input_sources -I- /home/wnklmnn/Dokumente/ada/gprbuild/gpr/src/gpr-compilation-sync.adb
gpr-compilation-protocol.adb:982:13: "time_t" is undefined
x86_64-linux-gnu-gcc-8 -c -I./ -I/home/wnklmnn/Dokumente/ada/gprbuild/src -I/home/wnklmnn/Dokumente/ada/gprbuild/gpr/src -I../xmlada/sax -I../xmlada/dom -I../xmlada/schema -I../xmlada/unicode -I../xmlada/input_sources -I- /home/wnklmnn/Dokumente/ada/gprbuild/gpr/src/gpr-com.ads
gnatmake: "/home/wnklmnn/Dokumente/ada/gprbuild/gpr/src/gpr-compilation-protocol.adb" compilation error

This seems to be the commit that introduced the issue for me. https://github.com/AdaCore/gprbuild/commit/3740defff8806286c1391159497a3992ddf701ed

If I checkout the version befor this commt i was able to bootstrap succesfully.

I would fix this but I dont not know any ada :(

steve-cs commented 3 years ago

Building gprbuild development source currently expects a newer version of gcc that includes https://github.com/gcc-mirror/gcc/commit/c70220382300ae326ad63fe54c5a32da202d1f13 in libgnat.

Possible fixes for you that don't require Ada knowledge include:

It depends what you're trying to accomplish.

anisimkov commented 3 years ago

If you need bootstrap only, you can use GNAT Community 2020 to do it.

wnklmnn commented 3 years ago

Thanks for the fast responses. I'll try to add some context. I was trying to bootstrap gprbuild with nixos (with gcc .9.30) and stumbled upon my issue. So I tried the same step on my debian (with gc 8.3.0) machine and faced the same issue.

On debain i was able to bootstrap gprbuild after using a version of gprbuild without the mentioned commit. On nixos I additionally had to change to shebang in the bootstrap.sh to point to the correct location of bash. Unfortunately I still am unable to bootstrap fully.

For some reason it tries to use gprinstall located under exe/production on bootstrap.sh I specified the prefix to be out.

install flags: SHELL=/nix/store/a3fc4zqaiak11jks9zd579mz5v0li8bg-bash-4.4-p23/bin/bash install
exe/production/gprinstall -p -f --target=x86_64-unknown-linux-gnu  --prefix=/nix/store/zkaq7gnyx24v5j229z8bzlgkj33a2gag-gnat-9.3.0/bin/.. -XBUILD=production --mode=usage --install-name=gprbuild \
        -XINSTALL_MODE=nointernal gprbuild.gpr
/nix/store/a3fc4zqaiak11jks9zd579mz5v0li8bg-bash-4.4-p23/bin/bash: exe/production/gprinstall: No such file or directory
make: *** [Makefile:124: install] Error 127
note: keeping build directory '/tmp/nix-build-gprbuild.drv-3'
builder for '/nix/store/k660p0sxspydbl1fs450660ya68nvhid-gprbuild.drv' failed with exit code 2
cannot build derivation '/nix/store/3n2nq1j63kxfv6mxb6y5p024mn7xmwvm-gtkada.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/0i6v09sf1rc3ibmb63jhry8p5n1dxicf-gps.drv': 1 dependencies couldn't be built
error: build of '/nix/store/0i6v09sf1rc3ibmb63jhry8p5n1dxicf-gps.drv' failed

If I change this line in the Makefile INSTALLER=exe/$(BUILD)/$(LIB_INSTALLER) to this INSTALLER=out/bin/$(LIB_INSTALLER) I now run face the issue that gprbuild cant import the file xmlada.gpr.

installing
install flags: SHELL=/nix/store/a3fc4zqaiak11jks9zd579mz5v0li8bg-bash-4.4-p23/bin/bash install
out/bin/gprinstall -p -f --target=x86_64-unknown-linux-gnu  --prefix=/nix/store/zkaq7gnyx24v5j229z8bzlgkj33a2gag-gnat-9.3.0/bin/.. -XBUILD=production --mode=usage --install-name=gprbuild \
        -XINSTALL_MODE=nointernal gprbuild.gpr
gprbuild.gpr:19:06: imported project file "xmlada.gpr" not found
gpr.gpr:19:06: imported project file "xmlada" not found
gpr.gpr:19:06: imported by "/build/gprbuild-11fbc51/gpr/gpr.gpr"
gpr.gpr:19:06: imported by "/build/gprbuild-11fbc51/gprbuild.gpr"
gprinstall: "gprbuild.gpr" processing failed
make: *** [Makefile:124: install] Error 4
builder for '/nix/store/biskh7zc3yqwp1rng6plg5cv971xd8jz-gprbuild.drv' failed with exit code 2
cannot build derivation '/nix/store/wsw5l27a5nxyr203072pb659d4mzm0zl-gtkada.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/i6p67a63pbl6ivgpbilqhpzcx0as29av-gps.drv': 1 dependencies couldn't be built
error: build of '/nix/store/i6p67a63pbl6ivgpbilqhpzcx0as29av-gps.drv' failed

At this point I run into a wall again. I suspect that there is something wrong with my nix-derivation. it would be greate if anyone has an idea what would resolve this.

But since this is rather Nix-specific I guess this gh-issue is not the right place :)

Edit: If anyone has access to nix these are my first step in creating the derivation.

steve-cs commented 3 years ago

Please see some pointers and commentary in Issue https://github.com/AdaCore/gprbuild/issues/83 from the last time NixOS people showed up that might be of some help.