Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 906965 - [TEST] sys-devel/reflex-20230521 failed in compile - ./mkscan.sh: line 10: ./flex: No such file or directory
Summary: [TEST] sys-devel/reflex-20230521 failed in compile - ./mkscan.sh: line 10: ./...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sam James
URL: https://ci.dev.gentoo.org:8010/#/buil...
Whiteboard:
Keywords:
Depends on:
Blocks: parallel-make
  Show dependency tree
 
Reported: 2023-05-23 04:29 UTC by Magnus Granberg
Modified: 2023-05-31 01:52 UTC (History)
1 user (show)

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


Attachments
add dependency to fix race (makefile.diff,305 bytes, patch)
2023-05-23 21:38 UTC, Thomas Dickey
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Magnus Granberg gentoo-dev 2023-05-23 04:29:07 UTC
 * Package:    sys-devel/reflex-20230521:0
 * Repository: gentoo
 * Maintainer: sam@gentoo.org
 * USE:        abi_x86_64 amd64 elibc_glibc kernel_linux
 * FEATURES:   preserve-libs sandbox userpriv usersandbox
>>> Unpacking source...
>>> Unpacking reflex-20230521.tgz to /var/tmp/portage/sys-devel/reflex-20230521/work
>>> Source unpacked in /var/tmp/portage/sys-devel/reflex-20230521/work
>>> Preparing source in /var/tmp/portage/sys-devel/reflex-20230521/work/reflex-20230521 ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/sys-devel/reflex-20230521/work/reflex-20230521 ...
 * econf: updating reflex-20230521/config.guess with /usr/share/gnuconfig/config.guess
 * econf: updating reflex-20230521/config.sub with /usr/share/gnuconfig/config.sub
>>> Source configured.
>>> Compiling source in /var/tmp/portage/sys-devel/reflex-20230521/work/reflex-20230521 ...
./mkscan.sh: line 10: ./flex: No such file or directory
main.c:(.text+0x26aa): undefined reference to `set_input_file'
dfa.c:(.text+0x1956): undefined reference to `flex_free'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: dfa.c:(.text+0x195e): undefined reference to `flex_free'
gen.c:(.text+0x27a3): undefined reference to `flex_free'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: gen.c:(.text+0x2183): undefined reference to `flexscan'
misc.c:(.text+0x5ae): undefined reference to `flex_alloc'
misc.c:(.text+0x5ef): undefined reference to `flex_alloc'
misc.c:(.text+0x66a): undefined reference to `flex_realloc'
misc.c:(.text+0x859): undefined reference to `flex_alloc'
misc.c:(.text+0x1398): undefined reference to `flex_realloc'
misc.c:(.text+0x1668): undefined reference to `flex_alloc'
sym.c:(.text+0x7e): undefined reference to `flex_alloc'
yylex.c:(.text+0x79): undefined reference to `flexscan'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: yylex.c:(.text+0x16e): undefined reference to `yytext'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: yylex.c:(.text+0x233): undefined reference to `yytext'
collect2: error: ld returned 1 exit status
make: *** [Makefile:130: flex] Error 1
 * ERROR: sys-devel/reflex-20230521::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=sys-devel/reflex-20230521::gentoo'`,
Comment 1 Magnus Granberg gentoo-dev 2023-05-23 04:29:08 UTC
This was build on a tinderbox that use Buildbot API[1].
We use docker images to build on.
Web: https://ci.dev.gentoo.org:8010/#/
Code: https://gitweb.gentoo.org/proj/tinderbox-cluster.git
Wiki: https://wiki.gentoo.org/wiki/Project:Tinderbox-cluster
How to get more info: https://wiki.gentoo.org/wiki/Project:Tinderbox-cluster/something
IRC: #gentoo-ci on libera
[1] https://buildbot.net/
Comment 2 Magnus Granberg gentoo-dev 2023-05-23 04:29:09 UTC
Was trying to build sys-devel/reflex-20230521 Commit: 1ecc3735e6264a1dbbb07076e026735581fc6eab Repository: git@gitlab.gentoo.org:zorry/gentoo-ci.git
Package info:
[ebuild  N    ] sys-devel/reflex-20230521  USE="-verify-sig" 
Emerge info:
Portage 3.0.47 (python 3.11.3-final-0, default/linux/amd64/17.1, gcc-13, glibc-2.37-r3, 5.4.0-148-generic x86_64)
=================================================================
System uname: Linux-5.4.0-148-generic-x86_64-AMD_Opteron-TM-_Processor_6272-with-glibc2.37
KiB Mem:   264126696 total, 205130068 free
KiB Swap:    8388604 total,   8388604 free
Head commit of repository gentoo: 981f36533f7d0930bcb794d305e392678e83da5b

