Get it building in a rootless container

This commit is contained in:
Kovid Goyal 2024-08-12 19:24:48 +05:30
parent 6ff943c10f
commit b872bbff49
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 2 deletions

View file

@ -201,9 +201,9 @@ def create_tarfile(env, compression_level='9'):
try: try:
shutil.rmtree(base) shutil.rmtree(base)
except OSError as err: except OSError as err:
if err.errno != errno.ENOENT: if err.errno not in (errno.ENOENT, errno.EBUSY): # EBUSY when the directory is mountpoint
raise raise
os.mkdir(base) os.makedirs(base, exist_ok=True)
dist = os.path.join(base, f'{kitty_constants["appname"]}-{kitty_constants["version"]}-{arch}.tar') dist = os.path.join(base, f'{kitty_constants["appname"]}-{kitty_constants["version"]}-{arch}.tar')
with tarfile.open(dist, mode='w', format=tarfile.PAX_FORMAT) as tf: with tarfile.open(dist, mode='w', format=tarfile.PAX_FORMAT) as tf:
cwd = os.getcwd() cwd = os.getcwd()

View file

@ -306,6 +306,7 @@ def __init__(
if argv is None: if argv is None:
from kitty.child import openpty from kitty.child import openpty
self.master_fd, self.slave_fd = openpty() self.master_fd, self.slave_fd = openpty()
self.child_pid = 0
else: else:
self.child_pid, self.master_fd = fork() self.child_pid, self.master_fd = fork()
self.is_child = self.child_pid == CHILD self.is_child = self.child_pid == CHILD