-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add the GetPlatformInfo action #55
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
fn main() { | ||
#[cfg(all(target_os = "linux", feature = "action-platform-info"))] | ||
{ | ||
println!("cargo:rerun-if-changed=src/action/libc_version.c"); | ||
|
||
cc::Build::new() | ||
.file("src/action/libc_version.c") | ||
.compile("liblibc_version.a"); | ||
} | ||
} | ||
Comment on lines
+1
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am affraid build script is not an option — this does not play well with our internal build infrastructure (for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, we can scrap the build script. The libc::gnu_get_libc_version function is now available in the standard library. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include <features.h> | ||
#ifdef __GNU_LIBRARY__ | ||
#include <gnu/libc-version.h> | ||
#else | ||
#include <stddef.h> | ||
#endif | ||
|
||
const char *libc_version(void) { | ||
#ifdef __GNU_LIBRARY__ | ||
return gnu_get_libc_version(); | ||
#else | ||
return NULL; | ||
#endif | ||
} | ||
Comment on lines
+1
to
+14
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the benefit over There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, excellent. I did not know that the gnu_get_* APIs were added recently |
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.
These seem like a quite heavy dependencies, I wonder if there is a way to avoid these. Moreover, I would prefer not to depend on anything that is not on crates.io because of our internal build infrastructure.