cargo-build-bpf: Add Windows support#20276
Conversation
|
This looks good to me, but I'm not quite sure why the usual CI checks were not executed for this PR. Let's wait until bpf-tools release assets are published ( https://github.com/solana-labs/bpf-tools/actions/runs/1281082328 ) before merging this. |
|
Sounds good to me! I've nudged a little update to the error message to restart the CI job |
Pull request has been modified.
86ea39c to
5865304
Compare
5865304 to
831050b
Compare
Pull request has been modified.
|
Jon, I had to turn off the build on windows when I released bpf-tools v1.19. The build failed when the build artifacts were copied in preparation for making a package tarball. The reason for the failure was the CI agent ran out of disk space. I'm not sure how to request a bigger disk for a CI agent machine, and so for now CI doesn't build bpf-tools for Windows. |
|
Ah that's too bad. Thanks for noticing this. It looks like we'll need to move the steps to a different directory for this to work as expected, if actions/runner-images#1341 is actually possible, we can pass in a new |
Codecov Report
@@ Coverage Diff @@
## master #20276 +/- ##
=========================================
- Coverage 81.2% 81.2% -0.1%
=========================================
Files 520 520
Lines 145949 145949
=========================================
- Hits 118533 118532 -1
- Misses 27416 27417 +1 |
831050b to
3b0471b
Compare
Pull request has been modified.
* cargo-build-bpf: Add Windows support * Update error message (cherry picked from commit 57986f9)
|
So what is the solution for this? |
I'd also like to know. Just getting into Solana coding and can't even do Hello World example because it says no such subcommand: Been scouring the web, but seems most people getting it to work are on Linux and not Windows. |
|
Be sure to install the solana command line tools and rust, then use a bash-compatible shell like Git Bash. If you need more support, please ask in the Solana Stack Exchange https://solana.stackexchange.com/ |
Problem
cargo-build-bpfdoesn't support windowsSummary of Changes
Add support for it!
A few notes:
lddoesn't ship by default with mingw, causinglinker not founderrors, so one of the changes is to force the usage ofld.lldfrom the sdk to link. I have very little knowledge of different linker flavors, but this was the only one that worked. If you think it should be another one, please let me know.strip.shand just callsllvm-objcopydirectly.dump.sh, it's possible to run the script separately, and re-runcargo build-bpf --dumpto do the postprocessing step. it isn't elegant, but it actually works!Fixes #