techknowlogick / xgo

Go CGO cross compiler
MIT License
477 stars 80 forks source link

`-dest` permissions #234

Open xescugc opened 9 months ago

xescugc commented 9 months ago

I've seen https://github.com/techknowlogick/xgo/issues/10 but on my case I still get that the generated path -dest is with root

~/repos/maze-wars [fg-132] $> tree -pufi ./dist/ -L 4
[drwxr-xr-x xescugc ]  ./dist
[-rw-r--r-- xescugc ]  ./dist/config.yaml
[drwxr-xr-x root    ]  ./dist/maze-wars_darwin_amd64_v1
[drwxr-xr-x root    ]  ./dist/maze-wars_darwin_amd64_v1/maze-wars
[-rwxr-xr-x root    ]  ./dist/maze-wars_darwin_amd64_v1/maze-wars/maze-wars-darwin-10.12-amd64
[drwxr-xr-x root    ]  ./dist/maze-wars_linux_amd64_v1
[drwxr-xr-x root    ]  ./dist/maze-wars_linux_amd64_v1/maze-wars
[-rwxr-xr-x root    ]  ./dist/maze-wars_linux_amd64_v1/maze-wars/maze-wars-linux-amd64
[drwxr-xr-x root    ]  ./dist/maze-wars_windows_amd64_v1
[drwxr-xr-x root    ]  ./dist/maze-wars_windows_amd64_v1/maze-wars.exe
[-rwxr-xr-x root    ]  ./dist/maze-wars_windows_amd64_v1/maze-wars.exe/maze-wars-windows-4.0-amd64.exe

7 directories, 4 files

The command is xgo -out=maze-wars -hooksdir=.xgohooks/ -targets=windows/amd64 -gcflags= -ldflags='-s -w -X main.defaultHost=https://maze-wars.com' -dest /home/xescugc/repos/maze-wars/dist/maze-wars_windows_amd64_v1/maze-wars.exe ./cmd/client/

I'm doing something wrong?

PD: Ignore a bit all the weird paths, I'm building it with gorelease with few custom changes on it (not related to this issue) that would allow gorelease to easily build with xgo.

xescugc commented 9 months ago

I did manually create a build.sh with:

DIR=./dist

chown -R --reference . $DIR

And now it does change the ownership to the one I want, is this the intended way?