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

Windows javalib fileKey appears to always be NULL #3909

Open
LeeTibbert opened this issue May 7, 2024 · 2 comments
Open

Windows javalib fileKey appears to always be NULL #3909

LeeTibbert opened this issue May 7, 2024 · 2 comments

Comments

@LeeTibbert
Copy link
Contributor

LeeTibbert commented May 7, 2024

The assertion added in PR #3064 appears to always return NULL on Windows
even though there is code in WindowsDosFileAttributeView.scala which appears
to intend that a useful (i.e. non-null) fileKey be returned.

 val d0fkey = Files.getAttribute(d0, "fileKey")
 assertNotNull("fileKey: directory", d0fkey)

I do not have access to a Windows development machine and have gone as far as I can
doing opaque crash-and-burn testing on CI.

For now, I am noting this and hacking around it in the tests and my real task, SystemFileSystemLoop detection.

LeeTibbert added a commit to LeeTibbert/scala-native-fork that referenced this issue May 7, 2024
@LeeTibbert LeeTibbert changed the title Windows posixlib fileKey appears to always be NULL Windows javalib fileKey appears to always be NULL May 7, 2024
@LeeTibbert
Copy link
Contributor Author

From scratching around for way longer than I wanted to, it appears that always-NULL fileKeys are a thing
in Windows.

I'll leave this Issue open for a few days to see if anybody can add information or confirm that Windows
fileKeys are always null, then I will close it for tidy housekeeping.

@LeeTibbert
Copy link
Contributor Author

I have neither access to a Windows machine nor skill to use it if I did. So I am peeking inside a Schrödinger box
and trying to understand what is going on inside.

The problem that I am experiencing with null fileKeys on Windows may be because I am using BasicFileAttributes#fileKey
rather than DosFileAttributes. The latter extends the former, so if the latter has valid files keys, the former should
also (unless there is some trickiness going on). From the code, It looks like the latter provides valid keys, but they seem to
never get to BasicFileAttributes.

Given the recent work in merged PR #3917, I can workaround this.

It would be nice to know/understand if fileKeys are always null on Windows. That wish is backed up behind
many more relevant desires.

WojciechMazur pushed a commit that referenced this issue May 20, 2024
* fix: javalib posix fileKeys are now unique
* Various small unix touch-ups; no Windows progress yet
* Windows debugging run
* Revert Windows DEBUG; bypass always null fileKeys on Windows, see Issue #3909
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant