basel-real 存在,但是当我运行 basel 时,它显示“没有这样的文件或目录”

basel-real 存在,但是当我运行 basel 时,它显示“没有这样的文件或目录”

我按照以下指南下载并安装了 basel,安装程序链接为https://github.com/bazelbuild/bazel/releases/download/0.2.0/bazel-0.2.0-installer-linux-x86_64.sh

安装后,当我运行 basel 时,输出是:

/usr/local/bin/bazel: line 86: /usr/local/lib/bazel/bin/bazel-real: No such file or directory

“/usr/local/bin/bazel”的第 86 行是:

exec -a "$0" "${BAZEL_REAL}" "$@"

/usr/local/lib/bazel/bin/bazel-real存在:

ll /usr/local/lib/bazel/bin/bazel-real
-rwxr-xr-x 1 root root 103M Jan  1  1980 /usr/local/lib/bazel/bin/bazel-real

file /usr/local/lib/bazel/bin/bazel-real
/usr/local/lib/bazel/bin/bazel-real: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[md5/uuid]=51e0bd3d3319cc75ae66be80be63ac4e, not stripped

LDD

ldd /usr/local/lib/bazel/bin/bazel-real     
    not a dynamic executable

我的Linux版本:

uname -r
4.4.0-x86_64-linode63

答案1

由于我无法在 Trusty Tahr 上重现您的问题,而且事实上我安装 bazel 时完全没有问题,因此我将在此给出我制作工作副本所采取的步骤。希望在阅读本文时,您可以发现自己可能出错的地方...

先决条件:

bazel 目前仅在 Trusty Tahr 和 Wily Werewolf 上获得官方支持,并且两者的先决条件略有不同:

  1. Trusty Tahr 上 OpenJDK 8 不可用,可以从此 PPA 安装:

    sudo add-apt-repository ppa:webupd8team/java
    sudo apt-get update
    sudo apt-get install oracle-java8-installer
    
  2. 在 Wily Werewolf 中你将需要以下物品:

    sudo apt-get install openjdk-8-jdk pkg-config zip g++ zlib1g-dev unzip
    

请注意,我只在 Trusty Tahr 上进行了测试...

建筑:

然后为任一 Ubuntu 版本创建一个构建目录并将安装文件下载到其中:

mkdir $HOME/Desktop/bazel_build && cd $HOME/Desktop/bazel_build
wget https://github.com/bazelbuild/bazel/releases/download/0.2.0/bazel-0.2.0-installer-linux-x86_64.sh

设置权限然后安装为默认/usr/local

chmod +x bazel-0.2.0-installer-linux-x86_64.sh
sudo ./bazel-0.2.0-installer-linux-x86_64.sh

测试:

然后运行bazel如下:

andrew@corinth:~$ /usr/local/bin/bazel version
Build label: 0.2.0
Build target: bazel-out/local_linux-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Feb 23 13:08:29 2016 (1456232909)
Build timestamp: 1456232909
Build timestamp as int: 1456232909

希望您在观察这个无故障安装时能够发现自己的构建中的任何缺陷......

参考:

相关内容