nanu-c / crayfish

Other
2 stars 5 forks source link

error: failed to get `libsignal-protocol` #1

Open morph027 opened 3 years ago

morph027 commented 3 years ago

Trying to build the version mentioned in latest signal app release, i've got the following error:

root@487655ab2d33:/tmp/textsecure/cmd/textsecure/crayfish# cargo build
    Updating crates.io index
    Updating git repository `https://github.com/whisperfish/libsignal-service-rs.git`
    Updating git repository `https://github.com/signalapp/libsignal-client`
error: failed to get `libsignal-protocol` as a dependency of package `libsignal-service v0.1.0 (https://github.com/whisperfish/libsignal-service-rs.git?rev=34b9e43#34b9e43d)`
    ... which is depended on by `crayfish v0.1.0 (/tmp/textsecure/cmd/textsecure/crayfish)`

Caused by:
  failed to load source for dependency `libsignal-protocol`

Caused by:
  Unable to update https://github.com/signalapp/libsignal-client

Caused by:
  failed to find branch `master`

Caused by:
  cannot locate remote-tracking branch 'origin/master'; class=Reference (4); code=NotFound (-3)
morph027 commented 3 years ago

One step further with this change in my local checkouts:

root@487655ab2d33:~/.cargo/git/checkouts/libsignal-service-rs-e91a0c40cab55da9/34b9e43# git diff
diff --git a/libsignal-service/Cargo.toml b/libsignal-service/Cargo.toml
index 002664c0..f00f8a3c 100644
--- a/libsignal-service/Cargo.toml
+++ b/libsignal-service/Cargo.toml
@@ -7,7 +7,7 @@ license = "GPLv3"
 readme = "../README.md"

 [dependencies]
-libsignal-protocol = { git = "https://github.com/signalapp/libsignal-client" }
+libsignal-protocol = { git = "https://github.com/signalapp/libsignal-client", branch="main" }
 zkgroup = { git = "https://github.com/signalapp/zkgroup", tag = "v0.7.3" }
 async-trait = "0.1.30"
 url = { version = "2.1.1", features = ["serde"] }
morph027 commented 3 years ago

Okay, rust was a bit old, updated rust, now the diff looks like

root@487655ab2d33:~/.cargo/git/checkouts/libsignal-service-rs-e91a0c40cab55da9/34b9e43# git diff
diff --git a/libsignal-service/Cargo.toml b/libsignal-service/Cargo.toml
index 002664c0..be042bd5 100644
--- a/libsignal-service/Cargo.toml
+++ b/libsignal-service/Cargo.toml
@@ -7,7 +7,7 @@ license = "GPLv3"
 readme = "../README.md"

 [dependencies]
-libsignal-protocol = { git = "https://github.com/signalapp/libsignal-client" }
+libsignal-protocol = { git = "https://github.com/signalapp/libsignal-client", tag="v0.9.6" }
 zkgroup = { git = "https://github.com/signalapp/zkgroup", tag = "v0.7.3" }
 async-trait = "0.1.30"
 url = { version = "2.1.1", features = ["serde"] }

according to https://github.com/whisperfish/libsignal-service-rs/issues/114

nuehm-arno commented 3 years ago

One question: What's the advantage of tag="v0.9.6" instead of "main" regarding libsignal-client?

jonnius commented 3 years ago

Looks like libsignal-client has renamed their master branch to main and cargo seems to assume master as the master branch name. libsignal-service should reference a specific version of libsignal-client and not just main, because you don't want to get a different result every time you build. It might break your build at any time or change its behaviour. You rather want to control when to change to a newer version of your dependency and apply changes at that time if necessary.

nuehm-arno commented 3 years ago

Fair point. Thanks for the explanation!

rubdos commented 2 years ago

Looks like libsignal-client has renamed their master branch to main and cargo seems to assume master as the master branch name. libsignal-service should reference a specific version of libsignal-client and not just main, because you don't want to get a different result every time you build. It might break your build at any time or change its behaviour. You rather want to control when to change to a newer version of your dependency and apply changes at that time if necessary.

It's customary to have Cargo.lock on application level, but in this case it sounds fair to just pin to a rev or tag in libsignal-service's Cargo.toml. I have pinned v0.11.0, the tag of 11 days ago. This didn't seem to break the tests in libsignal-service, so I hope this is fine with you folks too!

In the future, feel free to @mention me by the way, that way I get a notification that someone's having issues with this.