You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking through a few other errors, I suspect this may be because I'm using a nix-installed cargo:
$ type -p cargo/run/current-system/sw/bin/cargo
If the xcode build scripts are trying to call cargo commands, my recollection is that xcode won't necessarily have cargo in its path; some people also search for a rustup-installed cargo at ~/.cargo/bin or a brew-installed cargo at /opt/homebrew/bin (or /usr/local), but there are other possibilities.
Hey thank you for submitting this! And apologies for slow response.
We use Mozilla's uniffi to help with the bindings generation. To help with version matching, we build the tool as a binary within the shared crate (see https://github.com/redbadger/crux/blob/master/examples/counter/shared/src/bin/uniffi-bindgen.rs), and your script seems to be failing because it can't find this uniffi executable (rather than the cargo executable). I'm not too familiar with nix, but it may be that you need to edit the script to point to the built uniffi binary.
Hope this helps, but LMK if you're still struggling.
Thanks
With these two small fixes the iOS project builds and runs.
Because these will only affect a fairly niche set of users I don't think any code changes on crux's side are indicated, hopefully this issue will help if others run into similar issues. Will update the title for better searchability.
n8henrie
changed the title
Unable to build counter example for iOS
Xcode fails to inherit PATH and therefore fails to find nix-installed cargo
Nov 16, 2023
I've successfully run
cargo build --package shared && cargo build --package shared_types
and opened the project in xcode.In Xcode, attempting to build gives multiple errors, the first of which is:
Looking through a few other errors, I suspect this may be because I'm using a nix-installed cargo:
If the xcode build scripts are trying to call cargo commands, my recollection is that xcode won't necessarily have
cargo
in its path; some people also search for a rustup-installed cargo at~/.cargo/bin
or a brew-installed cargo at/opt/homebrew/bin
(or/usr/local
), but there are other possibilities.Maybe related: #83
The text was updated successfully, but these errors were encountered: