[TIMOB-18285] Windows: Build - Cannot build for Windows emulator or device when path exceeds 260 characters
GitHub Issue | n/a |
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-01-07T22:27:39.000+0000 |
Affected Version/s | Release 4.0.0 |
Fix Version/s | Release 4.1.0 |
Components | CLI, Windows |
Labels | qe-3.5.0 |
Reporter | Wilson Luu |
Assignee | Christopher Williams |
Created | 2014-12-23T22:11:07.000+0000 |
Updated | 2015-10-07T19:11:44.000+0000 |
Description
*Details:* Cannot build to Windows emulator or device from Windows OS 8.1.
*Note:* This issue was only reproducible on *one* particular QE Windows machine. The other QE Windows machine (not reproducing this issue) had the same setup except it was running Visual Studio Community 2013 Update 4.
*Steps to reproduce:*
0. Follow setup steps from "Windows Preview Announcement" email
1. Open cmd prompt
2. Create a project via CLI
3. Build to emulator ti build -p windows -T wp-emulator
*or* device: ti build -p windows -T wp-device
4. Input your publisher guid (if prompt is enabled)
5. If installing to emulator, select an emulator
*Acutal:* Build will fail for both emulator and device; see emulator_install.txt and device_install.txt attachments.
*Expected:* Should be able to build to both Windows emulator and device.
Attachments
I am also running into this issue. The build fails when built from studio 3.4.1.201410281743 Studio Console Log:
Environment: Ti Studio: 3.4.1.201410281743 Ti SDK : 3.6.0.v20141223082526 OS : Microsoft Windows 8.1 Pro VS Studio : Community 2013 update 4 Device: Nokia 1020 (8.1) Attaching my CMakeOutput.log & CMakeError.log file for reference
There's two things that stand out for me in the output here:
and later:
So it looks to me like a path issue. My best guess is that it's just throwing up errors due to the second error message - that these paths are too long for Windows. If that's the case, then I suppose the "fix" here is to try and compile under C:\Temp and then copy everything over after? Basically the default workspace path is very long and just trying to build everything under the project's build/windows/WindowPhone.ARCH folder will often result in very long paths. An easy way to test this theory is to instead generate the project at the root of the drive and try building (i.e. "C:\project"). This will chop off around 56 characters from the path in this particular case.
Upon further testing I see that if my project path has 65 characters or less the app is build successfully, whereas if its 68 characters or more the build fails with the error above. This means we are adding lot of characters on top of 65 during the build process for the build process to fail.
Unfortunately there's not a lot of great workarounds to build into the tooling. Some options: - trim the paths I append to the build folder, mostly the Windows(Phone/Store).(Win32|ARM) portion. I could shrink this down to around ~6 characters, which would save us 10-12 characters. - Use a different folder for building and then copy the results over before launch? This would slow the build down as we'd have to copy things around. Also With Windows 7/8+ the temp directory isn't exactly short either: "C:\Users\User Name\AppData\Local\Temp" - Hacking something up with SUBST: http://technet.microsoft.com/en-us/library/bb491006.aspx to assign a drive letter to the path, effectively shortening the path. We're not the only ones running into this: https://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2156195-fix-260-character-file-name-length-limitation http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/4954037-fix-260-character-file-name-length-limitation
So trimming the appended path plus using temp may make a decent enough crack at avoiding this for users. Let's compare the proposed versus current:
Then we can copy the result back into ~/build/windows/wp.x86 after the msbuild portion runs. So in this case we'd save 47 characters, which seems pretty good since the limit we're trying to avoid is 260. Unfortunately, beyond that we'd have to ask the users to place their projects in a shorter path to start with and not do the temp build.
https://github.com/appcelerator/titanium_mobile_windows/pull/73
Verified using: Windows 8.1 Appc CLI (NPM): 4.1.0 Appc CLI (Registry): 4.1.0 Ti SDK: 4.1.0.GA When building on machines where the path exceeds 260 characters the build is now working fine Closing ticket