-
-
Notifications
You must be signed in to change notification settings - Fork 396
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
PathRef fails for socket files (was: GenIdea/idea and Bloop/install both fail for VirtusLab/scala-cli) #1875
Comments
Looks like the I wonder whether |
Yeah, I can reproduce with: import mill._
def socketfile = T{
PathRef(T.workspace)
} Output:
|
Unfortunately, I can't tell how to detect socket files. We already check for regular, existing, readable files and still get the exception. Unless someone comes up with a proper implementation to detect socket files, the only thing we can do is to gracefully ignore the content of unreadable files or avoid using the project directory in |
not sure what you mean by can't check for socket files. that info isn't returned by a linux 'stat' system call? |
Sure, |
… On Mon, May 16, 2022 at 9:55 AM Tobias Roeser ***@***.***> wrote:
not sure what you mean by can't check for socket files. that info isn't
returned by a linux 'stat' system call?
Sure, stat has this information, but I think calling a system specific
tool for each file we find is a bit expensive and platform specific. What I
meant is, I don't know how to get this information with Java API.
—
Reply to this email directly, view it on GitHub
<#1875 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAYG2KDTR5YGJLU2S7C26LVKJHWDANCNFSM5V7TVAPQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I don't know yet. Do you mean a specific snippet? Beside some custom socket detection for docker, I couldn't spot any example for cross-platform socket detection. |
i have no idea if windows has the equivalent functionality. wouldn't you
rather work correctly on two of three?
… Message ID: ***@***.***>
|
sorry, "two out of three"?
…On Mon, May 16, 2022 at 6:56 PM Mark Kennedy ***@***.***> wrote:
i have no idea if windows has the equivalent functionality. wouldn't you
rather work correctly on two of three?
> Message ID: ***@***.***>
>
|
Sure, properly supporting some platforms is a nice intermediate step, yet the link you provided does not show how to do it. We want to detect arbitrary socket files, and the documentation of |
When creating a `PathRef` of a path that contains socket files, which is for example the case if the path contains the `out` directory of Mill, Mill is failing because it can't read the socket file to calculate the content digest. We already skip digesting of unreadable files but somehow those socket files are not marked as unreadable. There is no performant and platform neutral way to detect socket files, so this PR just catches the typical `FileSystemException` at `InputStream` creation time and gracefully handles it (like other unreadable files) by just ignoring its content. * Fix #1875 * Fix #823 Pull request: #1878
i look into this some more and you're absolutely right. no way to check it! interesting omission. thanks for the free lesson! |
i'm not sure if this is a bug in mill or in scala-cli's build.sc. but even if it is a scala-cli build.sc bug, the mill error messages don't provide any useful info.
a few weeks ago, both of these targets began to fail reliably. i verified this from a brand new empty linux ID with no ~/.config nor ~/.local directory. i did a "git clean -dfx" and removed any lingering java processes with the help of 'jps' before running either failing command.
i git bisect'ed the problem and found that the first bad commit was VirtusLab/scala-cli@e114105 and the last good commit was VirtusLab/scala-cli@ced5e0d.
i don't know enough mill to know whether this change is problematic or not but it doesn't seem like it would be.
i'm attaching a log from the invocation of each command.
fail.log
The text was updated successfully, but these errors were encountered: