jzelinskie / faq

Format Agnostic jQ -- process various formats with libjq
Apache License 2.0
440 stars 14 forks source link

error: expected specifier-qualifier-list before 'jv' jv p1; #81

Closed bcg62 closed 4 years ago

bcg62 commented 4 years ago

Trying to build an RPM using https://raw.githubusercontent.com/chancez/faq-rpm/master/faq.spec and running into the following:

/usr/bin/make -j56 SKIP_VALIDATE=true FAQ_LINK_STATIC=false 'GO_LD_FLAGS=-compressdwarf=false -linkmode external -extldflags "-v"'
/usr/bin/make test
make[1]: Entering directory `/builddir/build/BUILD/faq-0.0.6'
scripts/test.sh
go: downloading github.com/sirupsen/logrus v1.3.0
go: downloading github.com/spf13/cobra v0.0.3
go: downloading golang.org/x/crypto v0.0.0-20180904163835-0709b304e793
go: downloading github.com/globalsign/mgo v0.0.0-20180615134936-113d3961e731
go: downloading gopkg.in/yaml.v2 v2.2.2
go: downloading github.com/Azure/draft v0.16.0
go: downloading github.com/BurntSushi/toml v0.3.1
go: downloading github.com/clbanning/mxj v0.0.0-20180418195244-1f00e0bf9bac
go: downloading github.com/ghodss/yaml v1.0.0
go: downloading github.com/alecthomas/chroma v0.6.2
go: downloading github.com/spf13/pflag v1.0.3
go: downloading github.com/zeebo/bencode v0.0.0-20180308174530-d522839ac797
go: downloading github.com/dlclark/regexp2 v1.1.6
go: downloading github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964
go: downloading golang.org/x/sys v0.0.0-20181128092732-4ed8d59d0b35
go: downloading github.com/jbrukh/bayesian v0.0.0-20161210175230-bf3f261f9a9c
# github.com/jzelinskie/faq/pkg/jq
_cgo_export.c: In function 'goJQErrorHandler':
_cgo_export.c:29:3: error: expected specifier-qualifier-list before 'jv'
   jv p1;
   ^
_cgo_export.c:32:8: error: 'struct <anonymous>' has no member named 'p1'
  _cgo_a.p1 = jv;
        ^
FAIL    github.com/jzelinskie/faq/pkg/faq [build failed]
=== RUN   TestBencodeMarshal
=== RUN   TestBencodeMarshal/#00
--- PASS: TestBencodeMarshal (0.00s)
    --- PASS: TestBencodeMarshal/#00 (0.00s)
=== RUN   TestBencodeUnmarshal
=== RUN   TestBencodeUnmarshal/#00
--- PASS: TestBencodeUnmarshal (0.00s)
    --- PASS: TestBencodeUnmarshal/#00 (0.00s)
=== RUN   TestSVG
--- PASS: TestSVG (0.00s)
PASS
ok      github.com/jzelinskie/faq/pkg/formats   0.024s
make[1]: *** [test] Error 2
make[1]: Leaving directory `/builddir/build/BUILD/faq-0.0.6'
make: *** [all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.ktd4Or (%build)
RPM build errors:
    bogus date in %changelog: Mon Feb 14 2019 Chance Zibolski <czibolsk@redhat.com> 0.0.6-1
    Bad exit status from /var/tmp/rpm-tmp.ktd4Or (%build)
Finish: rpmbuild faq-0.0.6-4.el7.src.rpm
Finish: build phase for faq-0.0.6-4.el7.src.rpm
ERROR: Exception(/tmp/faq-0.0.6-4.el7.src.rpm) Config(epel-7-x86_64) 1 minutes 26 seconds
INFO: Results and/or logs in: /home/builder/rpmbuild/results/epel-7-x86_64
INFO: Cleaning up build root ('cleanup_on_failure=True')
Start: clean chroot
Finish: clean chroot
ERROR: Command failed: 
jakobkogler commented 4 years ago

I'm getting the same error when installing it from the AUR:

>> yay -S faq 
:: Checking for conflicts...
:: Checking for inner conflicts...
[Aur:1]  faq-0.0.6-2

:: Downloaded PKGBUILD (1/1): faq
  1 faq                                      (Build Files Exist)
==> Diffs to show?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> 
:: (1/1) Parsing SRCINFO: faq
==> Making package: faq 0.0.6-2 (Do 01 Okt 2020 18:27:39)
==> Retrieving sources...
  -> Downloading 0.0.6.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   121  100   121    0     0    208      0 --:--:-- --:--:-- --:--:--   208
100 56682    0 56682    0     0  50835      0 --:--:--  0:00:01 --:--:--  750k
==> Validating source files with md5sums...
    0.0.6.tar.gz ... Passed
==> Making package: faq 0.0.6-2 (Do 01 Okt 2020 18:27:41)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found 0.0.6.tar.gz
==> Validating source files with md5sums...
    0.0.6.tar.gz ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting 0.0.6.tar.gz with bsdtar
==> Sources are ready.
==> Making package: faq 0.0.6-2 (Do 01 Okt 2020 18:27:43)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Entering fakeroot environment...
==> Starting package()...
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -o faq-linux-amd64 -v -ldflags '-s -w -X github.com/jzelinskie/faq/pkg/version.Version=0.0.6-2-aur -linkmode external -extldflags "-v"' github.com/jzelinskie/faq/cmd/faq
go: downloading github.com/sirupsen/logrus v1.3.0
go: downloading github.com/spf13/cobra v0.0.3
go: downloading github.com/Azure/draft v0.16.0
go: downloading golang.org/x/crypto v0.0.0-20180904163835-0709b304e793
go: downloading github.com/alecthomas/chroma v0.6.2
go: downloading github.com/zeebo/bencode v0.0.0-20180308174530-d522839ac797
go: downloading github.com/ghodss/yaml v1.0.0
go: downloading github.com/clbanning/mxj v0.0.0-20180418195244-1f00e0bf9bac
go: downloading github.com/globalsign/mgo v0.0.0-20180615134936-113d3961e731
go: downloading github.com/BurntSushi/toml v0.3.1
go: downloading gopkg.in/yaml.v2 v2.2.2
go: downloading github.com/dlclark/regexp2 v1.1.6
go: downloading golang.org/x/sys v0.0.0-20181128092732-4ed8d59d0b35
go: downloading github.com/jbrukh/bayesian v0.0.0-20161210175230-bf3f261f9a9c
github.com/danwakefield/fnmatch
github.com/jzelinskie/faq/pkg/version
github.com/Azure/draft/pkg/linguist/tokenizer
github.com/Azure/draft/pkg/osutil
github.com/Azure/draft/pkg/linguist/data
gopkg.in/yaml.v2
github.com/jbrukh/bayesian
golang.org/x/sys/unix
github.com/BurntSushi/toml
github.com/dlclark/regexp2/syntax
github.com/clbanning/mxj
golang.org/x/crypto/ssh/terminal
github.com/sirupsen/logrus
github.com/dlclark/regexp2
github.com/ghodss/yaml
github.com/globalsign/mgo/internal/json
github.com/zeebo/bencode
github.com/Azure/draft/pkg/linguist
github.com/jzelinskie/faq/pkg/jq
github.com/alecthomas/chroma
github.com/spf13/pflag
github.com/globalsign/mgo/bson
github.com/alecthomas/chroma/formatters/html
github.com/alecthomas/chroma/formatters
github.com/alecthomas/chroma/lexers/internal
github.com/alecthomas/chroma/lexers/a
github.com/alecthomas/chroma/lexers/b
github.com/alecthomas/chroma/lexers/p
github.com/alecthomas/chroma/lexers/j
github.com/alecthomas/chroma/lexers/d
github.com/alecthomas/chroma/lexers/e
# github.com/jzelinskie/faq/pkg/jq
_cgo_export.c: In function ‘goJQErrorHandler’:
_cgo_export.c:29:3: error: expected specifier-qualifier-list before ‘jv’
   29 |   jv p1;
      |   ^~
_cgo_export.c:32:9: error: ‘struct <anonymous>’ has no member named ‘p1’; did you mean ‘p0’?
   32 |  _cgo_a.p1 = jv;
      |         ^~
      |         p0
github.com/alecthomas/chroma/lexers/f
github.com/alecthomas/chroma/lexers/i
github.com/alecthomas/chroma/lexers/k
github.com/alecthomas/chroma/lexers/l
github.com/alecthomas/chroma/lexers/n
github.com/alecthomas/chroma/lexers/o
github.com/alecthomas/chroma/lexers/q
github.com/alecthomas/chroma/lexers/c
github.com/alecthomas/chroma/lexers/r
github.com/alecthomas/chroma/lexers/t
github.com/alecthomas/chroma/lexers/v
github.com/alecthomas/chroma/lexers/w
github.com/alecthomas/chroma/lexers/x
github.com/alecthomas/chroma/lexers/y
github.com/alecthomas/chroma/styles
github.com/jzelinskie/faq/pkg/flagutil
github.com/spf13/cobra
github.com/alecthomas/chroma/lexers/h
github.com/alecthomas/chroma/lexers/m
github.com/alecthomas/chroma/lexers/circular
github.com/alecthomas/chroma/lexers/g
github.com/alecthomas/chroma/lexers/s
github.com/alecthomas/chroma/lexers
github.com/alecthomas/chroma/quick
github.com/jzelinskie/faq/pkg/formats
make: *** [Makefile:44: faq-linux-amd64] Error 2
==> ERROR: A failure occurred in package().
    Aborting...
error making: faq
jzelinskie commented 4 years ago

Thanks for the reports! Can ya'll include the version of Go you're using and what version of libjq is installed?

jakobkogler commented 4 years ago

Beside having the error when using the AUR, I also get the error when cloning the repo manually and run make.

I have the following versions installed:

>> go version                                 
go version go1.15.2 linux/amd64
>> jq --version
jq-1.6
>> ldconfig -v 2>/dev/null | grep libjq 
libjq.so.1 -> libjq.so.1.0.4
jzelinskie commented 4 years ago

Perfect, thanks. I've been letting this repo stagnate a bit and plan to do some cleanup over the next few weekends. I'll get the build functioning again and get CI moved over to GitHub Actions.