Vinutha Nayak created JRUBY-6315: ------------------------------------ Summary: Removing dead symlinks fails with jruby on ppc64 platform Key: JRUBY-6315 URL: https://jira.codehaus.org/browse/JRUBY-6315 Project: JRuby Issue Type: Bug Reporter: Vinutha Nayak Assignee: Thomas E Enebo
Failing testcase : test_file.rb ( part of testcase shipped with ruby 1.7.0 source ) . I have simplified it to contain only the failing part. {noformat} require 'test/unit' class TestMethodSymlink < Test::Unit::TestCase def test_require_symlink # Create a ruby file that sets a global variable to its view of __FILE__ f = File.open("real_file.rb", "w") f.write("$test_require_symlink_filename=__FILE__") f.close() system("ln -s real_file.rb linked_file.rb") assert(File.symlink?("linked_file.rb")) # JRUBY-5167 - Test that symlinks don't effect __FILE__ during load or require # Note: This bug only manifests for absolute paths that point to symlinks. abs_path = File.join(Dir.pwd, "real_file.rb") require abs_path assert_equal($test_require_symlink_filename, abs_path) abs_path_linked = File.join(Dir.pwd, "linked_file.rb") require abs_path_linked assert_equal($test_require_symlink_filename, abs_path_linked) load abs_path_linked assert_equal($test_require_symlink_filename, abs_path_linked) ensure File.delete("real_file.rb") File.delete("linked_file.rb") end end {noformat} When running with Java 7 we get the following error : {noformat} E Finished in 0.311 seconds. 1) Error: test_require_symlink(TestMethodSymlink): Errno::ENOENT: No such file or directory - linked_file.rb org/jruby/RubyFile.java:1793:in `unlink' ./test_symlink.rb:24:in `test_require_symlink' org/jruby/RubyKernel.java:1944:in `send' org/jruby/RubyArray.java:1603:in `each' org/jruby/RubyArray.java:1603:in `each' 1 tests, 4 assertions, 0 failures, 1 errors {noformat} Basically here the issue is that Jruby is not able to recognise the dead symlinks. Seems like it is failing at the following part of ruby code : {noformat} boolean isSymlink = RubyFileTest.symlink_p(recv, filename).isTrue(); // Broken symlinks considered by exists() as non-existing, // so we need to check for symlinks explicitly. if (!lToDelete.exists() && !isSymlink) { throw runtime.newErrnoENOENTError(filename.getUnicodeValue()); <----- exception is thrown here } {noformat} the symlink_p() should be returning *false* in the current scenario on ppc64 bit machine . Could you please check on this ? I have tested with build@http://ci.jruby.org/snapshots/master and I see the same failure with it too .Failure is seen both with java6 and java7 latest builds. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email