Comments (19)
Thats awesome. I was thinking of packaging faq for ARM but didn't really know where I would run the builds.
from faq.
dep
works without a problem installed from source.
Next, stuck on a library:
$ go install github.com/jzelinskie/faq
# pkg-config --cflags oniguruma
Package oniguruma was not found in the pkg-config search path.
Perhaps you should add the directory containing `oniguruma.pc'
to the PKG_CONFIG_PATH environment variable
No package 'oniguruma' found
pkg-config: exit status 1
Debian has three (count them) plausible alternatives.
libonig2/oldstable 5.9.5-3.2+deb8u1 armhf
Oniguruma regular expressions library
libonig4/unstable 6.7.0-1 armhf
regular expressions library
libonig5/unstable,now 6.8.2-1 armhf [installed]
regular expressions library
from faq.
Using pkg-config to find oniguruma was a lazy hack by me, maybe debian doesn't bring in the .pc file with that package. I'll see if I can remove pkg-config as a requirement.
You should try changing the #cgo instructions at the top of jq/jq.go
:
-#cgo pkg-config: --static oniguruma
+#cgo linux LDFLAGS: -lonig
edit: I just pushed a change for this.
from faq.
I was able to build jq
from source (master) fine, resulting in
$ jq --version
jq-1.4-1-e73951f
from faq.
After a git pull
to pick up changes, I was able to build, but got stopped at
$ go install github.com/jzelinskie/faq
# github.com/jzelinskie/faq/jq
jq/jv.go:385:33: could not determine kind of name for C.JV_PRINT_COLOUR
I'm suspicious because
go version go1.9.2 linux/arm
so the next thing to do is to upgrade to go1.10.x.
from faq.
What commit are you using? I just pushed a few fixes to the jq library.
from faq.
emv@parviflorus:~/faq/src/github.com/jzelinskie/faq$ go install github.com/jzelinskie/faq
# github.com/jzelinskie/faq/jq
jq/jv.go:411:31: could not determine kind of name for C.JV_PRINT_COLOUR
emv@parviflorus:~/faq/src/github.com/jzelinskie/faq$ git log -1
commit 7b4ed8bce69b89f45c14c4288ded1e98200b715a
Author: Jimmy Zelinskie <[email protected]>
Date: Thu May 17 20:15:25 2018 -0400
jq: fix imports in tests
emv@parviflorus:~/faq/src/github.com/jzelinskie/faq$ go version
go version go1.10.2 linux/arm
from faq.
I think CGO might be disabled. Are you building this on ARM or trying to cross compile from x64?
from faq.
I think the problem is in C.JV_PRINT_COLOUR - see
ed@ed-2a-bcc-llvm:~/faq/src/github.com/jzelinskie/faq$ grep COLOR /usr/local/include/jv.h
JV_PRINT_COLOR = 4,
(doing this on an arm64 system too while I'm at it).
diff --git a/jq/jv.go b/jq/jv.go
index 48af9a6..87b4c02 100644
--- a/jq/jv.go
+++ b/jq/jv.go
@@ -408,7 +408,7 @@ const (
JvPrintASCII JvPrintFlags = C.JV_PRINT_ASCII
// JvPrintColour includes ANSI color escapes based on data types.
- JvPrintColour JvPrintFlags = C.JV_PRINT_COLOUR
+ JvPrintColour JvPrintFlags = C.JV_PRINT_COLOR
// JvPrintSorted sorts the output keys.
JvPrintSorted JvPrintFlags = C.JV_PRINT_SORTED
That makes the compile work, but then I run into this:
d@ed-2a-bcc-llvm:~/faq/src/github.com/jzelinskie/faq$ ~/faq/bin/faq
/home/ed/faq/bin/faq: error while loading shared libraries: libjq.so.1: cannot open shared object file: No such file or directory
from faq.
OK working!
emv@parviflorus:~/faq/src/github.com/jzelinskie/faq$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
emv@parviflorus:~/faq/src/github.com/jzelinskie/faq$ ~/faq/bin/faq
Error: not enough arguments provided
Usage:
faq [flags] [filter string] [files...]
Flags:
-a, --ascii-output force output to be ascii instead of UTF-8
-C, --color-output colorize the output (default true)
-c, --compact compact instead of pretty-printed output
-f, --format string input format (default "auto")
-h, --help help for faq
-m, --maintain-format maintain original format (don't output JSON)
-M, --monochrome-output monochrome (don't colorize the output)
-r, --raw output raw strings, not JSON texts
-S, --sort-keys sort keys of objects on output
-t, --tab use tabs for indentation
from faq.
Interesting! I wonder if they renamed that flag in a particular version of jq. What version are you linking against?
from faq.
Looks like this is the color/colour diff:
from faq.
Yup, I'm definitely linking against jq 1.5 on macOS and 1.6-rc.1 on Linux.
I recommend just building jq from a stable release and sticking with the British spelling.
from faq.
@jzelinskie my workaround to compile and linking faq
against jq
lastest master
branch:
git clone https://github.com/stedolan/jq.git && \
cd jq && \
git submodule update --init && \
autoreconf -fi && \
./configure \
--disable-maintainer-mode \
--with-oniguruma=builtin && \
make -j$(nproc) LDFLAGS=-all-static && \
sudo make install && \
sudo ldconfig -v && \
go get \
-v \
-u \
-t \
-f \
-d \
github.com/jzelinskie/faq && \
cd "${GOPATH}/src/github.com/jzelinskie/faq" && \
sed -i -e 's/JV_PRINT_COLOUR/JV_PRINT_COLOR/g' jq/jv.go && \
dep ensure && \
go install \
-p "$(nproc)" \
github.com/jzelinskie/faq && \
sed -i -e 's/JV_PRINT_COLOR/JV_PRINT_COLOUR/g' jq/jv.go
from faq.
After #27 be aware that faq currently expects to be built with jq 1.6.
from faq.
@vielmetti I'd love to be able to have dev tooling for building against ARM. If you want to contribute something that we can put in a Makefile for building in a VM, that'd be perfect.
from faq.
@jzelinskie are you familiar with Drone Cloud? It has x64, arm64, and 32-bit Arm support for CI, and it's free for open source. https://cloud.drone.io/
from faq.
Started a new Drone Cloud discussion at #38, I have a working .drone.yml
at least for Alpine and x86, will iterate there.
from faq.
Pointing this to #83 and closing.
from faq.
Related Issues (20)
- Mac executable is not statically linked HOT 4
- Windows Build..?
- bencode output strangeness
- "raw output" fails to encode HOT 7
- CSV HOT 7
- Explore gojq instead of linking to libjq HOT 1
- error: expected specifier-qualifier-list before 'jv' jv p1; HOT 4
- ARM builds for CI
- faq with no args blocks forever, while jq prints usage
- problem decoding XML, invalid attribute key label HOT 4
- Investigate goreleaser
- supporess the root tags when outputting with custom format string HOT 3
- Bypass XML decoding errors
- non-zero exit code on errors
- first example doesn't work HOT 1
- String length expressed as byte or character count for bencode HOT 3
- JSON to Bencode issues?
- collect2: error: ld returned 1 exit status HOT 2
- Explore more performant JSON libraries
- What happened to 0.0.8? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from faq.