#797: zip symlink pure java#1995
Conversation
Coverage Report for CI Build 27616583660Coverage decreased (-0.03%) to 71.256%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions159 previously-covered lines in 3 files lost coverage.
Coverage Stats💛 - Coveralls |
…m/shodiBoy1/IDEasy into feature/797-zip-symlink-pure-java
Release includes new features and bug fixes for IDEasy.
hohwille
left a comment
There was a problem hiding this comment.
@shodiBoy1 thanks for your PR and your analysis of the root cause. I like that you always take such special problem and analyse it properly trying to come up with a rather small fixing PR👍
Surely we could merge this as is as a quickfix.
However, you revealed here that we have actually implemented our link function wrong (and therefore our "unpack" functions - not only for zip but also for tar).
IMHO your PR is not fixing that bug but adding a workaround with quite some redundancies.
My goal is that we aim for true quality so I would love to fix the link function properly.
Can you maybe extract a JUnit test that reproduces the scenario with invoking our link function?
BTW: We meanwhile also have ide ln -s <source> <link> to test such things. If you want to test with relative being true you can do ide ln -s -r <source> <link>.
If that is buggy, please lets fix the root cause.
|
Thanks for the review. My initial idea was to preserve the raw symlink target from the ZIP entry, because macOS framework bundles can contain chained symlinks where the final target is created later. That is why I first handled ZIP symlinks directly. After your feedback I agree that this was too ZIP-specific and bypassed the existing PathLink/link(...) abstraction. I reworked it so ZIP and TAR both go through PathLink -> link(PathLink), and the actual fix is now in the shared link handling. The shared link code now avoids resolving symlink targets too early, so archive symlinks can point through links that are created later. I also added a regression test that calls FileAccess.link(PathLink) directly for the macOS framework-style case. Tested with FileAccessImplTest, LnCommandletTest, and a manual VS Code install from IntelliJ. |
There was a problem hiding this comment.
@shodiBoy1 thanks for rework. Now approach seems reasonable. Changing to approved 👍
Team-review should still test that link creation still works as expected and have a quick look again and the diff.
tineff96
left a comment
There was a problem hiding this comment.
Overall, the PR looks good to me.
I ran:
mvn clean testResults:
-
Ubuntu/WSL: passes without changes
-
Windows: fails on this PR branch in:
testSymlinkShortcutPathstestSymlinkAbsolutePassingRelativeSource
The Windows failures seem related to the mklink fallback. If relative == false, passing the relative source to mklink causes Windows to resolve it against the process working directory instead of the link parent directory.
I tested the following adjustment in FileAccessImpl.java, line 481:
Path finalSource = relative ? source : absoluteSource;With this change, the focused test suite passes for me on Windows as well. This should keep the ZIP/macOS path able to preserve relative symlink targets when needed, while the Windows fallback keeps the previous absolute/adapted behavior for relative == false.
I still think the original macOS VSCode case should be verified manually on a Mac. I will ask a teammate with macOS to run the ide vscode scenario as well.
This PR fixes #797: fix VSCode install on macOS
Implemented changes:
Testing instructions
Check out the PR:
gh pr checkout 1995
Run on a Mac:
Checklist for this PR
mvn clean testlocally all tests pass and build is successful#«issue-id»: «brief summary»(e.g.#921: fixed setup.bat). If no issue ID exists, title only.In Progressand assigned to you or there is no issue (might happen for very small PRs)with
internal