Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#910 Can not update intellij on linux #1101

Merged

Conversation

mbilda
Copy link
Contributor

@mbilda mbilda commented Mar 3, 2025

Fixes: #910
This PR fixes the issue if an simlink is broken and we check the file existence or want to delete the file.
If we wanna know if a file exists we wanna check the actual file itself and not the target where the simlink points to. That means if we wanna delete the actual file we shouldn't follow the simlink. Window automatically prevents that and always checks the file itself. Linux is a little bit "smarter" and knows that its a simlink file and automatically follows the link to the target file and checks if the target file exists. This is actually problematic, because we delete the simlink file and create a new one we a new target to update the versions.

LinkOption.NOFOLLOW_LINKS prevents both systems to follow the link in the simlink file and actually checks if the file itself exists.

This PR also reverts some changes from: #1078
As @hohwille suggested in an old PR:
#1078 (comment)

That the FileAcessImpl exists function doesn't really bring value to this i have decided to delete the method again.
That means we do not have to take care about some different behaviour because of the wrapper class where we may have a different implementation than using the usual Files.exists() function. The NOFOLLOW_LINKS option is set to the necessary places where we want to check the actual file and not the target of the simlink.

…tion

- Added LinkOption.NOFOLLOW_LINKS to verify if the symlink file itself exists or not - and not the target file/folder
…tion

- Added LinkOption.NOFOLLOW_LINKS to verify if the symlink file itself exists or not - and not the target file/folder
@mbilda mbilda self-assigned this Mar 3, 2025
@mbilda mbilda added bugfix update related to updating software or the entire ide intellij IntelliJ IDE from Jet-Brains labels Mar 3, 2025
@mbilda mbilda requested a review from jan-vcapgemini March 3, 2025 09:36
@coveralls
Copy link
Collaborator

coveralls commented Mar 3, 2025

Pull Request Test Coverage Report for Build 13669668814

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 141 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.004%) to 68.249%

Files with Coverage Reduction New Missed Lines %
com/devonfw/tools/ide/commandlet/UpgradeSettingsCommandlet.java 1 78.2%
com/devonfw/tools/ide/tool/LocalToolCommandlet.java 10 86.75%
com/devonfw/tools/ide/io/FileAccessImpl.java 130 66.39%
Totals Coverage Status
Change from base Build 13656537774: -0.004%
Covered Lines: 7868
Relevant Lines: 11080

💛 - Coveralls

Copy link
Contributor

@jan-vcapgemini jan-vcapgemini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Ready for review. I've added a question, please check.

mbilda added 3 commits March 4, 2025 11:10
…tion

- Removed exists() function from fileAccess because its just calling "super"
- Adjusted usages of fileAccess.exists()
…on-linux' into fix/910-can-not-update-intellij-on-linux
Copy link
Contributor

@jan-vcapgemini jan-vcapgemini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Ready for review.

Copy link
Member

@hohwille hohwille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mbilda thanks for your analysis of this bug and providing this PR as a proper fix. Great work! 👍

@hohwille hohwille added this to the release:2025.03.001 milestone Mar 4, 2025
@jan-vcapgemini jan-vcapgemini removed their assignment Mar 5, 2025
@hohwille hohwille merged commit 7053db9 into devonfw:main Mar 6, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix intellij IntelliJ IDE from Jet-Brains update related to updating software or the entire ide
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Cannot update Intellij on linux: FileAlreadyExistsException
4 participants