AcademySoftwareFoundation / AcademySoftwareFoundation/rez

Windows "MAX_PATH" 260 characters limit and Rez.

Open
#436 3 comments 1 reaction 0 assignees View on GitHub
bug os:windows
Dominant language
Python
Stars
1.1k
Forks
369
Avg merge
12d 3h
Merged PRs (30d)
5

Description

Hi,

I came across this one while building Boost with variant nesting, basically it is quite easy to hit the Windows "MAX_PATH" 260 characters limit:

``` python
D:\Documents\Development\ThirdParty\boost (master)
λ rez-release

--------------------------------------------------------------------------------
Releasing boost-1.63.0...
--------------------------------------------------------------------------------
Checking state of repository...

--------------------------------------------------------------------------------
Releasing variant 1/1...
--------------------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Program Files\Anaconda2\Lib\runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "C:\Program Files\Anaconda2\Lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Program Files\rez\Scripts\rez\rez-release.exe\__main__.py", line 2, in
File "c:\progra~1\rez\lib\site-packages\rez-2.13.0-py2.7.egg\rez\cli\_main.py", line 118, in run
returncode = run_cmd()
File "c:\progra~1\rez\lib\site-packages\rez-2.13.0-py2.7.egg\rez\cli\_main.py", line 110, in run_cmd
return opts.func(opts, opts.parser, arg_groups[1:])
File "c:\progra~1\rez\lib\site-packages\rez-2.13.0-py2.7.egg\rez\cli\release.py", line 138, in command
variants=opts.variants)
File "c:\progra~1\rez\lib\site-packages\rez-2.13.0-py2.7.egg\rezplugins\build_process\local.py", line 76, in release
release_message=release_message)
File "c:\progra~1\rez\lib\site-packages\rez-2.13.0-py2.7.egg\rez\build_process_.py", line 184, in visit_variants
result = func(variant, **kwargs)
File "c:\progra~1\rez\lib\site-packages\rez-2.13.0-py2.7.egg\rezplugins\build_process\local.py", line 220, in _release_variant
install=True)
File "c:\progra~1\rez\lib\site-packages\rez-2.13.0-py2.7.egg\rezplugins\build_process\local.py", line 116, in _build_variant_base
shutil.rmtree(variant_build_path)
File "C:\Program Files\Anaconda2\Lib\shutil.py", line 247, in rmtree
rmtree(fullname, ignore_errors, onerror)
File "C:\Program Files\Anaconda2\Lib\shutil.py", line 247, in rmtree
rmtree(fullname, ignore_errors, onerror)
File "C:\Program Files\Anaconda2\Lib\shutil.py", line 247, in rmtree
rmtree(fullname, ignore_errors, onerror)
File "C:\Program Files\Anaconda2\Lib\shutil.py", line 247, in rmtree
rmtree(fullname, ignore_errors, onerror)
File "C:\Program Files\Anaconda2\Lib\shutil.py", line 247, in rmtree
rmtree(fullname, ignore_errors, onerror)
File "C:\Program Files\Anaconda2\Lib\shutil.py", line 247, in rmtree
rmtree(fullname, ignore_errors, onerror)
File "C:\Program Files\Anaconda2\Lib\shutil.py", line 247, in rmtree
rmtree(fullname, ignore_errors, onerror)
File "C:\Program Files\Anaconda2\Lib\shutil.py", line 252, in rmtree
onerror(os.remove, fullname, sys.exc_info())
File "C:\Program Files\Anaconda2\Lib\shutil.py", line 250, in rmtree
os.remove(fullname)
WindowsError: [Error 3] The system cannot find the path specified: 'D:\\Documents\\Development\\ThirdParty\\boost\\build\\platform-windows\\arch-AMD64\\python-2.7.13\\boost\\libs\\geometry\\doc\\doxy\\doxygen_output\\html_by_doxygen\\classboost_1_1geometry_1_1detail_1_1turns_1_1filter__continue__turns_3_01_turns_00_01true_01_4-members.html'
```

I want to document it as people might face it at some point. my workaround in that particular case was to delete the build directory manually and prepend `\\\\?\\` to any paths I use for the build/release process.

I was debating about patching Rez directly to handle that but doing the above is enough for now.

Contributor guide

Open the contributing guide

Research direction

Start with the Windows traceback from rez-release, especially the cleanup path reaching shutil.rmtree. Locate the relevant user-facing documentation entry point and document the MAX_PATH symptom, manual build-directory cleanup, and the \\?\ workaround described here. Done means a Windows user can find and follow the documented workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, cli, operating-systems
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.