You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@buildr.apache.org by Antoine Toulme <an...@lunar-ocean.com> on 2010/07/16 20:43:42 UTC

File::SEPARATOR on Windows

It looks like calling out Java doesn't work well on Windows, in particular
this h2.rake home made extension on Apache ODE:
http://svn.apache.org/viewvc/ode/trunk/tasks/h2.rake?view=markup

The log looks like this:

https://gist.github.com/c304862ba875ba29b12f/469ac1e899ccbe1dd76ea1c2cb1081bdf5a0c479

I tempered with it as much as I could, the only line that makes any sense
is:
The filename, directory name, or volume label syntax is incorrect.

Which turned me to think the problem lies in the path of the command, which
uses slashes instead of backslashes:

"C:/Program Files (x86)/Java/jdk1.6.0_20/bin/java" "-classpath"
"C:/Users/vanto/.m2/repository/com/h2database/h2/1.1.117/h2-1.1.117.jar"
"org.h2.tools.RunScript" "-url"
"jdbc:h2:file:C:/Users/vanto/dev/git/pxe/dao-hibernate-db/target/h2/hibdb/ode-hib-h2;DB_CLOSE_ON_EXIT=false;user=sa"
"-showResults" "-script"
"C:/Users/vanto/dev/git/pxe/dao-hibernate-db/src/schema/ode-hib-h2.sql"

I am pretty sure Buildr worked towards supporting this before. Any hint to
help me on this ?

Thanks,
Antoine

Re: Re: File::SEPARATOR on Windows

Posted by Tammo van Lessen <tv...@gmail.com>.
Hi guys,

Thanks for taking care of my issue. I eventually found the root cause.
Looks like I was running into BUILDR-398, but not the forward slash was
causing the problem but the single quotes.

C:\Users\vanto\dev\git\pxe>cd 'C:/Users/vanto/dev/git/pxe'
The filename, directory name, or volume label syntax is incorrect.

C:\Users\vanto\dev\git\pxe>cd "C:/Users/vanto/dev/git/pxe"
C:\Users\vanto\dev\git\pxe>

C:\Users\vanto\dev\git\pxe>cd 'C:\Users\vanto\dev\git\pxe'
The filename, directory name, or volume label syntax is incorrect.

C:\Users\vanto\dev\git\pxe>cd "C:\Users\vanto\dev\git\pxe"
C:\Users\vanto\dev\git\pxe>

This seems to be resolved in the course of BUILDR-398. I applied that to
buildr 1.3.5 and it works (and will definitely need to put efforts into
upgrading to buildr 1.4). Though, it would be nice if --trace could
output the exact command line that is passed to __native_system__ to
ease debugging.

Thanks,
  Tammo

On 20:59, Antoine Toulme wrote:
> The fix is simple - I don't understand why we don't detect the problem with
> our specs on our Windows CI build.
> 
> I'll commit the fix now, I'll try to follow up with specs.
> 
> On Fri, Jul 16, 2010 at 14:38, Antoine Toulme <an...@lunar-ocean.com>wrote:
> 
>> Thanks Alex! That's what I needed.
>>
>>
>> On Fri, Jul 16, 2010 at 13:03, Alex Boisvert <al...@gmail.com>wrote:
>>
>>> Yeah, see buildr/core/utils.rb
>>>
>>>     # Just like File.expand_path, but for windows systems it
>>>     # capitalizes the drive name and ensures backslashes are used
>>>     def normalize_path(path, *dirs)
>>>       ...
>>>     end
>>>
>>> Sounds like Commands.path_to_bin should use normalize_path() instead of
>>> expand_path().
>>>
>>> alex
>>>
>>> On Fri, Jul 16, 2010 at 11:43 AM, Antoine Toulme <antoine@lunar-ocean.com
>>>> wrote:
>>>
>>>> It looks like calling out Java doesn't work well on Windows, in
>>>> particular
>>>> this h2.rake home made extension on Apache ODE:
>>>> http://svn.apache.org/viewvc/ode/trunk/tasks/h2.rake?view=markup
>>>>
>>>> The log looks like this:
>>>>
>>>>
>>>> https://gist.github.com/c304862ba875ba29b12f/469ac1e899ccbe1dd76ea1c2cb1081bdf5a0c479
>>>>
>>>> I tempered with it as much as I could, the only line that makes any sense
>>>> is:
>>>> The filename, directory name, or volume label syntax is incorrect.
>>>>
>>>> Which turned me to think the problem lies in the path of the command,
>>>> which
>>>> uses slashes instead of backslashes:
>>>>
>>>> "C:/Program Files (x86)/Java/jdk1.6.0_20/bin/java" "-classpath"
>>>> "C:/Users/vanto/.m2/repository/com/h2database/h2/1.1.117/h2-1.1.117.jar"
>>>> "org.h2.tools.RunScript" "-url"
>>>>
>>>> "jdbc:h2:file:C:/Users/vanto/dev/git/pxe/dao-hibernate-db/target/h2/hibdb/ode-hib-h2;DB_CLOSE_ON_EXIT=false;user=sa"
>>>> "-showResults" "-script"
>>>> "C:/Users/vanto/dev/git/pxe/dao-hibernate-db/src/schema/ode-hib-h2.sql"
>>>>
>>>> I am pretty sure Buildr worked towards supporting this before. Any hint
>>>> to
>>>> help me on this ?
>>>>
>>>> Thanks,
>>>> Antoine
>>>>
>>>
>>>
>>
> 

