-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
albyhub: init at 1.12.0 #368929
base: master
Are you sure you want to change the base?
albyhub: init at 1.12.0 #368929
Conversation
Here's my discovery notes on ldk-node-go, which is "Experimental Go bindings for LDK-node" repository at a glance:
The repository structure includes pre-compiled shared libraries (.so, .dll, .dylib) for different architectures and operating systems. In github.com/getAlby/hub the ldk_node package is imported as follows
Then in github.com/getAlby/hub there's a Dockerfile that essentially runs
It appears that the repository "github.com/getAlby/ldk-node-go" is providing Go bindings for a Rust library called LDK (Lightning Development Kit). Thus, albyhub/ldk-node-go/default.nix is used as a buildinput for albyhub/package.nix |
Here are my discovery notes on github.com/breez/breez-sdk-go repository at a glance:
The repository structure includes pre-compiled shared libraries (.so, .dll, .dylib) for different architectures and operating systems. In github.com/getAlby/hub the breez_sdk package is imported as follows
|
4793875
to
f30b509
Compare
Here's my discovery notes on github.com/getAlby/glalby-go which provides Go bindings for Greenlight. repository at a glance:
The repository structure includes pre-compiled shared libraries (.so, .dll, .dylib) for different architectures and operating systems. In github.com/getAlby/hub the glalby package is imported as follows
|
4936cdb
to
e55c6e2
Compare
If I've fixed the shared library loading then this error seems to suggest that I have mismatched library versions:
breez_sdk.go has bindings generated by something called "uniffi"
The notable difference here being Here's how we can find the commit (or version) that has
Actually, the smarter way to do this is probably to just look at go.mod
Which tells me I need to be using breez-sdk-go v0.5.2. I'll probably need to do this for all 3 shared libraries and for all updates moving forward so that we're shipping the same library versions as upstream. One way to confirm this is to use nm -D
This pointed me to a different issue in my local environment where it wasn't rebuilding the libraries as expected. |
1f7e118
to
e3e4277
Compare
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-ready-for-review/3032/5058 |
#369196
This turns out to be yarn + Go + CGO + shared libraries Nix derivation.
I used the Dockerfile as a starting point for how this is supposed to be built.
I wasn't able to use
autoPatchelfHook
to clean the RPATHs, the resulting binary would still have forbidden references to /build/. To clean the RPATHs I had to add a postInstall step withpatchelf --set-rpath "${lib.makeLibraryPath buildInputs}" $out/bin/http
.I think it should build on aarch64, but I don't have a machine to test that on.
The hub/go.mod requires go 1.23.1, so if you're probably not building this on nixos24.05 or older.
The resulting binary name is
http
which is exceptionally ambiguous. Should it be renamed?Progress:
http
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.