I have no idea why suddenly my gprbuild is getting stuck. Here's a pretty straightforward way to replicate what I'm seeing:
mkdir test
mkdir build
printf 'with Ada.Text_IO; use Ada.Text_IO;\nprocedure Main is begin Put_Line ("Hello, World!"); end Main;' > test/main.adb
printf 'project Test is\n for Source_Dirs use ("test");\n for Object_Dir use "build";\n for Exec_Dir use ".";\n for Main use ("main.adb");\n package Builder is\n for Executable ("main.adb") use "host";\n end Builder;\nend Test;' > test.gpr
gprbuild -Ptest # This hangs forever
Contents of files after executing:
test/main.adb
with Ada.Text_IO; use Ada.Text_IO;
procedure Main is begin Put_Line ("Hello, World!"); end Main;
test.gpr
project Test is
for Source_Dirs use ("test");
for Object_Dir use "build";
for Exec_Dir use ".";
for Main use ("main.adb");
package Builder is
for Executable ("main.adb") use "host";
end Builder;
end Test;
The result is no output whatsoever and the process has to be killed with ^C.
I ran it again with the -v
flag and found that it hanged on gprconfig --batch -o /some/directory/src/build/GNAT-TEMP-000001.TMP --target=x86_64-linux --config=ada,,
. The results of env
are:
HADOOP_LOG_DIR=/tmp/hadoop/log
LANG=en_CA.utf8
DISPLAY=:0
COLORTERM=truecolor
LCLIMPORTDIR=/usr/share/splint/imports
MOZ_PLUGIN_PATH=/usr/lib/mozilla/plugins
HADOOP_SLAVES=/etc/hadoop/slaves
TERMINAL=xfce4-terminal
XDG_VTNR=1
XDG_SESSION_ID=c1
USER=user
GRADLE_HOME=/usr/share/java/gradle
PWD=/home/user
HOME=/home/user
HADOOP_CONF_DIR=/etc/hadoop
SPARK_HOME=/opt/apache-spark
arch=x86_64
MAIL=/var/spool/mail/user
VISUAL=gvim
WINDOWPATH=1
TERM=xterm-termite
SHELL=/bin/bash
VTE_VERSION=4803
HADOOP_PID_DIR=/tmp/hadoop/run
XDG_SEAT=seat0
SHLVL=3
WINDOWID=71303171
LOGNAME=user
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
XDG_RUNTIME_DIR=/run/user/1000
XAUTHORITY=/home/user/.Xauthority
ANT_HOME=/usr/share/apache-ant
LARCH_PATH=/usr/share/splint/lib
PATH=/home/user/bin:/usr/lib/hardening-wrapper/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/opt/android-sdk/platform-tools:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/user/.gem/ruby/2.4.0/bin
_=/usr/bin/env
I'm wondering if something is wrong with my GPR install? or perhaps my environment variables.
It turns out the problem was having too much in my PATH. gprbuild was looking through all the directories and trying some long running commands to see if they were the correct compilers.
Thanks to Jean-François Fabre for suggesting it.