Skip to content

Rust Installer #291

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

Merged
merged 27 commits into from
May 16, 2025
Merged

Rust Installer #291

merged 27 commits into from
May 16, 2025

Conversation

gaykitty
Copy link
Collaborator

@gaykitty gaykitty commented Apr 23, 2025

STATUS: Ready to merge

Copy link
Collaborator

@wgreenberg wgreenberg left a comment

Choose a reason for hiding this comment

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

i really like this approach, since afaict it means we can ship the entire release as a single platform-specific binary. just have a few questions/comments in my review

@gaykitty gaykitty force-pushed the rust-installer branch 7 times, most recently from 0fcf380 to fd05825 Compare April 25, 2025 23:57
@gaykitty gaykitty marked this pull request as ready for review April 26, 2025 00:06
@gaykitty gaykitty requested a review from wgreenberg April 26, 2025 00:06
@gaykitty gaykitty marked this pull request as draft April 26, 2025 00:07
@oopsbagel
Copy link
Collaborator

It would help reviewing if, since this is replacing serial, you started from git mv serial/src/main.rs installer/src/orbic.rs so the diff is helpful (and the history is intact, helpful to know if I introduced a bug with the nusb port or it was extant before, etc).

@gaykitty
Copy link
Collaborator Author

It would help reviewing if, since this is replacing serial, you started from git mv serial/src/main.rs installer/src/orbic.rs so the diff is helpful (and the history is intact, helpful to know if I introduced a bug with the nusb port or it was extant before, etc).

Done.

@gaykitty
Copy link
Collaborator Author

Made several of the requested changes except for those I've replied to with questions.

@gaykitty gaykitty changed the title WIP Rust Installer Rust Installer Apr 27, 2025
untitaker and others added 6 commits May 14, 2025 02:41
We've confirmed nusb works so I've merged it into the rayhunter branch.
* explicitly mount the SD card to improve reliability
* do not crash when the SD card is already mounted
* address some review feedback
@gaykitty
Copy link
Collaborator Author

I made adb_client usb libusb on macOS and Windows. Reporting the usb device is busy needs to be fixed if we go with this.

gaykitty added 3 commits May 14, 2025 22:52
This update also fixes libusb throwing timeouts when it shouldn't
On macOS this can mean the device is busy.
@gaykitty gaykitty force-pushed the rust-installer branch 3 times, most recently from f2a7bdd to 841f5c2 Compare May 16, 2025 03:56
@gaykitty
Copy link
Collaborator Author

As requested I removed the vendor flag, now the firmware binaries are always vendored from the proper location.

Copy link
Collaborator

@oopsbagel oopsbagel left a comment

Choose a reason for hiding this comment

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

Bang up job 👍 👍

Tested successfully on:

  • target.aarch64-apple-darwin
  • target.aarch64-unknown-linux-musl
  • target.x86_64-apple-darwin
  • target.x86_64-unknown-linux-musl

Copy link
Collaborator

@untitaker untitaker left a comment

Choose a reason for hiding this comment

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

i re-tested it now on tplink v3 and orbic on linux, works great. macos worked great for me yesterday too.

let binary = include_dir.join(file);
if !binary.exists() {
println!(
"cargo::error=Firmware binary {file} not present at {}",
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does the build script do as opposed to directly including the binaries?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It allows us to conditionally set environment vars that point to the binaries. So in CI we can set vars for their locations, but in a dev environment, it'll automatically pull them in from where you'd expect. And by using CARGO_MANIFEST_DIR your current directory when building doesn't matter.

@cooperq cooperq merged commit d6e4f6a into EFForg:main May 16, 2025
19 checks passed
@cooperq
Copy link
Collaborator

cooperq commented May 16, 2025

This is now merged! Thank you so much @gaykitty for all your hard work on this! And thanks to everyone that reviewed or helped out! This is huge!

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.

5 participants