-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Add Solidity compiler to solana installer #31184
Conversation
Coupling solang with the Labs validator client release doesn't feel too good to me. In fact in the glorious future I think it makes sense to move the BPF SDK bits into a separate release from the validator client itself, so adding more developer-related tooling is moving against that grain. I feel this is better solved directly at the solang level with maybe (?) an easier way to install it directly? But honestly, option 1 and 2 at https://solang.readthedocs.io/en/latest/installing.html don't feel like a big burden. |
Separating the BPF SDK makes a lot of sense, and if such a release does exist, then solang should definitely be part of that. For now the BPF SDK lives with the client release, so until that changes having solang there is just a compromise (it's not ideal, I agree).
I felt the same way, but my experience at hacker houses tells me differently. People get stuck with this, or get it wrong and then don't know what to do. We want folks to have a super-smooth experience when moving from ethereum solidity to solana solidity. Downloading a binary and putting it your path is the opposite of that. |
Really? Do you know what part of "Option 2" people get stuck on? These may not be the devs we're looking for frankly. But putting that aside, what does it take to build solang from source? Trusting and redistributing binaries from https://github.com/hyperledger/solang/releases/download also feels bad from within |
From experience the first thing they save it somewhere, then either struggle to add it to their path, or then when they have done that, they miss that they only added to their path in their current terminal, not in other terminals. Also it's lost after a reboot/logout. Sure, I agree that if a developer struggles with this they may miss some foundational stuff. However:
Building solang from source depends on a build of our forked llvm tree with the various Solana patches. I can certainly change the shell script to do this, however:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, ok.
Since Solana 1.16.0 is unlikely to ship for a month or so, if this needs to be made available to the dev community sooner then we'll need to do backport to v1.14 as well. This seems fine enough given the scope of change.
Problem
We would like Solidity to be language which is easy to use, and easy to set up. Anchor now has support for Solidity in the master branch. However, this support depends on the
solang
binary being available in the path.I've noticed that asking some developers to download a binary, make it executable and it put somewhere in the path is a big ask. This requires too much shell knowledge. We need an automated way of doing this.
Summary of Changes
This adds the solang binary to the solana installer. The binary is about 58M (depending on the plaform) and compresses down to 17M with bz2. So, the installer is not much larger.
This has been tested on Linux and build is running on my Mac right now. I am not sure how I can test Windows, I can setup a VM but I don't quite understand how this shell script gets executed on Windows.