kart icon indicating copy to clipboard operation
kart copied to clipboard

Working copy reflink

Open olegsson opened this issue 2 years ago • 1 comments

Description

Use pyreflink to take advantage of copy-on-write capable filesystem when creating the working copy.

Related links:

Checklist:

  • [ ] Have you reviewed your own change?
  • [ ] Have you included test(s)?
  • [ ] Have you updated the changelog?

olegsson avatar Aug 27 '22 16:08 olegsson

FYI The failures above are just due to the loose requirements.in not being made specific by pip-compile and checked in - this is fixed by running make py-requirements and checking in the generated changes. I did this and hit a build issue on Linux as it tried to pip install reflink==0.2.1:

Collecting reflink==0.2.1
  Downloading reflink-0.2.1.tar.gz (14 kB)
    ERROR: Command errored out with exit status 1:
     command: /venv/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6uw6ver0/reflink/setup.py'"'"'; __file__='"'"'/tmp/pip-install-6uw6ver0/reflink/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-_h0z2k_r
         cwd: /tmp/pip-install-6uw6ver0/reflink/
    Complete output (33 lines):
    WARNING: The wheel package is not available.
    WARNING: The directory '/root/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
    WARNING: The wheel package is not available.
    WARNING: The directory '/root/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
    WARNING: The wheel package is not available.
    WARNING: The directory '/root/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-6uw6ver0/reflink/setup.py", line 64, in <module>
        cffi_modules=["reflink/native.py:ffibuilder"]
      File "/venv/lib/python3.7/site-packages/setuptools/__init__.py", line 144, in setup
        return distutils.core.setup(**attrs)
      File "/opt/python/cp37-cp37m-shared/lib/python3.7/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/venv/lib/python3.7/site-packages/setuptools/dist.py", line 426, in __init__
        k: v for k, v in attrs.items()
      File "/opt/python/cp37-cp37m-shared/lib/python3.7/distutils/dist.py", line 292, in __init__
        self.finalize_options()
      File "/venv/lib/python3.7/site-packages/setuptools/dist.py", line 717, in finalize_options
        ep(self)
      File "/venv/lib/python3.7/site-packages/setuptools/dist.py", line 724, in _finalize_setup_keywords
        ep.load()(self, ep.name, value)
      File "/tmp/pip-install-6uw6ver0/reflink/.eggs/cffi-1.15.1-py3.7-linux-x86_64.egg/cffi/setuptools_ext.py", line [219](https://github.com/koordinates/kart/runs/8061045327?check_suite_focus=true#step:21:220), in cffi_modules
        add_cffi_module(dist, cffi_module)
      File "/tmp/pip-install-6uw6ver0/reflink/.eggs/cffi-1.15.1-py3.7-linux-x86_64.egg/cffi/setuptools_ext.py", line 49, in add_cffi_module
        execfile(build_file_name, mod_vars)
      File "/tmp/pip-install-6uw6ver0/reflink/.eggs/cffi-1.15.1-py3.7-linux-x86_64.egg/cffi/setuptools_ext.py", line 25, in execfile
        exec(code, glob, glob)
      File "reflink/native.py", line 12, in <module>
        ffibuilder = FFI()
      File "/tmp/pip-install-6uw6ver0/reflink/.eggs/cffi-1.15.1-py3.7-linux-x86_64.egg/cffi/api.py", line 48, in __init__
        import _cffi_backend as backend
    ImportError: /tmp/pip-install-6uw6ver0/reflink/.eggs/cffi-1.15.1-py3.7-linux-x86_64.egg/_cffi_backend.cpython-37m-x86_64-linux-gnu.so: failed to map segment from shared object: Operation not permitted
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
WARNING: You are using pip version 20.1.1; however, version 22.2.2 is available.
You should consider upgrading via the '/venv/bin/python3 -m pip install --upgrade pip' command.
make[1]: *** [Makefile:54: pyapp-Linux] Error 1
make[1]: Leaving directory '/home/runner/work/kart/kart/platforms'
make: Leaving directory '/home/runner/work/kart/kart/platforms'
make: *** [Makefile:49: linux/dist/kart/kart_cli] Error 2
Error: Process completed with exit code 2.

It's on my list of things to look into further

olsen232 avatar Aug 31 '22 01:08 olsen232

Merged as #757

olsen232 avatar Jan 08 '23 22:01 olsen232