# Rebuilding eggs in hacking/env-setup

**URL:** <https://forum.ansible.com/t/rebuilding-eggs-in-hacking-env-setup/19303>\
**Category:** Ansible Project\
**Created:** [September 18, 2015, 7:27pm UTC](https://forum.ansible.com/t/rebuilding-eggs-in-hacking-env-setup/19303 "2015-09-18T19:27:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Josh\_Smift1](https://avatars.discourse-cdn.com/v4/letter/j/bcef8e/32.png) [@Josh\_Smift1](https://forum.ansible.com/u/Josh_Smift1)\
**Post date:** [September 18, 2015, 7:27pm UTC](https://forum.ansible.com/t/rebuilding-eggs-in-hacking-env-setup/19303/1 "2015-09-18T19:27:21Z")

</div>

We were running 1.7.2, and are upgrading to 1.9.3-1. We install from git  
(because we have some local mods to apply, which we've found easier to do  
when installing via git), which means that we run .../hacking/env-setup,  
and that seems to have changed between 1.7.2 and 1.9.3-1, in ways that  
don't work for us. This bit in particular:

&nbsp;&nbsp;gen\_egg\_info()  
&nbsp;&nbsp;{  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if [-e "$PREFIX\_PYTHONPATH/ansible.egg-info"] ; then  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rm -r "$PREFIX\_PYTHONPATH/ansible.egg-info"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fi  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;python setup.py egg\_info  
&nbsp;&nbsp;}

We sometimes run Ansible as root, and sometimes as ourselves, depending on  
what we're doing; $PREFIX\_PYTHONPATH is owned by root. If we only ever run  
it as ourselves, it fails to create ansible.egg-info, which is fine -- we  
run env-setup with '-q' so we never even see the error -- but if we ever  
run it as root, then it creates the directory, and subsequent non-root  
runs after \*that\* just hang, because 'rm -r' prompts us interactively if  
we want to descend into a write-protected directory:

&nbsp;&nbsp;+$ rm -r ansible.egg-info  
&nbsp;&nbsp;rm: descend into write-protected directory `ansible.egg-info'?

In our particular case, we don't think we care if pkg\_resources knows  
about our off-in-a-corner-somewhere Ansible installation, and this would  
work fine for us if the 'rm -r' were an 'rm -rf' instead. (It'd fail, and  
we wouldn't ever know or care.)

Alternatively: Does this actually need to be done every time you run  
.../hacking/env-setup? If it's more like a one-time thing that you only  
ever have to do when you pull from git, maybe it should be handled by a  
separate setup/install/something script?

If the 'rm -rf' approach sounds good, I can put in a PR.

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-Josh (jbs@care.com)

This email is intended for the person(s) to whom it is addressed and may contain information that is PRIVILEGED or CONFIDENTIAL. Any unauthorized use, distribution, copying, or disclosure by any person other than the addressee(s) is strictly prohibited. If you have received this email in error, please notify the sender immediately by return email and delete the message and any attachments from your system.
