Skip to content
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

Flake does not build cli on Darwin #1661

Closed
TomMD opened this issue Oct 8, 2024 · 2 comments · Fixed by #1665
Closed

Flake does not build cli on Darwin #1661

TomMD opened this issue Oct 8, 2024 · 2 comments · Fixed by #1665
Labels
bug Something isn't working

Comments

@TomMD
Copy link
Contributor

TomMD commented Oct 8, 2024

What version are you using?

master branch.

What did you do?

git clone followed by nix develop.

What did you expect to see?

stellar, the binary, in my path.

What did you see instead?

Errors about libudev0 which is not something os-x would be using.

Suggestion/Context

PR #1534 added a nix flake but it seems to be Linux only despite the conversation suggesting otherwise. It also continues to call a local.sh despite conversation suggesting that would be removed.

The below diff makes the flake.nix work for darwin but needs effort to turn into a PR. Specifically, we need to detect the build target and selectively not include libudev0 and the nativeBuildInputs.

diff --git a/flake.nix b/flake.nix
index 3b826ee..53a628f 100644
--- a/flake.nix
+++ b/flake.nix
@@ -18,10 +18,13 @@
       with pkgs;
       {
         devShells.default = mkShell {
+          nativeBuildInputs = [
+            pkgs.darwin.apple_sdk.frameworks.SystemConfiguration
+          ];
           buildInputs = [
             openssl
             pkg-config
-            libudev-zero
+            # libudev-zero
             jq
             (rust-bin.stable.latest.default.override {
               extensions = [ "rust-src" ];
@@ -32,7 +35,6 @@
           ''
             echo "Using `nix --version`"
             alias stellar="cargo run --bin stellar --"
-            [ -f ./local.sh ] && source ./local.sh
             shell=$0
             shell=`basename $SHELL`
             source <(stellar completion --shell $shell)
@TomMD TomMD added the bug Something isn't working label Oct 8, 2024
@github-project-automation github-project-automation bot moved this to Backlog (Not Ready) in DevX Oct 8, 2024
@Ifropc
Copy link
Contributor

Ifropc commented Oct 8, 2024

That's a good point.
We need libudev for ledger signing to work (and it is required to build cli on Linux) -- this is coming from hidapi which is a downstream dependency
The flake has only been tested on Linux, sorry!
Please feel free to open PR to fix the flake for Mac.
I'll also try to fix it later this/next week

@TomMD
Copy link
Contributor Author

TomMD commented Oct 9, 2024

Fixed in #1665

@leighmcculloch leighmcculloch changed the title Stellar-cli does not build on Darwin Flake does not build cli on Darwin Oct 9, 2024
@Ifropc Ifropc linked a pull request Oct 9, 2024 that will close this issue
@github-project-automation github-project-automation bot moved this from Backlog (Not Ready) to Done in DevX Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants