1

https://github.com/solana-labs/solana-program-library/blob/master/farms/docs/quick_start.md

When running cargo build-sbf in any of the program folders, my build fails due to termcolor package

cargo build-sbf
   Compiling libc v0.2.132
   Compiling termcolor v1.1.3
   Compiling atty v0.2.14
   Compiling arrayvec v0.7.2
error[E0425]: cannot find function `is` in this scope
  --> src/lib.rs:98:6
   |
98 |     !is(stream)
   |      ^^ not found in this scope

For more information about this error, try `rustc --explain E0425`.
error: could not compile `atty` due to previous error
warning: build failed, waiting for other jobs to finish...
error[E0107]: this struct takes 0 lifetime arguments but 1 lifetime argument was supplied
   --> src/lib.rs:375:20
    |
375 |     StdoutLock(io::StdoutLock<'a>),
    |                    ^^^^^^^^^^---- help: remove these generics
    |                    |
    |                    expected 0 lifetime arguments

error[E0107]: this struct takes 0 lifetime arguments but 1 lifetime argument was supplied
   --> src/lib.rs:376:20
    |
376 |     StderrLock(io::StderrLock<'a>),
    |                    ^^^^^^^^^^---- help: remove these generics
    |                    |
    |                    expected 0 lifetime arguments

For more information about this error, try `rustc --explain E0107`.
error: could not compile `termcolor` due to 2 previous errors

1 Answer 1

0

You've actually found a bug in the docs, thanks for that! The solution is to use cargo build-bpf everywhere.

The farms code is a bit out of date, so it depends on older crates that haven't updated to the correct target_os = "solana" build feature, so it must still be built with the bpf architecture.

The PR to fix is at https://github.com/solana-labs/solana-program-library/pull/3612

2
  • Thanks, I'm pretty sure most of the docs/readme are wrong for the fund :/ Commented Sep 18, 2022 at 4:15
  • Contributions in the form of issues or PRs are always appreciated!
    – Jon C
    Commented Sep 19, 2022 at 10:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.