-
Notifications
You must be signed in to change notification settings - Fork 29
Throw a better error when trying to install with musl-libc #149
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
tool/utils.ts
Outdated
if (process.platform !== 'linux') return; | ||
|
||
const executable = await fs.readFile(process.execPath); | ||
if (!executable.includes('libc.musl-x86_64.so.1')) return; |
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.
We should also consider aarch64 as well as other archs here.
- libc.musl-x86_64.so.1
- libc.musl-aarch64.so.1
- libc.musl-armv7.so.1
- libc.musl-armhf.so.1
- etc.
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'm not intimately familiar with what strings those are likely to leave in the executable. Can you give me a list of strings to search for?
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.
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.
Would it make sense to check against '/lib/ld-musl-'
and '/lib/libc.musl-'
so it works regardless of architecture?
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.
It is extremely rare but multiple ld/libc can be installed in the same system at non-standard locations, so searching with /lib/
might miss some rare cases. If we want good performance in searching, libc.musl-
is probably the best.
No description provided.