Repository navigation
#2467: fix Obsidian installation on macOS/Linux and duplicate linux_x64 URL - #2610
Ali-Shariati-Najafabadi wants to merge 10 commits into
Conversation
…sidian-install-macos-linux # Conflicts: # CHANGELOG.adoc # cli/src/main/java/com/devonfw/tools/ide/tool/GlobalToolCommandlet.java
Coverage Report for CI Build 41042684914Coverage decreased (-0.01%) to 75.278%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions25 previously-covered lines in 2 files lost coverage.
Coverage Stats💛 - Coveralls |
laim2003
left a comment
There was a problem hiding this comment.
Hi @Ali-Shariati-Najafabadi, thanks for your PR! However, there are still some issues with the installation on Linux:
lukasfaber@LDE-1H862128LW:~/projects/ideasy/workspaces/main/IDEasy$ ide install obsidian
No CVEs found for version 1.14.4 of tool obsidian.
Trying to download obsidian-1.14.4-linux-x64.deb from https://github.com/obsidianmd/obsidian-releases/releases/download/v1.14.4/obsidian_1.14.4_amd64.deb
Downloading 100% │███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████│ 103/103MiB (0:00:06 / 0:00:00) 17.2MiB/s
SHA-256 checksum 85b10dcba6edfc1c0460a6d18260cf31c30447a444bd858a6440b9c9c8806d25 is correct.
Logfile can be found at /home/lukasfaber/projects/_ide/logs/2026/10/15/ideasy-ide-install-13-14-00.log
An unexpected error occurred!
We are sorry for the inconvenience.
Please check the error below, resolve it and try again.
If the error is not on your end (network connectivity, lack of permissions, etc.) please file a bug:
https://github.com/devonfw/IDEasy/issues/new?template=bug_report.yml&title=IllegalStateException%3A+Unknown+archive+format+deb.+Can+not+extract+%2Fhome%2Flukasfaber%2FDownloads%2Fide%2Fdefault%2Fobsidian-1.14.4-linux-x64.deb
java.lang.IllegalStateException: Unknown archive format deb. Can not extract /home/lukasfaber/Downloads/ide/default/obsidian-1.14.4-linux-x64.deb
at com.devonfw.tools.ide.io.FileAccessImpl.extract(FileAccessImpl.java:739)
at com.devonfw.tools.ide.io.FileAccess.extract(FileAccess.java:199)
at com.devonfw.tools.ide.io.FileAccess.extract(FileAccess.java:189)
at com.devonfw.tools.ide.tool.obsidian.Obsidian.installLinux(Obsidian.java:117)
at com.devonfw.tools.ide.tool.obsidian.Obsidian.doInstall(Obsidian.java:82)
at com.devonfw.tools.ide.tool.AbstractToolCommandlet.install(AbstractToolCommandlet.java:353)
at com.devonfw.tools.ide.commandlet.InstallCommandlet.doRun(InstallCommandlet.java:89)
at com.devonfw.tools.ide.commandlet.AbstractCommandlet.run(AbstractCommandlet.java:237)
at com.devonfw.tools.ide.context.AbstractIdeContext.applyAndRun(AbstractIdeContext.java:1535)
at com.devonfw.tools.ide.context.AbstractIdeContext.run(AbstractIdeContext.java:1308)
at com.devonfw.tools.ide.cli.Ideasy.runOrThrow(Ideasy.java:92)
at com.devonfw.tools.ide.cli.Ideasy.run(Ideasy.java:56)
at com.devonfw.tools.ide.cli.Ideasy.main(Ideasy.java:138)
at java.base@25.0.2/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)
Error: IDEasy failed with exit code 255
The issue is that the existing URLs repository still containts the "old" *.deb link. See my inline comments below to understand why we should probably keep the installation via the *.deb files.
There was a problem hiding this comment.
Suggestion: instead of converting or installing via .tar.gz, download and install the existing .deb package and let the system package manager handle installation.
Concretely:
- Use the .deb artifact (as the previous URL-updater did) rather than producing or installing a .tar.gz.
- Install the downloaded .deb with the platform tools (for example
apt install ./package.debordpkg -i package.debfollowed byapt-get -f install) so the package manager resolves dependencies, sets permissions, and registers the package correctly. - Fall back to a tarball only if no official .deb is available.
This keeps installation and uninstallation consistent with the Linux platform and other Tools that also have *.deb file installations (e.g. Docker), uses package metadata correctly, and avoids reinventing package-management behavior in the installer. See the related discussion here: #2362 (comment)
There was a problem hiding this comment.
I'd keep the tarball. There is no arm64 .deb (only amd64), so the tarball path is needed anyway, and with the .deb first we would have two install and uninstall paths plus sudo, which also doesn't work on non-Debian distros.
The error in your log comes from ide-urls: linux_x64 still points to the .deb there for 28 of 29 versions. The updater can't add the tar.gz to that urls file because the checksum differs from the one stored for the .deb, and it only removes URLs that are broken for a long time. So the old linux_x64 files for obsidian in ide-urls have to be cleaned up either way.
If you still prefer .deb first with the tarball as fallback, tell me and I will rework it like Docker.
There was a problem hiding this comment.
The error in your log comes from ide-urls: linux_x64 still points to the .deb there for 28 of 29 versions. The updater can't add the tar.gz to that urls file because the checksum differs from the one stored for the .deb, and it only removes URLs that are broken for a long time. So the old linux_x64 files for obsidian in ide-urls have to be cleaned up either way.
You're right, that is probably the better way to do it. However in that case, we should cleanup the URLs in the ide-urls repository before merging this PR, otherwise we will again break this feature for existing users.
If you still prefer .deb first with the tarball as fallback, tell me and I will rework it like Docker.
no, I think we should do it like you said in the comment.
There was a problem hiding this comment.
Agreed, thanks. The cleanup is needed for the 28 obsidian versions that still have the .deb in linux_x64 (all but 1.6.5). I would replace the content instead of deleting: put the tar.gz URL into linux_x64.urls and its checksum into linux_x64.urls.sha256. Then it works with the old and the new updater and there is no gap for Linux. Just deleting would leave Linux without a URL until the next run, and a run with the old code would add the .deb again. I have no write access to ide-urls, could you or one of the maintainers do it? I can prepare the list with URLs and checksums.
There was a problem hiding this comment.
yes I can do that, just send me the list via Teams or paste it here
…sidian-install-macos-linux # Conflicts: # cli/src/main/java/com/devonfw/tools/ide/tool/GlobalToolCommandlet.java
This PR fixes #2467
Implemented changes:
ObsidianUrlUpdater: only thetar.gzarchive is registered forLINUX/X64(the.debregistration was dropped), so x64 and arm64 use the same artifact type and no package manager is needed.Obsidianon macOS: theObsidian.appbundle is taken out of the DMG and persisted in~/Applications/Obsidian.appinstead of being executed once from a temp dir and deleted (this also fixes thePermission deniederror from the issue comment). The installed version is read fromContents/Info.plist.Obsidianon Linux: the archive is extracted and persisted in~/.local/share/obsidian, the installed version is recorded in.ide.software.version.uninstallremoves that folder.getInstalledVersion()), so a repeated install is skipped, and the tool is launched from the persisted installation.GlobalToolCommandlet.findMacApplicationBundle()is nowprotectedand looks into~/Applicationsfirst, then/Applications. Note: this also affects the macOS uninstall of other global tools (Docker, pgAdmin) if a bundle exists in both folders.Testing instructions
mvn -Dtest=ObsidianTest testincliandmvn -Dtest=ObsidianUrlUpdaterTest testinurl-updater.ide install obsidian:~/Applications/Obsidian.appexists afterwards andide obsidianlaunches it. Runningide install obsidianagain reports that the version is already installed.ide install obsidian:~/.local/share/obsidian/obsidianexists afterwards andide obsidianlaunches it.ide uninstall obsidianon both: the installation is removed.Note: the real installation on macOS/Linux (steps 2-4) has not been verified manually yet, only via the automated tests with mocked downloads.
Checklist for this PR
Make sure everything is checked before merging this PR. For further info please also see
our DoD.
mvn clean testlocally all tests pass and build is successful#«issue-id»: «brief summary»(e.g.#921: fixed setup.batand notfeature/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
internalpom.xmlfiles or otherwise if runtime dependencies changed, you have updated our LICENSE.asciidoc