Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 674680 - app-misc/jq-1.6-r2 USE=oniguruma doesn't use oniguruma
Summary: app-misc/jq-1.6-r2 USE=oniguruma doesn't use oniguruma
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Tim Harder
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-06 14:39 UTC by Michael Meier
Modified: 2019-05-22 12:02 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Build log for building jq with oniguruma (build.log,154.56 KB, text/plain)
2019-01-06 14:39 UTC, Michael Meier
Details
Patched jq-1.6-never-bundle-oniguruma.patch (jq-1.6-never-bundle-oniguruma.patch,2.74 KB, patch)
2019-01-06 14:43 UTC, Michael Meier
Details | Diff
a corrected version of the patch (jq-1.6-never-bundle-oniguruma.patch,1.23 KB, patch)
2019-03-09 14:02 UTC, Rafał Mużyło
Details | Diff
proposed portage/2.4 elt-patch (2.4,2.81 KB, patch)
2019-03-09 14:08 UTC, Rafał Mużyło
Details | Diff
jq-1.6-fix-oniguruma.patch (jq-1.6-fix-oniguruma.patch,1.50 KB, patch)
2019-04-12 19:56 UTC, Robin Johnson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Meier 2019-01-06 14:39:06 UTC
Created attachment 560096 [details]
Build log for building jq with oniguruma

Hey All,

after emerging app-misc/jq-1.6-r2 with "+oniguruma", I'm still getting an error that jq has been build without Regex support:

~ $ echo '["hello","world","!"]' | jq -r '.[] | test("hello")'
jq: error (at <stdin>:1): jq was compiled without ONIGURUMA regex libary. match/test/sub and related functions are not available.

See attached build log.

Here is the ouput of emerge --info app-misc/jq:

