-
Notifications
You must be signed in to change notification settings - Fork 43
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
Pattern match the linux x86_64 clang directory #975
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.
LGTM - seems like a robust way to fix different paths in different NDKs.
Small NIT.
libs/sdk-bindings/build.rs
Outdated
println!("cargo:rustc-link-lib=static=clang_rt.builtins-x86_64-android"); | ||
} else { | ||
panic!("Path {linkpath} not exists. Try setting the NDK_CLANG_VERSION environment variable."); | ||
match glob(&linux_x86_64_lib_pattern)?.last() { |
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.
NIT: Since we already panic at this function perhaps using unwrap here instead of changing the method prototype?
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.
Done
d85c2e4
to
617df2e
Compare
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.
LGTM
println!("cargo:rustc-link-lib=static=clang_rt.builtins-x86_64-android"); | ||
} else { | ||
panic!("Path {linkpath} not exists. Try setting the NDK_CLANG_VERSION environment variable."); | ||
match glob(&linux_x86_64_lib_pattern).unwrap().last() { |
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.
Looks good. I have a nit that may not be useful. This might not always take the latest clang version if multiple are available. (Is that even ever the case?). (Do we even need the latest version?). Anyway, v9.0.0 will be the 'last' if v10.0.0 is also available, because the results from the glob are sorted alphabetically.
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.
The clang version is in the double-digits, so that won't be a problem for a while.
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.
The clang version is in the double-digits, so that won't be a problem for a while.
Yeah true only minor and patch versions maybe.
This PR uses glob in the build to pattern match the linux x86_64 clang directory