sh bash 5.2_p15-r3
ld GNU ld (Gentoo 2.40 p5) 2.40.0
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p15-r3::gentoo
dev-lang/perl:             5.36.1-r1::gentoo
dev-lang/python:           3.10.11::gentoo, 3.11.3::gentoo
dev-lang/rust-bin:         1.69.0::gentoo
dev-util/cmake:            3.26.4-r1::gentoo
dev-util/meson:            1.1.0::gentoo
sys-apps/baselayout:       2.13-r1::gentoo
sys-apps/openrc:           0.47.1::gentoo
sys-apps/sandbox:          2.30-r1::gentoo
sys-devel/autoconf:        2.71-r6::gentoo
sys-devel/automake:        1.16.5-r1::gentoo
sys-devel/binutils:        2.40-r5::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/gcc:             13.1.1_p20230520::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/make:            4.4.1-r1::gentoo
sys-kernel/linux-headers:  6.3::gentoo (virtual/os-headers)
sys-libs/glibc:            2.37-r3::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: git@gitlab.gentoo.org:zorry/gentoo-ci.git
    priority: -1000
    volatile: False

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -fno-diagnostics-color -march=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -fno-diagnostics-color -march=native"
DISTDIR="/var/cache/portage/distfiles"
EMERGE_DEFAULT_OPTS="--buildpkg=y --rebuild-if-new-rev=y --rebuilt-binaries=y --usepkg=y --binpkg-respect-use=y --binpkg-changed-deps=y --nospinner --color=n --ask=n --quiet-build=y --quiet-fail=y"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-O2 -pipe -fno-diagnostics-color -march=native"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg buildpkg-live compress-build-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict parallel-fetch preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms split-log strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -fno-diagnostics-color -march=native"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="C.UTF8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
MAKEOPTS="-j14"
PKGDIR="/var/cache/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 acl amd64 bzip2 cli crypt dri elogind fortran gdbm iconv ipv6 libtirpc multilib ncurses nls nptl openmp pam pcre readline seccomp split-usr ssl test-rust unicode xattr zlib" ABI_X86="64" ADA_TARGET="gnat_2021" 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 sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis 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" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_10 python3_9 python3_8 python3_11 python3_12" RUBY_TARGETS="ruby31 ruby30 ruby29 ruby32" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SHELL, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-23 04:36:10 UTC
This is the same as bug 883611, I think. It's a race.

Arsen wrote a patch at https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-devel/reflex/files/reflex-20230206-parallel-build.patch?id=5f14870405eb92a33d12a55c38fa67ffe93b9a86. I think he sent it upstream but I'm not sure (it was a little while ago now so long paged out..)
Comment 4 Thomas Dickey 2023-05-23 07:29:38 UTC
thanks for the reminder (I haven't been able to reproduce the race directly,
only seen it second-hand as in this report).
Comment 5 Thomas Dickey 2023-05-23 08:14:16 UTC
The suggested patch doesn't appear to introduce new problems (may fix this case).

I think that part of my difficulty in reproducing it is that my usual development
machines don't have enough CPUs.  Trying the patch directly on a more powerful
machine doesn't show a problem.

However (noting Arsen's comment about not handling failure in mkscan.sh),
if I force that script to fail, then even with this patch I get build-failures
similar to this case.  I'll investigate and see if I can improve this.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-23 08:22:23 UTC
Thanks! It took me quite a few tries as well. I think I could hit it more often with distclean first, but I'm going off memory.

There is a fast arm64 machine with a lot of cores you're welcome to use (on an ongoing basis for general work) if you're ever interested (there's also other arches too but they're not so fast).
Comment 7 Thomas Dickey 2023-05-23 21:38:05 UTC
Created attachment 862352 [details, diff]
add dependency to fix race

Adding a dependency forces the make program to process the rules in the order given (seems to work with 6-core machine).
Comment 8 Thomas Dickey 2023-05-24 20:40:31 UTC
fixed upstream

https://invisible-island.net/reflex/NEWS.html#t20230523

2023/05/23
        + modify configure script and makefile to comment-out actions which
          run the generated program if it is cross-compiled.
        + add dependency to "scan.c" rule in makefile to eliminate a race with
          the ".bootstrap" target (Gentoo #906965).
Comment 9 Larry the Git Cow gentoo-dev 2023-05-31 00:28:58 UTC
The bug has been closed via the following commit(s):

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

commit f6d4a902041340144bba7f67ee8a2591bc6be8bc
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-05-31 00:14:54 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-05-31 00:22:56 +0000

    sys-devel/reflex: add 20230523
    
    Bug: https://bugs.gentoo.org/883611
    Closes: https://bugs.gentoo.org/906965
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-devel/reflex/Manifest               |  2 ++
 sys-devel/reflex/reflex-20230523.ebuild | 22 ++++++++++++++++++++++
 2 files changed, 24 insertions(+)
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-31 01:52:33 UTC
(In reply to Thomas Dickey from comment #8)
> fixed upstream
> 
> https://invisible-island.net/reflex/NEWS.html#t20230523
> 
> 2023/05/23
>         + modify configure script and makefile to comment-out actions which
>           run the generated program if it is cross-compiled.
>         + add dependency to "scan.c" rule in makefile to eliminate a race
> with
>           the ".bootstrap" target (Gentoo #906965).

Thank you! I indeed can't reproduce it anymore. Fingers crossed :)