-
Notifications
You must be signed in to change notification settings - Fork 43
Proper executable check on Unix #852
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I believe this is a step in the right direction.
Cesium.Sdk/FileInterop.cs
Outdated
|
||
internal static class FileInterop | ||
{ | ||
internal const string SystemNative = "libSystem.Native"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am concerned with the use of this library. As it looks to me, it's some undocumented implementation detail of the .NET runtime, right? Can we rely on libc
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course, but we need processing Stat call manually. In runtime source I've found how I need to impl this. I try to impl this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is implementation of call from the runtime sources: https://github.com/dotnet/runtime/blob/5a4b89cc8dc951b12c3a40bb343aac44f32fd040/src/native/libs/System.Native/pal_io.c#L234
Okay, It sill dosen't work with MacOS. It works with only directories, on files it crashes. Maybe is error in the tests or in invalid path? |
That is works with File.GetUnixFileMode() |
3ab8ccb
to
db9393b
Compare
… struct annotation. Add logging for tests
…l access() This restores the macOS compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much!
Closes #840
Unfortunately, I haven't found ready-made solutions that are compatible with netstandard 2.0 and SDK project.
It perfectly works with Linux systems (tested on WSL and github runners). But the
LStat
function return -1 on MacOS fordotnet
file, for directories it works.Here are logs for MacOS: