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

find command uses GNUisms, causing issues in FreeBSD (& presumably other non-Linux OSes) #425

Open
darkuranium opened this issue Jan 9, 2025 · 4 comments

Comments

@darkuranium
Copy link

I ran into this issue while running Pylon in FreeBSD:

Process terminated with code 1, find: illegal option -- O

I couldn't narrow down the root cause upon a (somewhat) quick check, and fortunately, a workaround exists (install gfind, and then ln -s /usr/local/bin/gfind ~/.local/bin/find).

Still, I figured I might as well bring this up.

@Kreijstal
Copy link

in which line is this executed?

@darkuranium
Copy link
Author

That's the part I couldn't find. But since you seem interested, I can try giving it another go.

Seems to happen when the client connects.

@Kreijstal
Copy link

what does git grep says?

@darkuranium
Copy link
Author

darkuranium commented Jan 10, 2025

FOUND IT!

https://github.com/pylonide/pylon/blob/master/plugins-server/pylon.ide.filelist/filelist.js#L91

Note that FreeBSD also has the -E option for find, so you can also add that platform to the list.

A more reliable way might be to run find --version --- gfind will yield a result, whereas FreeBSD's will error out. Not sure about Darwin's, but even if it doesn't error out, you should be able to parse the version.

Or --- this is hacky, but should be even more reliable --- you use something akin to find -O3 $APPDIR/test (replace $APPDIR/test with any nearly-empty1 directory, in this case, you'd probably make it in JS anyway) ... any errors here means it's either not GNU Find, or the system is horribly broken anyway.

Footnotes

  1. Nearly-empty for performance reasons; it otherwise technically doesn't matter, as long as find doesn't run into any "permission denied" problems or such.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants