4 ms·
(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
by davidvartan 7y 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/11649e49892d8175470bf992661d6410cd9ead1d/src/main.rs#L11-L26 https://github.com/akeru-inc/xcnotary/blob/11649e49892d81754...
[2] https://github.com/akeru-inc/xcnotary/blob/11649e49892d8175470bf992661d6410cd9ead1d/src/notarize/run.rs#L182-L192 https://github.com/akeru-inc/xcnotary/blob/11649e49892d81754...
- tedmielczarek 7y agoVery 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.
- saagarjha 7y ago> we had switched Mac Firefox builds to cross-compile from Linux Did you link against TBD files?
- davidvartan 7y agoThat 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.
- detaro 6y ago> 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?
- tedmielczarek 6y agoIt'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 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/72e3388f74458d369af4f6cdbaeaacb719523b8c/build/macosx/cross-mozconfig.common 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.
- deleted 7y ago[deleted]