Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File paths are way too long #33

Closed
Lokathor opened this issue Jan 17, 2019 · 6 comments
Closed

File paths are way too long #33

Lokathor opened this issue Jan 17, 2019 · 6 comments

Comments

@Lokathor
Copy link

The build process should attempt to use shorter paths.

When attempting to build shaderc-rs, @termhn was given the following error

C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(321,5): error MSB3491: Could not write lines to file "x64\Release\spirv-tools-spv-amd-shader-explicit-vertex-parameter\spirv-to.8AECBDF2.tlog\spirv-tools-spv-amd-shader-explicit-vertex-parameter.lastbuildstate". The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. [C:\Users\Gray\Code\learn-gfx-hal\target\debug\build\shaderc-ceea3062217d891f\out\build\spirv-tools\source\spirv-tools-spv-amd-shader-explicit-vertex-parameter.vcxproj]

And then it was fixed by just moving up from C:\Users\Gray\Code\learn-gfx-hal to C:\dev\learn-gfx-hal, so you're right on the limit I guess, shouldn't be too hard to cut down some of the wordy stuff.

@antiagainst
Copy link
Collaborator

Yes, agreed. I also noticed this issue on buildbot recently and had a temporary solution (3d6fa5c). Looking for better ways now.

The long path is because both the default Rust target/ directory organization (attaching the super long target\x86_64-pc-windows-msvc\debug\build\shaderc-ceea3062217d891f\out\build component to the path if you build towards x86_64-pc-windows-msvc) and the target names in SPIRV-Tools (spirv-tools-spv-amd-shader-explicit-vertex-parameter). Arguably the first part carries more weight.

Funnily we are in the year of 2019 now, yet still suffer from some limitation from DOS time. MSBuild should really be modernized: dotnet/msbuild#53.

@antiagainst
Copy link
Collaborator

As a temporary workaround, you can use cargo --target-dir. See .appveyor.yml.

@antiagainst
Copy link
Collaborator

I've merged #38, which will detect whether Ninja exists in PATH and use it if true. It's pulling in another dependency (which is likely already installed on C++ dev machines), but Ninja is generally faster than MSBuild and does not suffer from MAX_PATH issue.

To make MSBuild work means to trim down the path. As discussed in #33 (comment), neither the default Rust target directory organization nor the SPIRV-Tools target name is easy to trim down for that purpose. And both of them can change again in the future.

@Lokathor
Copy link
Author

Lokathor commented Feb 2, 2019

The existence of this workaround should also be explicitly documented in the README.md

@antiagainst
Copy link
Collaborator

@Lokathor, it's already documented in README with a4f1bcc.

@Lokathor
Copy link
Author

Lokathor commented Feb 2, 2019

oh! so it is, foolish me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants