Got a weird issue where an engineer at our company...
# general
f
Got a weird issue where an engineer at our company has a dev container set up such that
/proc/self/fd/0
is a broken symlink to a non-existent terminal. This breaks Pants with pantsd running locally for them, as pantsd complains that it can't open this terminal. I'm not sure how this situation can arise (I'll dig), but it is a real thing. However I cannot reproduce. My suggested workaround is
export PANTS_DYNAMIC_UI=false
, as running without pantsd makes local usage pretty tedious. Would Pants devs expect this to work?
1
Dynamic UI didn't work I found out how this is happening, it's via
nsenter
-ing into a container, which I think bypasses terminal allocation:
Copy code
nsenter --all --target=$CONTAINER_PID /bin/su $USER
where
$CONTAINER_PID
is found via some script. I'll work on an in-depth repro tomorrow. You can't make this stuff up lol
Truncated traceback:
Copy code
File "/var/tmp/user-cache/pants/setup/bootstrap-Linux-x86_64/2.13.0rc2+gitb0e7422e_py39/lib64/python3.9/site-packages/pants/bin/remote_pants_runner.py", line 48, in ttynames_to_env
    return dict(gen_env_vars())
  File "/var/tmp/user-cache/pants/setup/bootstrap-Linux-x86_64/2.13.0rc2+gitb0e7422e_py39/lib64/python3.9/site-packages/pants/bin/remote_pants_runner.py", line 46, in gen_env_vars
    yield (f"NAILGUN_TTY_PATH_{fd_id}", os.ttyname(fd.fileno()) or b"")
OSError: [Errno 19] No such device
The dev in question worked around this by hacking
ttynames_to_env
to
return {}