nasadorian / solflake

Reproducible Solana program builds with Nix Flakes
MIT License
3 stars 0 forks source link

some executables are not `patchelf`'d. #1

Open arilotter opened 1 month ago

arilotter commented 1 month ago

When running cargo build --release --target sbf-solana-solana inside nix develop github:nasadorian/solflake, you'll get an error that

Could not start dynamically linked executable: cargo
NixOS cannot run dynamically linked executables intended for generic
linux environments out of the box

Perhaps we need to patchelf the rust binaries manually?

nasadorian commented 6 days ago

Sorry I didn't see this issue @arilotter. Since I created this repo someone added solana-cli to Nixpkgs, so can probably upgrade to that here.

However the problem of linking cargo-sbf and the most recent compiler persists. The only way to make Solana's toolchain work in Nix without modifying source is to run rustup somewhere.

I'm open to ideas on this, including running patchELF. Feel free to ping me on Telegram or Discord to discuss.

arilotter commented 6 days ago

No worries! I've ended up building a flake that has a functional Solana Rust toolchain, a functional cargo sbf command, and also the anchor CLI supporting anchor build. https://github.com/arilotter/solana-flake

Thanks for your work here, it was very helpful to get this far.

The very last hurdle to overcome for me would be getting the solana rust toolchain to work alongside rust-analyzer - but i might need to build it myself for that.