-- 
Tammo van Lessen - http://www.taval.de

Re: File::SEPARATOR on Windows

Posted by Antoine Toulme <an...@lunar-ocean.com>.
The fix is simple - I don't understand why we don't detect the problem with
our specs on our Windows CI build.

I'll commit the fix now, I'll try to follow up with specs.

On Fri, Jul 16, 2010 at 14:38, Antoine Toulme <an...@lunar-ocean.com>wrote:

> Thanks Alex! That's what I needed.
>
>
> On Fri, Jul 16, 2010 at 13:03, Alex Boisvert <al...@gmail.com>wrote:
>
>> Yeah, see buildr/core/utils.rb
>>
>>     # Just like File.expand_path, but for windows systems it
>>     # capitalizes the drive name and ensures backslashes are used
>>     def normalize_path(path, *dirs)
>>       ...
>>     end
>>
>> Sounds like Commands.path_to_bin should use normalize_path() instead of
>> expand_path().
>>
>> alex
>>
>> On Fri, Jul 16, 2010 at 11:43 AM, Antoine Toulme <antoine@lunar-ocean.com
>> > wrote:
>>
>>> It looks like calling out Java doesn't work well on Windows, in
>>> particular
>>> this h2.rake home made extension on Apache ODE:
>>> http://svn.apache.org/viewvc/ode/trunk/tasks/h2.rake?view=markup
>>>
>>> The log looks like this:
>>>
>>>
>>> https://gist.github.com/c304862ba875ba29b12f/469ac1e899ccbe1dd76ea1c2cb1081bdf5a0c479
>>>
>>> I tempered with it as much as I could, the only line that makes any sense
>>> is:
>>> The filename, directory name, or volume label syntax is incorrect.
>>>
>>> Which turned me to think the problem lies in the path of the command,
>>> which
>>> uses slashes instead of backslashes:
>>>
>>> "C:/Program Files (x86)/Java/jdk1.6.0_20/bin/java" "-classpath"
>>> "C:/Users/vanto/.m2/repository/com/h2database/h2/1.1.117/h2-1.1.117.jar"
>>> "org.h2.tools.RunScript" "-url"
>>>
>>> "jdbc:h2:file:C:/Users/vanto/dev/git/pxe/dao-hibernate-db/target/h2/hibdb/ode-hib-h2;DB_CLOSE_ON_EXIT=false;user=sa"
>>> "-showResults" "-script"
>>> "C:/Users/vanto/dev/git/pxe/dao-hibernate-db/src/schema/ode-hib-h2.sql"
>>>
>>> I am pretty sure Buildr worked towards supporting this before. Any hint
>>> to
>>> help me on this ?
>>>
>>> Thanks,
>>> Antoine
>>>
>>
>>
>

Re: File::SEPARATOR on Windows

