You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by "Nick Sieger (JIRA)" <ji...@apache.org> on 2008/03/07 18:25:46 UTC

[jira] Created: (BUILDR-54) File.normalize_path broken on Mac OS X

File.normalize_path broken on Mac OS X
--------------------------------------

                 Key: BUILDR-54
                 URL: https://issues.apache.org/jira/browse/BUILDR-54
             Project: Buildr
          Issue Type: Bug
          Components: Core features
    Affects Versions: 1.3
         Environment: Mac OS X
            Reporter: Nick Sieger
            Priority: Blocker
             Fix For: 1.3
         Attachments: common-mswin.patch

The File.normalize_path function introduced in rev 634463 is broken on Mac. The code:

{noformat}
Config::CONFIG["host_os"] =~ /win/i
{noformat}

is not sufficient to detect Windows, because on Mac OS X:

{noformat}
$ ruby -rrbconfig -e 'puts Config::CONFIG["host_os"]'
darwin9.0
$ jruby -rrbconfig -e 'puts Config::CONFIG["host_os"]'
darwin
{noformat}

Attached is a patch to fix.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (BUILDR-54) File.normalize_path broken on Mac OS X

Posted by "Victor Hugo Borja (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BUILDR-54?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Victor Hugo Borja resolved BUILDR-54.
-------------------------------------

    Resolution: Fixed

Thanks Nick, now fixed in trunk, I also added /windows/i to the pattern, because of:

$ ~/opt/jruby-1.1RC2/bin/jruby -rrbconfig -e 'p Config::CONFIG["host_os"]'
"Windows XP"


> File.normalize_path broken on Mac OS X
> --------------------------------------
>
>                 Key: BUILDR-54
>                 URL: https://issues.apache.org/jira/browse/BUILDR-54
>             Project: Buildr
>          Issue Type: Bug
>          Components: Core features
>    Affects Versions: 1.3
>         Environment: Mac OS X
>            Reporter: Nick Sieger
>            Assignee: Victor Hugo Borja
>            Priority: Blocker
>             Fix For: 1.3
>
>         Attachments: common-mswin.patch
>
>
> The File.normalize_path function introduced in rev 634463 is broken on Mac. The code:
> {noformat}
> Config::CONFIG["host_os"] =~ /win/i
> {noformat}
> is not sufficient to detect Windows, because on Mac OS X:
> {noformat}
> $ ruby -rrbconfig -e 'puts Config::CONFIG["host_os"]'
> darwin9.0
> $ jruby -rrbconfig -e 'puts Config::CONFIG["host_os"]'
> darwin
> {noformat}
> Attached is a patch to fix.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (BUILDR-54) File.normalize_path broken on Mac OS X

Posted by "Nick Sieger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BUILDR-54?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12576313#action_12576313 ] 

Nick Sieger commented on BUILDR-54:
-----------------------------------

Ok, be aware that in trunk JRuby we've recently corrected host_os to report "mswin32" just as matzruby does (I believe). So your patch looks fine.

> File.normalize_path broken on Mac OS X
> --------------------------------------
>
>                 Key: BUILDR-54
>                 URL: https://issues.apache.org/jira/browse/BUILDR-54
>             Project: Buildr
>          Issue Type: Bug
>          Components: Core features
>    Affects Versions: 1.3
>         Environment: Mac OS X
>            Reporter: Nick Sieger
>            Assignee: Victor Hugo Borja
>            Priority: Blocker
>             Fix For: 1.3
>
>         Attachments: common-mswin.patch
>
>
> The File.normalize_path function introduced in rev 634463 is broken on Mac. The code:
> {noformat}
> Config::CONFIG["host_os"] =~ /win/i
> {noformat}
> is not sufficient to detect Windows, because on Mac OS X:
> {noformat}
> $ ruby -rrbconfig -e 'puts Config::CONFIG["host_os"]'
> darwin9.0
> $ jruby -rrbconfig -e 'puts Config::CONFIG["host_os"]'
> darwin
> {noformat}
> Attached is a patch to fix.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (BUILDR-54) File.normalize_path broken on Mac OS X

Posted by "Victor Hugo Borja (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BUILDR-54?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Victor Hugo Borja reassigned BUILDR-54:
---------------------------------------

    Assignee: Victor Hugo Borja

