Skip to content
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

cargo build-bpf does not work on windows #15164

Closed
Arrowana opened this issue Feb 6, 2021 · 7 comments
Closed

cargo build-bpf does not work on windows #15164

Arrowana opened this issue Feb 6, 2021 · 7 comments
Labels
locked issue stale [bot only] Added to stale content; results in auto-close after a week.
Milestone

Comments

@Arrowana
Copy link
Contributor

Arrowana commented Feb 6, 2021

Problem

cargo build-bpf does not work on windows

It took me a while to understand that it just seems like the command doesn't work on windows or isn't supported
https://docs.solana.com/cli/install-solana-cli-tools I installed rust and the solana cli
https://github.com/solana-labs/solana-program-library then followed the readme here to build the token program

UserFolder\solana-program-library> cargo build
[...]
UserFolder\solana-program-library\token\program> cargo build-bpf
error: no such subcommand: `build-bpf`

Proposed Solution

  1. If not supported yet, can we have the command return an error at least? Instead of "no such subcommand" leaving the developer wondering if his setup is wrong
  2. If it is supposed to be supported then there is problem a problem to fix :)
@jochasinga
Copy link

Problem

cargo build-bpf does not work on windows

It took me a while to understand that it just seems like the command doesn't work on windows or isn't supported
https://docs.solana.com/cli/install-solana-cli-tools I installed rust and the solana cli
https://github.com/solana-labs/solana-program-library then followed the readme here to build the token program

UserFolder\solana-program-library> cargo build
[...]
UserFolder\solana-program-library\token\program> cargo build-bpf
error: no such subcommand: `build-bpf`

Proposed Solution

  1. If not supported yet, can we have the command return an error at least? Instead of "no such subcommand" leaving the developer wondering if his setup is wrong
  2. If it is supposed to be supported then there is problem a problem to fix :)

Did you check if the executable cargo-build-bpf is located within your $PATH and that cargo build-bpf is run in a directory with Cargo.toml?
https://github.com/rust-lang/cargo/wiki/Third-party-cargo-subcommands

@mvines
Copy link
Member

mvines commented Feb 13, 2021

Yes we currently don't support native windows for cargo-build-bpf unfortunately. Would using WSL be an option?

@Arrowana
Copy link
Contributor Author

Arrowana commented Feb 13, 2021

@mvines I switched to a full setup in WSL, then I can develop. I don't think requiring WSL for a windows setup is great, the developer should be free to go for full Windows or full Linux (through WSL if he wants to).

Since windows can be used to do most of the other things, it seems like this subcommand has to exist but throw something, so solution 1. What do you think?

Is this as simple as adding cargo-build-bpf in https://github.com/solana-labs/solana/blob/master/scripts/cargo-install-all.sh#L62-L68 then having a simple executable which can print "build-bpf not supported on windows" that we build on windows instead of the real one?

@mvines mvines added this to the The Future! milestone Feb 15, 2021
@mvines
Copy link
Member

mvines commented Feb 15, 2021

Is this as simple as adding cargo-build-bpf in https://github.com/solana-labs/solana/blob/master/scripts/cargo-install-all.sh#L62-L68 then having a simple executable which can print "build-bpf not supported on windows" that we build on windows instead of the real one?

Yep, this would be a fine solution until native windows support for development is available.

@stale
Copy link

stale bot commented Mar 2, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale [bot only] Added to stale content; results in auto-close after a week. label Mar 2, 2022
@joncinque
Copy link
Contributor

This was fixed in #20276 -- it currently requires a bash-compatible shell, but at least it's a start!

@github-actions
Copy link
Contributor

This issue has been automatically locked since there has not been any activity in past 7 days after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked issue stale [bot only] Added to stale content; results in auto-close after a week.
Projects
None yet
Development

No branches or pull requests

4 participants