Skip to content

MinGW failures - due to symlink #445

@MSP-Greg

Description

@MSP-Greg

@eregon

Good day, as you know, I'm the crazy MinGW guy. At present, using make test-spec has two failures. Running mspec has no failures.

I believe you touched on the issue of varying build systems in a ruby-lang issue. Well, here's another. I've mostly been building 2.5 trunk, but for various reasons, I've built other versions. So, I've got a git repo of ruby, and that is the source for my build system.

Since my system is loosely based on the MSYS2 / MinGW packaging system, I have a symlink for src within the standard build system folders to the ruby git repo folder.

Hence, the two failures, where realdirpath and realpath do not match __FILE__.

Would you accept a patch that allows the two tests to determine if __FILE__ is a symlink?

A method like the following does so:

fn = 'E:/GitHub/ruby-loco/src/ruby/spec/rubyspec/core/file/realdirpath_spec.rb' real = File.realdirpath(fn) #real = File.realpath(fn) def symlink_in_path?(fn) fn_strip = fn.dup found_symlink = false while fn_temp = File.dirname(fn_strip) do found_symlink = File.symlink?(fn_temp) break if found_symlink || fn_temp == fn_strip # reached last dir or drive fn_strip = fn_temp end found_symlink end if real != fn puts symlink_in_path?(fn) end

On Windows, one has to walk up the path to check for whether File.symlink? is true...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions