Ada gprbuild在初始化时挂起

时间:2017-09-19 16:45:57

标签: ada gnat

我不知道为什么突然间我的gprbuild卡住了。这是复制我所看到的非常直接的方式:

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

执行后的文件内容:

测试/ 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;

结果是没有任何输出,并且必须用^ C杀死该过程。

我使用-v标志再次运行它,发现它挂在了gprconfig --batch -o /some/directory/src/build/GNAT-TEMP-000001.TMP --target=x86_64-linux --config=ada,,上。 env的结果是:

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

我想知道我的GPR安装是否有问题?或者我的环境变量。

1 个答案:

答案 0 :(得分:0)

事实证明问题是我的PATH太多了。 gprbuild正在浏览所有目录并尝试一些长时间运行的命令来查看它们是否是正确的编译器。

感谢Jean-FrançoisFabre提出建议。