Skip to content

[package] flex/2.6.4: Build failed on riscv64 arch due to outdated configure script #28552

@dmitryikh

Description

@dmitryikh

Description

flex/2.6.4 although the latest version, is quite old package (released in 2017), ./configure script can't recognize the new riscv64 architecture. The package build fails.

While this is upstream issue, not related to conan directly, the flex package is a dependency for large number of well known packages (a few of them: libsystemd, thrift, backward-cpp, glib, doxygen, arrow). Can we have a fix for the issue on the conan recipe side?

One of possible workarounds (suggested by the error log below) is to download newer versions of guess files:

    def build(self):
        apply_conandata_patches(self)

# fix:
        from conan.tools.files import download
        # Get config.guess and config.sub to support newer architectures like aarch64
        download(self, "https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD", "build-aux/config.guess")
        download(self, "https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD", "build-aux/config.sub")
# end fix
        autotools = Autotools(self)
        autotools.configure()
        autotools.make()

If you are ok with the fix, I will be happy to send PR.

Package and Environment Details

  • Package Name/Version: flex/2.6.4
  • Operating System+version: Linux Ubuntu 24.04
  • Compiler+version: GCC 13
  • Conan version: conan 2.21.0
  • Python version: Python 3.12.3

Conan profile

[settings]
arch=riscv64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=11
os=Linux
[platform_tool_requires]
cmake/3.28.3

Steps to reproduce

cd conan-center-index/recipes/flex/all

conan create . --name flex --version 2.6.4 --profile /profiles/riscv64-linux-gcc --profile:build=/profiles/riscv64-linux-gcc --build missing

Logs

Click to expand log
======== Exporting recipe to the cache ========
flex/2.6.4: Exporting package recipe: /workspace/recipe/conanfile.py
flex/2.6.4: exports: File 'conandata.yml' found. Exporting it...
flex/2.6.4: Calling export_sources()
flex/2.6.4: Copied 1 '.py' file: conanfile.py
flex/2.6.4: Copied 1 '.yml' file: conandata.yml
flex/2.6.4: Copied 1 '.patch' file: darwin-newer-versions.patch
flex/2.6.4: Exported to cache folder: /root/.conan2/p/flex3ddc3c1690abc/e
flex/2.6.4: Exported: flex/2.6.4#affcf4f12ba095d6b1f7a214db28b1ba (2025-10-09 18:53:47 UTC)

======== Input profiles ========
Profile host:
[settings]
arch=riscv64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=11
os=Linux
[platform_tool_requires]
cmake/3.28.3
[conf]
tools.system.package_manager:mode=install

Profile build:
[settings]
arch=riscv64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=11
os=Linux
[platform_tool_requires]
cmake/3.28.3


======== Computing dependency graph ========
Graph root
    cli
Requirements
    flex/2.6.4#affcf4f12ba095d6b1f7a214db28b1ba - Cache
    m4/1.4.19#b38ced39a01e31fef5435bc634461fd2 - Cache
Build requirements
    m4/1.4.19#b38ced39a01e31fef5435bc634461fd2 - Cache

======== Computing necessary packages ========
Connecting to remote 'conancenter' anonymously
Requirements
    flex/2.6.4#affcf4f12ba095d6b1f7a214db28b1ba:fa2a3ec2ecd1e20067aa2d35355a3886c2ace26e - Build
    m4/1.4.19#b38ced39a01e31fef5435bc634461fd2:8180c780b691a511bc15637668e0a22c1c6b6a93#533cdf7357f452139bc90f7d8e9177f0 - Cache
Build requirements
    m4/1.4.19#b38ced39a01e31fef5435bc634461fd2:8180c780b691a511bc15637668e0a22c1c6b6a93#533cdf7357f452139bc90f7d8e9177f0 - Cache

======== Installing packages ========
m4/1.4.19: Already installed! (1 of 2)

-------- Installing package flex/2.6.4 (2 of 2) --------
flex/2.6.4: Building from source
flex/2.6.4: Package flex/2.6.4:fa2a3ec2ecd1e20067aa2d35355a3886c2ace26e
flex/2.6.4: settings: os=Linux arch=riscv64 compiler=gcc compiler.version=11 build_type=Release
flex/2.6.4: options: fPIC=True shared=False
flex/2.6.4: Copying sources to build folder
flex/2.6.4: Building your package in /root/.conan2/p/b/flex4f66148738957/b
flex/2.6.4: Calling generate()
flex/2.6.4: Generators folder: /root/.conan2/p/b/flex4f66148738957/b
flex/2.6.4: Generating aggregated env files
flex/2.6.4: Generated aggregated env files: ['conanbuild.sh', 'conanrun.sh']
flex/2.6.4: Calling build()
flex/2.6.4: Apply patch (portability): missing linker flags skipped due to a problem in configure.
flex/2.6.4: RUN: "/root/.conan2/p/b/flex4f66148738957/b/configure" --disable-shared --enable-static --prefix=/ '--bindir=${prefix}/bin' '--sbindir=${prefix}/bin' '--libdir=${prefix}/lib' '--includedir=${prefix}/include' '--oldincludedir=${prefix}/include' --disable-nls --disable-bootstrap HELP2MAN=/bin/true M4=m4 ac_cv_func_malloc_0_nonnull=yes ac_cv_func_realloc_0_nonnull=yes ac_cv_func_reallocarray=no 
checking build system type... build-aux/config.guess: unable to guess system type

This script, last modified 2015-08-20, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from

  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
and
  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD

If the version you run (build-aux/config.guess) is already up to date, please
send the following data and any information you think might be
pertinent to <[email protected]> in order to provide the needed
information to handle your system.

config.guess timestamp = 2015-08-20

uname -m = riscv64
uname -r = 6.10.14-linuxkit
uname -s = Linux
uname -v = #1 SMP Thu Aug 14 19:26:13 UTC 2025

/usr/bin/uname -p = riscv64
/bin/uname -X     = 

hostinfo               = 
/bin/universe          = 
/usr/bin/arch -k       = 
/bin/arch              = riscv64
/usr/bin/oslevel       = 
/usr/convex/getsysinfo = 

UNAME_MACHINE = riscv64
UNAME_RELEASE = 6.10.14-linuxkit
UNAME_SYSTEM  = Linux
UNAME_VERSION = #1 SMP Thu Aug 14 19:26:13 UTC 2025
configure: error: cannot guess build type; you must specify one

flex/2.6.4: ERROR: 
Package 'fa2a3ec2ecd1e20067aa2d35355a3886c2ace26e' build failed
flex/2.6.4: WARN: Build folder /root/.conan2/p/b/flex4f66148738957/b
ERROR: flex/2.6.4: Error in build() method, line 76
	autotools.configure()
	ConanException: Error 1 while executing

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions