mikefarah / yq

yq is a portable command-line YAML, JSON, XML, CSV, TOML and properties processor
https://mikefarah.gitbook.io/yq/
MIT License
12.39k stars 607 forks source link

ppc64le: There is no yq release for PowerPC architecture. #164

Closed nitkon closed 6 years ago

nitkon commented 6 years ago

As yq is a popular portable command-line YAML processor, is there any plan to have a release for PowerPC arch as well. I see that currently there are releases for many other archs like amd64, arm etc

mikefarah commented 6 years ago

I'm using gox to cross compile the binaries, they don't officially support PowerPC - but the tool can generate a ppc binary regardless (https://groups.google.com/forum/#!topic/consul-tool/9riF83kgLG4).

I created one for yq here: https://github.com/mikefarah/yq/releases/tag/2.1.1

Let me know if it works and I'll include it as part of the release process :)

nitkon commented 6 years ago

Hi mikefarah, I tested it on ppc64le,

1. wget https://github.com/mikefarah/yq/archive/2.1.1.tar.gz
2. tar xvzf 2.1.1.tar.gz 
3. cd yq-2.1.1/
4. git init .
5. make build
6.  yq --version
yq 2.6.0
7. uname -a
Linux llmtul01b 4.4.0-119-generic #143-Ubuntu SMP Mon Apr 2 16:08:02 UTC 2018 ppc64le ppc64le ppc64le GNU/Linux

Seems to work fine on ppc64le. Can you please include it in your release: https://github.com/mikefarah/yq/releases

mikefarah commented 6 years ago

Oh - I was wondering why you didn't use the binary I built, turns out Github failed to process the upload :(

Re-uploaded it - sorry - can you confirm that the binary works ;)

https://github.com/mikefarah/yq/releases/download/2.1.1/yq_linux_ppc64

nitkon commented 6 years ago

Hi mikefarah, I see the following.

# ls -lrt
total 5436
-rwxrwxrwx 1 root root 5563491 Jul 17 04:38 yq_linux_ppc64
# ./yq_linux_ppc64 --version
Invalid instruction
NIP 00000000000208d4   LR 0000000000020830 CTR 000000000005e6d0 XER 0000000000000000 CPU#0
MSR 8000000002806000 HID0 0000000000000000  HF 8000000002806000 idx 0
TB 00899549 3863534284897180
GPR00 0000000000000000 000000400080f3d8 0000000000000000 0000000000080000
GPR04 0000000000000001 0000000003ffffff 0000000000000000 0000000000000000
GPR08 0000000000000003 0000000000000002 0000000000353ec8 0000000000000000
GPR12 000000000005e6d0 0000000000000000 0000000000011c80 0000000000261bd0
GPR16 00000000001a0150 0000000000000000 0000000000000000 0000000000000000
GPR20 0000000000000000 0000000000000000 0000000000000000 0000000000000000
GPR24 0000000000000000 0000000000000000 0000000000000000 0000000000000000
GPR28 0000000000000000 0000000000000000 0000000000349fa0 0000000000020830
CR 40000000  [ G  -  -  -  -  -  -  -  ]             RES ffffffffffffffff
FPR00 0000000000000000 ffffffffe0000000 ffffffffc0000000 0000000000000000
FPR04 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPR08 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPR12 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPR16 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPR20 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPR24 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPR28 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPSCR 0000000000001000
qemu: uncaught target signal 4 (Illegal instruction) - core dumped
Illegal instruction
mikefarah commented 6 years ago

Bummer :(

Until GOX supports PPC I won't be able to include a compiled binary in the release ;(

For the moment you'll need to manually compile it as you have done with the tar file.

nitkon commented 6 years ago

Hi mikefarah, I tried the following. Did I miss something?

1. go get github.com/mikefarah/yq
2. cd yq/
3. [root@Intel_x86 yq]# ....src/github.com/mitchellh/gox/gox_linux_amd64 -os=linux -arch=ppc64le

Copied the binary from x86->ppc64le

4.[root@ppc64le]# ./yq_linux_ppc64le --version
yq version 2.1.0
5.[root@ppc64le]# ls -lrt yq_linux_ppc64le 
-rwxr-xr-x 1 root root 4989593 Jul 17 18:55 yq_linux_ppc64le
mikefarah commented 6 years ago

Aha I had the arch set to ppc64!

Ok I've compiled the binary for ppc64le :) I'm on a mac, if you could confirm that it works that'd be ace!

nitkon commented 6 years ago

Yes, the new binary for ppc64le works fine.

mikefarah commented 6 years ago

Fixed in latest release https://github.com/mikefarah/yq/releases/tag/2.1.1 :)