8

我已经看到了这个错误的变化,但没有解决方案。

在桌面文件夹 Lubuntu 18.04 上安装 depot_tools。

git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

(显然)解决得很好;PATH 的 mod 很好,没有〜,绝对路径。

$python -V = 2.7.17

/usr/lib 还包含 python3、python3.6、python 3.7 和 python 3.8

调用 gclient sync 或 fetch 返回:

/home/arctos/Desktop/stream/depot_tools/bootstrap_python3: line 32: bootstrap-3.8.0.chromium.8_bin/python3/bin/python3: No such file or directory
/home/arctos/Desktop/stream/depot_tools/bootstrap_python3: line 32: bootstrap-3.8.0.chromium.8_bin/python3/bin/python3: No such file or directory
cat: /home/arctos/Desktop/stream/depot_tools/python3_bin_reldir.txt: No such file or directory
/home/arctos/Desktop/stream/depot_tools/vpython3: line 52: /home/arctos/Desktop/stream/depot_tools/.cipd_bin/vpython3: No such file or directory

检查 bootstrap_python3 显示:

  BOOTSTRAP_PATH="bootstrap-${PYTHON3_VERSION}_bin"

  # Install CIPD packages. The CIPD client self-bootstraps.
  "cipd" ensure -log-level warning -ensure-file "${CIPD_MANIFEST}" \
      -root "$BOOTSTRAP_PATH"

  BOOTSTRAP_PYTHON_BIN="${BOOTSTRAP_PATH}/python3/bin/python3"
  "$BOOTSTRAP_PYTHON_BIN" "bootstrap/bootstrap.py" --bootstrap-name "$BOOTSTRAP_PATH"

因此似乎在尝试设置包含 {PYTHON3_VERSION} 的 BOOTSTRAP_PATH 的地方存在冲突。GCLIENT.PY 包含

# Warn when executing this script with Python 3 when the GCLIENT_PY3 environment
# variable is not set to 1.
# It is an increasingly common error on Windows 10 due to the store version of
# Python.
if (sys.version_info.major >= 3
    and not 'GCLIENT_TEST' in os.environ
    and os.getenv('GCLIENT_PY3') != '1'):
  print('Warning: Running gclient on Python 3. \n'
        'If you encounter any issues, please file a bug on crbug.com under '
        'the Infra>SDK component.', file=sys.stderr)

现在,sys.version_info.major 显示的是 Python 2.7.17,而不是 Python 3。该冲突可能源于 GCLIENT_SMOKETEST_BASE.PY,其中包含

class GClientSmokeBase(fake_repos.FakeReposTestBase):
  def setUp(self):
    super(GClientSmokeBase, self).setUp()
    # Make sure it doesn't try to auto update when testing!
    self.env = os.environ.copy()
    self.env['DEPOT_TOOLS_UPDATE'] = '0'
    self.env['DEPOT_TOOLS_METRICS'] = '0'
    # Suppress Python 3 warnings and other test undesirables.
    self.env['GCLIENT_TEST'] = '1'
    self.env['GCLIENT_PY3'] = '0' if sys.version_info.major == 2 else '1'
    self.maxDiff = None

但我无法确定允许 depot_tools 正确安装/运行的正确修复。

这是一个新错误也毫无价值。两周前的安装很好。

4

0 回答 0