Closed Bug 516799 Opened 10 years ago Closed 10 years ago
_symlinks .js fails when using the 10 .5 SDK
No description provided.
TEST-UNEXPECTED-FAIL | (xpcshell/head.js) | [Exception... "Component returned failure code: 0x80520009 (NS_ERROR_FILE_INVALID_PATH) [nsIFile.target]" nsresult: "0x80520009 (NS_ERROR_FILE_INVALID_PATH)" location: "JS frame :: /Users/josh/src/mozilla/ff_193_debug/objdir-debug/_tests/xpcshell/xpcom/unit/test_symlinks.js :: makeSymLink :: line 59" data: no] The test is failing because the 10.5 SDK changes the way "realpath" works. This is the relevant part of stdlib.h: #if (__DARWIN_UNIX03 && !defined(_POSIX_C_SOURCE)) || defined(_DARWIN_C_SOURCE) || defined(_DARWIN_BETTER_REALPATH) char *realpath(const char * __restrict, char * __restrict) __DARWIN_EXTSN(realpath); #else /* (!__DARWIN_UNIX03 || _POSIX_C_SOURCE) && !_DARWIN_C_SOURCE && !_DARWIN_BETTER_REALPATH */ char *realpath(const char * __restrict, char * __restrict) __DARWIN_ALIAS(realpath); #endif /* (__DARWIN_UNIX03 && _POSIX_C_SOURCE) || _DARWIN_C_SOURCE || _DARWIN_BETTER_REALPATH */ The problematic call to realpath is at "nsLocalFile::GetNativeTarget".
Specifically, this is how realpath changed from the old to the new version (from the manpage): LEGACY DESCRIPTION In legacy mode, the last component of file_name does not need to exist when realpath() is called.
Attachment #400928 - Flags: review?(bzbarsky) → review?(benjamin)
For right now I should ifdef this based on the selected SDK.
Turns out using realpath in GetNativeTarget is a bad idea altogether. The solution should be based on readlink, and it turns out since we don't care about Mac OS X aliases we can just use the UNIX code. This allows us to match symlink behavior exactly. I didn't write any of the code being added here, it is line-for-line the code from the UNIX impl. I just swapped in the correct variable names.
pushed to mozilla-central http://hg.mozilla.org/mozilla-central/rev/86d9242bd84a
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.