fresh-cat-90827
08/20/2021, 3:32 PMchrootfresh-cat-90827
08/20/2021, 3:32 PMWhen Pants runs most processes, it runs in a chroot (temporary directory). Usually, this gets cleaned up after the Process finishes. You can instead run ./pants --no-process-execution-local-cleanup, which will keep around the folder.The plugin I work on (building a Debian package) is run itself as
chrootProcesschrootdpkg-deb--no-process-execution-local-cleanup__run.sh./pants package //:sample-debian-package --no-process-execution-local-cleanupstdout:
dpkg-deb: building package 'sample-debian-package' in 'sample-debian-package.deb'.
stderr:
dpkg-deb (subprocess): unable to execute tar -cf (tar): No such file or directory
dpkg-deb: error: tar -cf subprocess returned error exit status 2chrootdpkg-debdpkg-debchrootProcesschrootfast-nail-55400
08/20/2021, 3:38 PMtarfast-nail-55400
08/20/2021, 3:39 PMdpkg-deb (subprocess): unable to execute tar -cf (tar): No such file or directorytarfresh-cat-90827
08/20/2021, 3:42 PMdoes tar need to be available in the chroot setup by Pants?I wish I knew how to check that 🙂
fresh-cat-90827
08/20/2021, 3:43 PMtardpkg-debtar$PATHfast-nail-55400
08/20/2021, 3:52 PMfast-nail-55400
08/20/2021, 3:54 PMfast-nail-55400
08/20/2021, 3:55 PMdpkg-debhundreds-father-404
08/20/2021, 3:55 PMenvfirst_pathenough-analyst-54434
08/20/2021, 4:12 PMchrootfresh-cat-90827
08/20/2021, 7:06 PMtar_binary_path = await find_tar()
print({"PATH": tar_binary_path.path})19:01:01.47 [INFO] stdout: "{'PATH': '/usr/bin/tar'}"
19:01:01.47 [INFO] stdout: "\n"stderr:
dpkg-deb (subprocess): unable to execute tar -cf (tar): Not a directory
dpkg-deb: error: tar -cf subprocess returned error exit status 2env={"PATH": tar_binary_path.path},Process()$PATHfresh-cat-90827
08/20/2021, 7:07 PM"{'PATH': '/usr/bin'}"fresh-cat-90827
08/20/2021, 7:08 PMpathlibPath(tar_binary_path.path).<http://parent.as|parent.as>_posix()fresh-cat-90827
08/20/2021, 7:08 PM'/usr/bin/tar''/usr/bin'hundreds-father-404
08/20/2021, 7:17 PMPathstr(PurePath(tar_binary_path.path).parent)tar_binary_path = await find_tar()Instead of calling that, put
TarBinary@rulefind_tarawait find_tar()fresh-cat-90827
08/20/2021, 7:29 PMdist/