[
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.