sdk_stages: Don't pass empty command in SDKTest
When creating the new-sdk-chroot, SDKTest runs a chroot command that
doesn't actually run a command. It relies on the side effect of
cros_sdk creating the chroot before running the non-existent command.
The empty command results in entering the chroot and running bash. On
the builders where stdin isn't attached to a terminal, bash immediately
exits and this succeeds. On local builds, this causes the tryjob to
hang inside the chroot because stdin is normally attached to a tty.
Instead of running no command, run /bin/true to get the same
chroot-creation effect without any dependence on stdin's status.
BUG=chromium:837330
TEST=cros tryjob --local chromiumos-sdk-tryjob
Change-Id: I835920a7bf66437cbab0d49e0162723114e894a8
Reviewed-on: https://chromium-review.googlesource.com/1071877
Commit-Ready: Benjamin Gordon <bmgordon@chromium.org>
Tested-by: Benjamin Gordon <bmgordon@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/cbuildbot/stages/sdk_stages.py b/cbuildbot/stages/sdk_stages.py
index 216475c..33bc080 100644
--- a/cbuildbot/stages/sdk_stages.py
+++ b/cbuildbot/stages/sdk_stages.py
@@ -283,8 +283,8 @@
chroot_args = new_chroot_args + ['--download', '--replace', '--nousepkg',
'--url', 'file://' + tarball_location]
cros_build_lib.RunCommand(
- [], cwd=self._build_root, enter_chroot=True, chroot_args=chroot_args,
- extra_env=self._portage_extra_env)
+ ['true'], cwd=self._build_root, enter_chroot=True,
+ chroot_args=chroot_args, extra_env=self._portage_extra_env)
# Inject the toolchain binpkgs from the previous sdk build. On end user
# systems, they'd be fetched from the binpkg mirror, but we don't have one