Posted by Antoine Toulme <an...@lunar-ocean.com>.
Thanks Alex! That's what I needed.

On Fri, Jul 16, 2010 at 13:03, Alex Boisvert <al...@gmail.com>wrote:

> Yeah, see buildr/core/utils.rb
>
>     # Just like File.expand_path, but for windows systems it
>     # capitalizes the drive name and ensures backslashes are used
>     def normalize_path(path, *dirs)
>       ...
>     end
>
> Sounds like Commands.path_to_bin should use normalize_path() instead of
> expand_path().
>
> alex
>
> On Fri, Jul 16, 2010 at 11:43 AM, Antoine Toulme <an...@lunar-ocean.com>wrote:
>
>> It looks like calling out Java doesn't work well on Windows, in particular
>> this h2.rake home made extension on Apache ODE:
>> http://svn.apache.org/viewvc/ode/trunk/tasks/h2.rake?view=markup
>>
>> The log looks like this:
>>
>>
>> https://gist.github.com/c304862ba875ba29b12f/469ac1e899ccbe1dd76ea1c2cb1081bdf5a0c479
>>
>> I tempered with it as much as I could, the only line that makes any sense
>> is:
>> The filename, directory name, or volume label syntax is incorrect.
>>
>> Which turned me to think the problem lies in the path of the command,
>> which
>> uses slashes instead of backslashes:
>>
>> "C:/Program Files (x86)/Java/jdk1.6.0_20/bin/java" "-classpath"
>> "C:/Users/vanto/.m2/repository/com/h2database/h2/1.1.117/h2-1.1.117.jar"
>> "org.h2.tools.RunScript" "-url"
>>
>> "jdbc:h2:file:C:/Users/vanto/dev/git/pxe/dao-hibernate-db/target/h2/hibdb/ode-hib-h2;DB_CLOSE_ON_EXIT=false;user=sa"
>> "-showResults" "-script"
>> "C:/Users/vanto/dev/git/pxe/dao-hibernate-db/src/schema/ode-hib-h2.sql"
>>
>> I am pretty sure Buildr worked towards supporting this before. Any hint to
>> help me on this ?
>>
>> Thanks,
>> Antoine
>>
>
>

Re: File::SEPARATOR on Windows

Posted by Alex Boisvert <al...@gmail.com>.
Yeah, see buildr/core/utils.rb

    # Just like File.expand_path, but for windows systems it
    # capitalizes the drive name and ensures backslashes are used
    def normalize_path(path, *dirs)
      ...
    end

Sounds like Commands.path_to_bin should use normalize_path() instead of
expand_path().

alex

On Fri, Jul 16, 2010 at 11:43 AM, Antoine Toulme <an...@lunar-ocean.com>wrote:

> It looks like calling out Java doesn't work well on Windows, in particular
> this h2.rake home made extension on Apache ODE:
> http://svn.apache.org/viewvc/ode/trunk/tasks/h2.rake?view=markup
>
> The log looks like this:
>
>
> https://gist.github.com/c304862ba875ba29b12f/469ac1e899ccbe1dd76ea1c2cb1081bdf5a0c479
>
> I tempered with it as much as I could, the only line that makes any sense
> is:
> The filename, directory name, or volume label syntax is incorrect.
>
> Which turned me to think the problem lies in the path of the command, which
> uses slashes instead of backslashes:
>
> "C:/Program Files (x86)/Java/jdk1.6.0_20/bin/java" "-classpath"
> "C:/Users/vanto/.m2/repository/com/h2database/h2/1.1.117/h2-1.1.117.jar"
> "org.h2.tools.RunScript" "-url"
>
> "jdbc:h2:file:C:/Users/vanto/dev/git/pxe/dao-hibernate-db/target/h2/hibdb/ode-hib-h2;DB_CLOSE_ON_EXIT=false;user=sa"
> "-showResults" "-script"
> "C:/Users/vanto/dev/git/pxe/dao-hibernate-db/src/schema/ode-hib-h2.sql"
>
> I am pretty sure Buildr worked towards supporting this before. Any hint to
> help me on this ?
>
> Thanks,
> Antoine
>