| Summary: | Symbolic link support doesn't work on the Mac | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Michael Valenta <Michael.Valenta> | ||||||||||||||||||||||
| Component: | Resources | Assignee: | Pawel Pogorzelski <pawel.pogorzelski1> | ||||||||||||||||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||||||||||||||||
| Severity: | normal | ||||||||||||||||||||||||
| Priority: | P3 | CC: | john.arthorne, john.camelon, Mike_Wilson, pawel.pogorzelski1, Szymon.Brandys | ||||||||||||||||||||||
| Version: | 3.4.2 | ||||||||||||||||||||||||
| Target Milestone: | 3.6 M3 | ||||||||||||||||||||||||
| Hardware: | All | ||||||||||||||||||||||||
| OS: | All | ||||||||||||||||||||||||
| Whiteboard: | |||||||||||||||||||||||||
| Bug Depends on: | |||||||||||||||||||||||||
| Bug Blocks: | 294722 | ||||||||||||||||||||||||
| Attachments: |
|
||||||||||||||||||||||||
|
Description
Michael Valenta
We have natives on the Mac, but support for symlinks was never added to it. The person who contributed symlink support only provided it for linux and solaris. It looks like the only two library calls required to support this are lstat and readlink, both of which are available on OS X. So, this should be a straight-forward port of the support added in org.eclipse.core.filesystem/natives/unix/localfile.c into org.eclipse.core.filesystem/natives/macosx/localfile.c We also would need a binary for AIX. Since this applies to more than just the Mac, I am generalizing the Platform fields. If we've got linux versions that work, then that code will typically work without changes on the mac. I'm +1 to to fixing this on Mac, and ok to fix it on other platforms as long as it doesn't take significant effort. Pawel is on it and will give estimates soon. Then we'll find a place for it in the Platform Workspace dev plan. Created attachment 150138 [details]
Patch_v01
Created attachment 150139 [details]
Library recompiled according to changes in Patch_v01
(In reply to comment #2) > It looks like the only two library calls required to support this are lstat and > readlink, both of which are available on OS X. So, this should be a > straight-forward port of the support added in > org.eclipse.core.filesystem/natives/unix/localfile.c into > org.eclipse.core.filesystem/natives/macosx/localfile.c The port was indeed straightforward. There was some problems with links to files including characters beyond Mac OS default charset. Patch from bug 170317, comment 16 makes readlink() output is decoded with platform's default encoding. This is invalid assumption on Mac since targets are encoded with UTF-8 whereas the default is single byte ISO-8859-1. Not sure if it causes problems on other platforms. Patch_v01 was prepared against 3.4.2, it could require adjustments for HEAD. Created attachment 150210 [details]
Patch_v02
Patch adjusted for HEAD.
Created attachment 150211 [details]
Library recompiled according to changes in Patch_v02
Created attachment 150214 [details] Patch_v03 Patch for HEAD changed in order to avoid regression of bug 260432. Created attachment 150215 [details]
Library recompiled according to changes in Patch_v03
Created attachment 150216 [details] Patch_v04 Patch for 3.4.2 changed in order to avoid regression of bug 260432. Created attachment 150217 [details]
Library recompiled according to changes in Patch_v04
Code changes and the library for Mac are in HEAD, marking as FIXED. Tracking support for AIX has been forked to bug 293185. Created attachment 152830 [details]
Patch_v05
A supplementary fix.
Thanks Pawel. Released to HEAD. Created attachment 152832 [details]
Patch_v06
A patch addressing Szymon's comment below :)
I think that we should not touch LocalFileSystem#attributes and rollback the fix. The fallback part at the end of the #attributes method is just to support older versions of the lib that don't have the native #attributes method. Since we don't plan to change and rebuild older libs, LocalFileSystem#attributes is valid without any changes. LocalFileSystem#attributes is reverted to 1.18. See Martin's Bug 294722, comment 10 for a remaining issue. The fix for Bug 259643 fixes it in HEAD. |