I'm getting failures running Pants test with long ...
# general
n
I'm getting failures running Pants test with long branch names in our managed Jenkins. I see this warning:
Copy code
PEXWarning: The venv for /home/jenkins/agent/workspace/project1_fix_deployment_strategy/.pants/named_caches/pex_root/pip.pex/46820cb5af0dcf9295a4e7f30184cc0e9fa063dc at /home/jenkins/agent/workspace/project1_fix_deployment_strategy/.pants/named_caches/pex_root/venvs/18ed2ab08053f0622ffe35dae7fa5ecfb623151e/206b0fe3aff3bc9983d04b26cf1a4f301f8b293e has script shebangs of '#!/home/jenkins/agent/workspace/project1_fix_deployment_strategy/.pants/named_caches/pex_root/venvs/short/ac7a1b1b/bin/python3.8 -sE' with 132 characters. On some systems this may be too long and cause problems running the venv scripts. You may be able adjust PEX_ROOT from /home/jenkins/agent/workspace/project1_fix_deployment_strategy/.pants/named_caches/pex_root to a shorter path as a work-around.
and this error:
Copy code
00:03:38.947    File "/home/jenkins/agent/workspace/project1_fix_deployment_strategy/.pants/setup/bootstrap-Linux-x86_64/2.5.1_py38/lib/python3.8/site-packages/pants/engine/internals/scheduler.py", line 498, in _raise_on_error
00:03:38.947      raise ExecutionError(
00:03:38.947  pants.engine.internals.scheduler.ExecutionError: 1 Exception encountered:
00:03:38.947  
00:03:38.948    ProcessExecutionFailure: Process 'Resolving plugins: hdrhistogram' failed with exit code 1.
Apart from choosing a shorter branch name, is there anything that can be done here? I don't have control over the jenkins workspace directory.
h
Which version of Pants is this?
This was mitigated in https://github.com/pantsbuild/pex/pull/1254 which is in Pants 2.3.x and above, but it looks like the mitigation was not sufficient for your case because of the extra long homedir prefix.
Is there a shorter path than
/home/jenkins/agent/workspace/project1_fix_deployment_strategy/.pants/named_caches/pex_root
that you can write to? You're only 4 characters over the likely limit of 128. If so you can set the PEX_ROOT env var to that location.
I mean, you could just set it to
/home/jenkins/agent/workspace/project1_fix_deployment_strategy/pex_root
for example
Or at least let's see if that helps
h
I don't think setting PEX_ROOT would propagate. Instead, you'd set the Pants option named_caches_dir. See "how to change cache directories" on https://www.pantsbuild.org/docs/troubleshooting
h
Oh hmm, you're right, that is a pex message
What eric said... 🙂
n
Ah thanks. I see. That makes sense as I recently moved the cache directory within the workspace to get caching set up. I can set named caches dir to
.pants/nc
and test that out.
Looks like that did the trick!
🎉 2
h
Great! Yeah, that is a weird limitation of some linuxes