> File.normalize_path broken on Mac OS X
> --------------------------------------
>
>                 Key: BUILDR-54
>                 URL: https://issues.apache.org/jira/browse/BUILDR-54
>             Project: Buildr
>          Issue Type: Bug
>          Components: Core features
>    Affects Versions: 1.3
>         Environment: Mac OS X
>            Reporter: Nick Sieger
>            Assignee: Victor Hugo Borja
>            Priority: Blocker
>             Fix For: 1.3
>
>         Attachments: common-mswin.patch
>
>
> The File.normalize_path function introduced in rev 634463 is broken on Mac. The code:
> {noformat}
> Config::CONFIG["host_os"] =~ /win/i
> {noformat}
> is not sufficient to detect Windows, because on Mac OS X:
> {noformat}
> $ ruby -rrbconfig -e 'puts Config::CONFIG["host_os"]'
> darwin9.0
> $ jruby -rrbconfig -e 'puts Config::CONFIG["host_os"]'
> darwin
> {noformat}
> Attached is a patch to fix.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (BUILDR-54) File.normalize_path broken on Mac OS X

Posted by "Nick Sieger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BUILDR-54?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nick Sieger updated BUILDR-54:
------------------------------

    Attachment: common-mswin.patch

> File.normalize_path broken on Mac OS X
> --------------------------------------
>
>                 Key: BUILDR-54
>                 URL: https://issues.apache.org/jira/browse/BUILDR-54
>             Project: Buildr
>          Issue Type: Bug
>          Components: Core features
>    Affects Versions: 1.3
>         Environment: Mac OS X
>            Reporter: Nick Sieger
>            Priority: Blocker
>             Fix For: 1.3
>
>         Attachments: common-mswin.patch
>
>
> The File.normalize_path function introduced in rev 634463 is broken on Mac. The code:
> {noformat}
> Config::CONFIG["host_os"] =~ /win/i
> {noformat}
> is not sufficient to detect Windows, because on Mac OS X:
> {noformat}
> $ ruby -rrbconfig -e 'puts Config::CONFIG["host_os"]'
> darwin9.0
> $ jruby -rrbconfig -e 'puts Config::CONFIG["host_os"]'
> darwin
> {noformat}
> Attached is a patch to fix.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (BUILDR-54) File.normalize_path broken on Mac OS X

Posted by "Assaf Arkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BUILDR-54?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12576334#action_12576334 ] 

Assaf Arkin commented on BUILDR-54:
-----------------------------------

a)  No need to re-invent the wheel.  Turns out there's a method we can use to find out if we're running on Windows:  Gem.win_platform?

b)  Let's be very conservative with adding methods to core Ruby libraries, those tend to break code in weird, unexpected, and hard to diagnose ways.  (Lines 35-47 in lib/core/transport.rb are the result of two days wasted chasing such a bug due to Rake's insistence on extending Object).  Always prefer a solution that doesn't involve adding methods to classes/modules not defined by Buildr.

c)  Consistency rules.  On Windows file names are not case sensitive, unless they are on a shared drive.  On OS/X they are case-insensitive but case-preserving, except when they're not (OS/X server).  On Linux they are case-insensitive except when they're not (mounted FAT, NTFS or HFS file systems).  On Windows, UNIX style paths work everywhere except the default command line.

Right now Buildr just assumes the default Ruby behavior: case-preserving file names with slashes.  You always have the same file names everywhere, you know what they look like, and when things break, they always break in the same way.  Normalizing files some of the time just adds another inconsistency to work through.  Doing it throughout is just not possible, too many test cases that we're not equipped to write or run.

> File.normalize_path broken on Mac OS X
> --------------------------------------
>
>                 Key: BUILDR-54
>                 URL: https://issues.apache.org/jira/browse/BUILDR-54
>             Project: Buildr
>          Issue Type: Bug
>          Components: Core features
>    Affects Versions: 1.3
>         Environment: Mac OS X
>            Reporter: Nick Sieger
>            Assignee: Victor Hugo Borja
>            Priority: Blocker
>             Fix For: 1.3
>
>         Attachments: common-mswin.patch
>
>
> The File.normalize_path function introduced in rev 634463 is broken on Mac. The code:
> {noformat}
> Config::CONFIG["host_os"] =~ /win/i
> {noformat}
> is not sufficient to detect Windows, because on Mac OS X:
> {noformat}
> $ ruby -rrbconfig -e 'puts Config::CONFIG["host_os"]'
> darwin9.0
> $ jruby -rrbconfig -e 'puts Config::CONFIG["host_os"]'
> darwin
> {noformat}
> Attached is a patch to fix.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.