On 12 Dec 2013, at 12:10 pm, John Koerner <gradle-...@johnkoerner.net> wrote:
> Hello. I recently pulled the gradle source and was trying to build on a > windows 8 machine. I ended up with a unit test failure in the core > subproject. The test that is failing is at > BaseDirFileResolverSpec.groovy:145: > normalizes path which uses windows 8.3 name > > Looking into this, I think this is caused by the fact that by default Windows > 8 sets the 8dot3name support on a per volume basis. Using the fsutil app on > my machine, I can see that 8.3 names are disabled on my build volume: > > $ fsutil 8dot3name query Z: > The volume state is: 1 (8dot3 name creation is disabled). > The registry state is: 2 (Per volume setting - the default). > > Based on the above two settings, 8dot3 name creation is disabled on Z: > > Here is a technet article about the setting: > http://support.microsoft.com/kb/121007 > > In order to correct this I was thinking that a new test precondition could be > added that ensures the windows system supports 8.3 file names before running > the test. > > We would first check the > HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\NtfsDisable8dot3NameCreation > registry key. > - If it is 0, then 8.3 is supported on all drives and the precondition is > true. > - If it is 1 then we skip the test as 8.3 is not supported and the > precondition is false. > - If it is 2 then we check the volume on which the test is running to find > the right value (this may require escalation if done on a system drive) and > based on that setting we return the appropriate value for the precondition. > - If it is 3 and the test is running on the system drive, we check the drive > and return the appropriate value for the precondition. > > This is my first foray into the gradle source, so if there are better > suggestions on how to fix this, or any pointers on similar code to look at > please let me know. I think a good place to fix this would be to add detection of 8.3 support to our native integration (https://github.com/adammurdoch/native-platform) and then use that in the test precondition. Another, much quicker, option would be to change the `assert path.exists() && path.file` in the test into `Assume.assumeTrue path.exists() && path.file`, which would skip the test if 8.3 support isn’t enabled. -- Adam Murdoch Gradle Co-founder http://www.gradle.org VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting http://www.gradleware.com