Add Linux X64 and Arm64 support for filekit-core - #621
Merged
Conversation
- absolutePath() no longer routes through SystemFileSystem.resolve, which
threw FileNotFoundException for relative paths of files that do not exist.
This broke `write`/`copyTo` on any relative destination, since
isSameLogicalFileAs() calls absolutePath() before the file is created.
It now resolves against getcwd(), matching JVM and Windows native.
- mimeType() returned null unconditionally. It now reads the freedesktop.org
shared-mime-info database, falling back to /etc/mime.types, cached lazily.
- Fix ktlint violations that were failing the CI lint job (import ordering,
argument list wrapping, max line length, consecutive blank lines).
- Drop redundant .toLong() conversions on st_ctim/st_mtim and the unused
withContext import; document why st_ctim is used for createdAt().
- Honour the XDG Base Directory rule that XDG_* variables are ignored unless
they hold an absolute path.
- Replace findByName("linuxMain")?.dependsOn(...) with linuxMain.get() so a
missing source set fails loudly instead of silently skipping desktopMain.
- Add a linuxX64Test CI job so the new targets are actually exercised, plus
Linux specific absolutePath() regression tests.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…tests Rebased onto main (80b901d), which added two expect declarations in vinceglb#625 that Linux had no actual for, so the merge no longer compiled: - withPath() in jvmAndNativeMain - resolveBookmarkData() in nonWebMain, replacing the old fromBookmarkData shape Both are now implemented, mirroring mingwX64. createdAt() no longer reports st_ctim. That is the inode status change time and is updated by writes and chmod, so it was reporting a fabricated creation time. Linux only exposes birth time via statx(STATX_BTIME), which Kotlin/Native does not bind and which several filesystems do not support, so null is returned. See https://man7.org/linux/man-pages/man7/inode.7.html MIME lookup now honours the globs2 `cs` flag, so case sensitive entries such as `*.C:cs` (C++ source) no longer collide with `*.c` (C source). Compound globs like `*.tar.gz` stay excluded on purpose: `extension` is the segment after the last dot, so registering them under "gz" would shadow the correct entry. filesDir/cacheDir no longer fall back to relative `.local/share` and `.cache` when HOME is unset, which could plant application data in the working directory. The passwd database is consulted first and a FileKitException is thrown if no absolute home can be resolved. Also: - Make the globs2 and mime.types parsers pure functions over their content so the matching rules are unit testable rather than host dependent. - Collapse the two duplicated FileKitUserDirectory switches into extension properties so XDG keys and folder names cannot drift. - Expand linuxTest to 25 tests covering timestamps, bookmarks, MIME matching, FileKit initialization and directory resolution; rename to the documented Subject_action_expectation convention. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
vinceglb
force-pushed
the
feature/linux-support
branch
from
July 29, 2026 16:07
4df392c to
38f2b08
Compare
vinceglb
approved these changes
Jul 30, 2026
vinceglb
left a comment
Owner
There was a problem hiding this comment.
Hi @nik1062, thank you very much for working on this and for bringing Linux Native support to FileKit!
I made a few changes:
- Improved MIME type detection
- Reused the existing XDG directory logic
- Completed the documentation for
filekit-coreLinux Native support
Thanks again for your contribution 🙏
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds
linuxX64andlinuxArm64native targets forfilekit-coreand implements the requiredPlatformFileandFileKitnative Linux APIs using standard POSIX functions. #609