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

linux compile go to windows binary :Checking for the Microsoft Visual Studio #908

Closed
czyt opened this issue Jul 30, 2020 · 4 comments
Closed

Comments

@czyt
Copy link

czyt commented Jul 30, 2020

Describe the bug

I run command on linux but it chek for vs?

➜  xmakeDemo xmake f -p windows -a x86_64 -m release
checking for the Microsoft Visual Studio (x86_64) version ... no
please run:
    - xmake config --vs=xxx [--vs_toolset=xxx]
or  - xmake global --vs=xxx

Expected behavior

build windows binary success.

Related Environment

  • xmake version:3.6 latest dev
xmake v2.3.6+202007301004, A cross-platform build utility based on Lua
  • os:Manjaro Linux
  • target platform: Windows
  • Go version: go 1.14.6
@waruqi
Copy link
Member

waruqi commented Jul 30, 2020

I have fixed it, you can update to dev version and try it again.

$ xmake update -s dev
$ xmake f -p windows -c
$ xmake

@waruqi waruqi added this to the v2.3.7 milestone Jul 30, 2020
@czyt
Copy link
Author

czyt commented Jul 30, 2020

I have fixed it, you can update to dev version and try it again.

$ xmake update -s dev
$ xmake f -p windows -c
$ xmake

after upgarded to the version you mentioned

➜  ~ xmake update -s dev
update version dev from official source ..
  => download https://gitee.com/tboox/xmake.git .. ok
  => install script to /home/czyt/.local/share/xmake .. ok
➜  ~ 

now I can compile.but still have some problem:

  1. compile need root permition.
    2.after build there was nothing in the build directory.
    here is the log
➜  xmakeDemo  xmake f -p windows -a x86_64 -m release 
note: we need build go for windows_amd64 only once first! (pass -y or --confirm=y/n/d to skip confirm)?
please input: y (y/n)
y
building go for windows_amd64 .. error: go build cmd/dist: copying /tmp/go-build163553446/b001/exe/a.out: open cmd/dist/dist: permission denied

➜  xmakeDemo sudo xmake f -p windows -a x86          
➜  xmakeDemo ls
build  src  xmake.lua
➜  xmakeDemo cd build 
➜  build ls

@waruqi
Copy link
Member

waruqi commented Jul 31, 2020

building go for windows_amd64 .. error: go build cmd/dist: copying /tmp/go-build163553446/b001/exe/a.out: open cmd/dist/dist: permission denied

Because it will run the following command to build go for other platform.

$ cd /usr/lib/go-1.6/src
$ GOOS=windows GOROOT_BOOTSTRAP=/usr/lib/go-1.6/ GOARCH=amd64 ./make.bash --no-clean

I have only tested cross-compilation on macos/windows before (see #898), but I haven’t tested it under linux. It seems that there are some permissions issues that need to be dealt with.

@waruqi
Copy link
Member

waruqi commented Jul 31, 2020

I have fixed it, you can update the dev version and try it again. xmake update -s dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants