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

Improve the performance of detecting linux-musl platform by parsing ELF #315

Merged
merged 3 commits into from
Aug 1, 2024

Conversation

ntkme
Copy link
Contributor

@ntkme ntkme commented Jul 31, 2024

Closes #314

@ntkme ntkme force-pushed the elf branch 5 times, most recently from 20a9c23 to cdc080f Compare July 31, 2024 15:44
lib/src/elf.ts Outdated Show resolved Hide resolved
lib/src/elf.ts Outdated Show resolved Hide resolved
lib/src/elf.ts Outdated Show resolved Hide resolved
lib/src/elf.ts Outdated Show resolved Hide resolved
lib/src/elf.ts Outdated Show resolved Hide resolved
lib/src/elf.ts Outdated Show resolved Hide resolved
lib/src/elf.ts Outdated Show resolved Hide resolved
lib/src/elf.ts Outdated Show resolved Hide resolved
lib/src/elf.ts Outdated Show resolved Hide resolved
lib/src/compiler-path.ts Outdated Show resolved Hide resolved
@ntkme ntkme force-pushed the elf branch 2 times, most recently from 947a0a0 to ce4166e Compare July 31, 2024 21:19
Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
@ntkme
Copy link
Contributor Author

ntkme commented Jul 31, 2024

I mostly reused the variable names from the linux kernel code: https://github.com/torvalds/linux/blob/HEAD/include/uapi/linux/elf.h. Idea here is for whoever going to work on this code they can refer to the kernel API document and find the reference without too much effort:

@nex3 Now I have renamed a few of them, and changed the snake case to camel case, let me know if you have any preferences on these naming.

@ntkme ntkme requested a review from nex3 July 31, 2024 21:48
@nex3
Copy link
Contributor

nex3 commented Jul 31, 2024

I think it's better to have explicit names than names that exactly match the kernel, especially since the explicit names are just expanded versions of the names from the kernel anyway so figuring out that they correspond won't be too hard for a reader. I'd also like to avoid single-letter affixes with unclear meaning like e, p, and z.

Copy link
Contributor

@nex3 nex3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@nex3 nex3 merged commit 9b5f08b into sass:main Aug 1, 2024
16 checks passed
@ntkme ntkme deleted the elf branch August 1, 2024 00:48
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

Successfully merging this pull request may close these issues.

More efficiently check for musl libc
2 participants