Portage 2.3.53 (python 3.6.6-final-0, default/linux/amd64/17.0, gcc-8.2.0, glibc-2.28-r4, 4.20.0-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.20.0-gentoo-x86_64-AMD_Ryzen_7_1700X_Eight-Core_Processor-with-gentoo-2.6
KiB Mem:    16439376 total,  10387476 free
KiB Swap:    2047996 total,   2047996 free
Timestamp of repository gentoo: Thu, 03 Jan 2019 10:00:01 +0000
Head commit of repository gentoo: 005ff389649971fffff21b15868597a7a8a447a8
Head commit of repository meiers_repo: 610374c344a325b1f1d093e1dfe7e04bb90b0545

sh bash 4.4_p23
ld GNU ld (Gentoo 2.31.1 p5) 2.31.1
app-shells/bash:          4.4_p23::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.26.2::gentoo
dev-lang/python:          2.7.15::gentoo, 3.6.6::gentoo
dev-util/cmake:           3.13.2::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.40.3::gentoo
sys-apps/sandbox:         2.14::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.16.1-r1::gentoo
sys-devel/binutils:       2.31.1-r3::gentoo
sys-devel/gcc:            8.2.0-r6::gentoo
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r5::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.20::gentoo (virtual/os-headers)
sys-libs/glibc:           2.28-r4::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-jobs: 1
    sync-rsync-extra-opts: 
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes

portage_test
    location: /usr/local/portage_test
    masters: gentoo
    priority: -999

meiers_repo
    location: /usr/local/portage
    sync-type: git
    sync-uri: https://git.theben.cloudns.pro/mmeier/gentoo_overlay.git
    sync-user: portage:portage
    masters: gentoo

crossdev
    location: /usr/local/portage-crossdev
    masters: gentoo
    priority: 10

brother-overlay
    location: /var/lib/layman/brother-overlay
    sync-type: laymansync
    sync-uri: https://github.com/stefan-langenmaier/brother-overlay.git
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA PUEL NVIDIA-CUDA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=znver1"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -march=znver1"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="rsync://mirror.eu.oneandone.net/gentoo/ http://mirror.eu.oneandone.net/linux/distributions/gentoo/gentoo/ ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo rsync://mirror.netcologne.de/gentoo/ http://mirror.netcologne.de/gentoo/ ftp://mirror.netcologne.de/gentoo/ http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ ftp://ftp.halifax.rwth-aachen.de/gentoo/ http://ftp.halifax.rwth-aachen.de/gentoo/ rsync://ftp.halifax.rwth-aachen.de/gentoo/ ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo ftp://ftp.uni-erlangen.de/pub/mirrors/gentoo http://ftp.uni-erlangen.de/pub/mirrors/gentoo rsync://ftp-stud.hs-esslingen.de/gentoo/ ftp://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/ http://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/"
LANG="de_DE.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="de en"
MAKEOPTS="-j9"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X aac acl acpi alsa amd64 bash-completion berkdb branding bzip2 cairo cdr clang cli consolekit crypt cups cxx dbus dri ffmpeg fontconfig fortran fuse gdbm gif git gnome-keyring gtk iconv inotify ipv6 jpeg libnotify libtirpc linguas_de linguas_en lm_sensors matroska mime mp3 mp4 mpeg multilib ncurses networkmanager nls nptl ogg opengl openmp pam pcre pdf png policykit postscript pulseaudio readline scanner seccomp smp sound spell ssl svg syslog tcpd threads truetype udev udisks unicode vaapi vdpau vorbis xattr xfce xinerama xscreensaver zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon plan sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" L10N="de en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-1" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6 python3_6" RUBY_TARGETS="ruby23 ruby24" USERLAND="GNU" VIDEO_CARDS="amdgpu radeonsi" XFCE_PLUGINS="clock" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

app-misc/jq-1.6-r2::gentoo was built with the following:
USE="oniguruma -static-libs" ABI_X86="(64)"
Comment 1 Michael Meier 2019-01-06 14:41:38 UTC
After looking closer at the build output, I noticed that "oniguruma" didn't show up in configure's output at all.
I finally ended up looking at the "jq-1.6-never-bundle-oniguruma.patch" patch. Therein, the line 
 build_oniguruma=no
is removed, but a few lines further down, the if condition
  AS_IF([test "x$build_oniguruma" = xno]
remains, but is never true, thus oniguruma is never handled and jq is compiled without it.

I've attached an updated jq-1.6-never-bundle-oniguruma.patch where that if condition is completely removed. That works as intended:

~ $ echo '["hello","world","!"]' | jq -r '.[] | test("hello")'
true
false
false
Comment 2 Michael Meier 2019-01-06 14:43:04 UTC
Created attachment 560098 [details, diff]
Patched jq-1.6-never-bundle-oniguruma.patch
Comment 3 Rafał Mużyło 2019-03-09 14:02:21 UTC
Created attachment 568294 [details, diff]
a corrected version of the patch

TBH, this bug should be renamed to "sometimes autotools are damn hard, aren't they ?".

First of all, current jq-1.6-never-bundle-oniguruma.patch is nonsense.
It doesn't unbundle oniguruma, it just ensures it's *never* used.

Second, jq-1.6-runpath.patch is the wrong solution.
What is needed is an updated jq-1.5-dynamic-link.patch.
I suspect the upstream isn't using that '-static-libtool-libs' flag properly in the first place, but that's a different problem.

Though there's one other thing...
Comment 4 Rafał Mużyło 2019-03-09 14:08:50 UTC
Created attachment 568312 [details, diff]
proposed portage/2.4 elt-patch

That thing is that elt-patches most likely should have been updated a few years ago for libtool 2.4.

Now, I can't really tell if I figured it out correctly, but it would seem that following patch would be equivalent to the one for 2.2.
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-03-09 16:59:51 UTC
@base-system, could you look at that patch?
Comment 6 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2019-04-12 19:56:09 UTC
Created attachment 572632 [details, diff]
jq-1.6-fix-oniguruma.patch

The above patches are needlessly complicated: system oniguruma supports pkgconfig, and that can be used with a MUCH smaller change (and more likely to be accepted by upstream).
Comment 7 Larry the Git Cow gentoo-dev 2019-04-12 21:10:27 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0d6f69a4b08c32aec8e8c65f48cc6d75274830d1

commit 0d6f69a4b08c32aec8e8c65f48cc6d75274830d1
Author:     Patrick McLean <patrick.mclean@sony.com>
AuthorDate: 2019-04-12 21:06:46 +0000
Commit:     Patrick McLean <chutzpah@gentoo.org>
CommitDate: 2019-04-12 21:07:47 +0000

    app-misc/jq: Revbump, fix oniguruma patch (bug #674680)
    
    Patch by Robin Johnson <robbat2@gentoo.org>
    Closes: https://bugs.gentoo.org/674680
    Copyright: Sony Interactive Entertainment Inc.
    Package-Manager: Portage-2.3.62, Repoman-2.3.12
    Signed-off-by: Patrick McLean <chutzpah@gentoo.org>

 .../jq/files/jq-1.6-never-bundle-oniguruma.patch   | 80 ----------------------
 .../files/jq-1.6-r3-never-bundle-oniguruma.patch   | 27 ++++++++
 app-misc/jq/{jq-1.6-r2.ebuild => jq-1.6-r3.ebuild} |  6 +-
 3 files changed, 30 insertions(+), 83 deletions(-)
Comment 8 Rafał Mużyło 2019-05-22 12:02:49 UTC
...in the hindsight, I should have CC to the bug...

Now I've missed the best time.

Still, I need to stress two things:

1. the question about elt-patches wasn't meant in the context of this bug, but in the general one (base-system)

2. regardless of whether or not was my oniguruma detection patch "needlessly complicated", my point about jq-1.6-runpath.patch stands - properly updating jq-1.5-dynamic-link.patch is much closer to a proper solution, than that runpath hack has any chance to be.