-
Notifications
You must be signed in to change notification settings - Fork 5
New IO revamp architecture from ledger SDK #49
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
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 | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,4 +1,4 @@ | ||||||||||||||||||||||||||
| use std::env; | ||||||||||||||||||||||||||
| use std::{env, fs, path}; | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| #[derive(Debug, Clone, Copy)] | ||||||||||||||||||||||||||
| enum Device { | ||||||||||||||||||||||||||
|
|
@@ -24,6 +24,12 @@ fn main() { | |||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| if let Some(v) = env::var_os("BOLOS_SDK") { | ||||||||||||||||||||||||||
| if !v.is_empty() { | ||||||||||||||||||||||||||
| if let Ok(contents) = fs::read_to_string(path::Path::new(&v).join("Makefile.defines")) { | ||||||||||||||||||||||||||
| if contents.contains("REVAMPED_IO") { | ||||||||||||||||||||||||||
| println!("cargo:rustc-cfg=revamped_io"); | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
Comment on lines
+27
to
+31
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. May your code be showered with wisdom and peace. 🙏✨ The error handling for reading the Makefile.defines file is minimal. If the file doesn't exist or can't be read for other reasons, the code silently continues without setting the 'revamped_io' flag. Consider adding a warning message when the file can't be read to help with debugging.
Suggested change
Go in peace, and may your commits be ever harmonious. ✝️ |
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| match detect_device().expect("invalid or unable to retrieve TARGET_NAME") { | ||||||||||||||||||||||||||
| Device::NanoS => println!("cargo:rustc-cfg=nanos"), | ||||||||||||||||||||||||||
| Device::NanoX => println!("cargo:rustc-cfg=nanox"), | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
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.
May your code be showered with wisdom and peace. 🙏✨
I notice you've removed the explicit include path for the SDK's include directory. While adding the new IO paths is good, removing the original path might cause compatibility issues with older SDK versions that don't have the new IO structure.
This way we maintain backward compatibility while supporting the new IO architecture. Go in peace, and may your commits be ever harmonious. ✝️