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

Can I build the custom extension on windows machine #14

Closed
Sourabh25 opened this issue Mar 11, 2021 · 1 comment
Closed

Can I build the custom extension on windows machine #14

Sourabh25 opened this issue Mar 11, 2021 · 1 comment

Comments

@Sourabh25
Copy link

I am able to build the k6 extension for excel in mac and linux environment. Can i also build it for windows?

I also observer that the k6 extension i create on Mac works only on mac and not on linux. Is my observation correct or there is a way i can build one extension for any operating system.

@Sourabh25 Sourabh25 changed the title Can i build the custom extension on windows machine Can I build the custom extension on windows machine Mar 11, 2021
@imiric
Copy link
Contributor

imiric commented Mar 12, 2021

Hi, sure, xk6 works on Windows as well. The way environment variables are specified works differently on Windows shells, and if you're building an extension that requires cgo you'll also need a C compiler installed. See this forum post for details.

You can build k6 binaries with xk6 for all operating systems supported by Go. xk6 is simply a wrapper around calling go commands with a friendlier UI than doing this manually. So unless your extension uses some platform-specific features, you can cross-compile it for all platforms, but a binary compiled for one platform won't work on another, same as with any binary compiled with Go. It's simply a matter of changing the GOOS and GOARCH environment variables if you're cross-compiling (i.e. building multiple binaries on one system), otherwise Go should detect these if you're targeting the same platform you're building on.

For further questions please use the community forum or the #extensions channel on Slack.

@imiric imiric closed this as completed Mar 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants