magfest / reggie-formula

SaltStack formula and dev environment for Reggie, MAGFest's registration and management system
GNU General Public License v3.0
1 stars 6 forks source link

virtualenv doesn't support symlinks on windows when using virtualbox shared fs, breaks windows build #11

Closed msg4real closed 5 years ago

msg4real commented 5 years ago
----------
          ID: reggie virtualenv
    Function: virtualenv.managed
        Name: /home/vagrant/reggie-formula/reggie_install/env
      Result: False
     Comment: Using base prefix '/usr'
              New python executable in /home/vagrant/reggie-formula/reggie_install/env/bin/python3
              Also creating executable in /home/vagrant/reggie-formula/reggie_install/env/bin/python
              Running virtualenv with interpreter /usr/bin/python3Traceback (most recent call last):
                File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 2462, in <module>
                  main()
                File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 762, in main
                  symlink=options.symlink,
                File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 998, in create_environment
                  install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages=site_packages, clear=clear, symlink=symlink)
                File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 1459, in install_python
                  os.symlink(py_executable_base, full_pth)
              OSError: [Errno 71] Protocol error: 'python3' -> '/home/vagrant/reggie-formula/reggie_install/env/bin/python'
     Started: 01:14:28.032002
    Duration: 4104.814 ms
     Changes:

Virtualenv fix can be found here https://github.com/pypa/pipenv/issues/2084

binary1230 commented 5 years ago

was this on windows?

we used to use this flag because the virtualbox shared FS indeed doesn't support symlinks. we should fix any code inside our systems running pip or creating the python virtualenv by adding --always-copy. This probably just got lost in the conversion from puppet to salt

binary1230 commented 5 years ago

it looks like if salt sets export VIRTUALENV_ALWAYS_COPY=1 when running this, it'll work.

there's also a symlink option on https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.virtualenv_mod.html though I'm still a bit new to salt to know where to set that

binary1230 commented 5 years ago

testing a fix for this now in #12