Hacker News new | ask | show | jobs
by davidvartan 2275 days ago
(The author.) I had originally written a version of this in Python for my own use, and recently thought of rewriting it in Rust as a learning experience.

What I found is that writing a CLI in Rust is a absolute breeze, in part due to excellent documentation and the tooling, and also thanks to various well-maintained crates, such as StructOpt [1] to parse command line arguments of any complexity, or indicatif [2] to show animated progress.

[1] https://github.com/akeru-inc/xcnotary/blob/11649e49892d81754...

[2] https://github.com/akeru-inc/xcnotary/blob/11649e49892d81754...

1 comments

Very cool! Tangentially related, I looked into reimplementing `codesign` in Rust while I was at Mozilla. We wanted to see if we could take Apple hardware out of the loop for our release process after we had switched Mac Firefox builds to cross-compile from Linux. I got a bunch of code written and I'm pretty sure I could have made it work if I had gotten the go-ahead to spend time on it but then we heard about notarization and decided it wasn't worth the effort since Apple was going to require us to use their service anyway.
That sounds like a fun project! I do hope Apple shows more love to the command line tooling in general (even if Mac-only) as the workflow still seems somewhat optimized for clicking one-by-one in Xcode.
> after we had switched Mac Firefox builds to cross-compile from Linux

Do you happen to have a link with more details about how that's done?

It's not really written down anywhere but you can see the gory history of how we got it together in bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=921040

We used the MacOSX SDK from Xcode, packaged up into our internal file store for build machines to use and passed a bunch of compiler options that clang sets by default when you're compiling on macOS: https://searchfox.org/mozilla-central/rev/72e3388f74458d369a...

Getting DMG creation working was a bit of a hassle but we managed to get it done with some dmg/hfsplus tools from the iPhone jailbreak scene.

> we had switched Mac Firefox builds to cross-compile from Linux

Did you link against TBD files?