Skip to content

[libmount] Add option to disable year2038 support. #27161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wdobbe
Copy link
Contributor

@wdobbe wdobbe commented Apr 7, 2025

Summary

Changes to recipe: libmount/2.40.2

Motivation

In order to cross-compile libmount with an (old) ArmV5 toolchain I needed to configure libmount with the --disable-year2038 option.

Details

On legacy platforms sometimes the only way to get libmount compiled is to disable year2038 support.


valgur pushed a commit to valgur/conan-center-index that referenced this pull request Apr 24, 2025
@uilianries uilianries changed the title Add option to disable year2038 support. [libmount] Add option to disable year2038 support. May 7, 2025
@uilianries
Copy link
Member

@wdobbe Thank you for your suggestion! Could you please provide a more detailed case about your scenario? I see no related issue where I could reproduce your case. Could you please share a full build log where libmount is failing to build? Regards!

@wdobbe
Copy link
Contributor Author

wdobbe commented May 19, 2025

@uilianries Sorry for the late reply, I was on holiday.

Below is the log of the failed build when I don't provide the --disable-year2038 option. As mentioned this happens during cross-compiling for an old ARM926EJ-S CPU.

> conan create . --profile:build=linux_native/gcc13 --profile:host=linux_cross/armv5te_buildenv2019 --version=2.40.2

======== Exporting recipe to the cache ========
libmount/2.40.2: Exporting package recipe: /home/wdobbe/opensource/github_wd/conan-center-index/recipes/libmount/all/conanfile.py
libmount/2.40.2: exports: File 'conandata.yml' found. Exporting it...
libmount/2.40.2: Copied 1 '.yml' file: conandata.yml
libmount/2.40.2: Copied 1 '.py' file: conanfile.py
libmount/2.40.2: Exported to cache folder: /home/wdobbe/.conan2/p/libmo77164f0be7986/e
libmount/2.40.2: Exported: libmount/2.40.2#8d2e62f11a27503f5c787e11def19603 (2025-05-19 17:17:10 UTC)

======== Input profiles ========
Profile host:
[settings]
arch=armv5te
build_type=Release
compiler=gcc
compiler.cppstd=17
compiler.libcxx=libstdc++11
compiler.version=11
os=Linux
os.distro=None
[options]
libpng/*:neon=False
openssl/*:no_threads=True
qt/*:cross_compile=arm-none-linux-gnueabi-
qt/*:device=linux-arm-generic-g++
qt/*:gui=True
qt/*:opengl=no
qt/*:qtqmltools=True
qt/*:qtquicktools=True
qt/*:qtshadertools=True
qt/*:qtwayland=False
qt/*:widgets=True
qt/*:with_dbus=False
qt/*:with_gstreamer=False
qt/*:with_libalsa=False
qt/*:with_mysql=False
qt/*:with_odbc=False
qt/*:with_pq=False
qt/*:with_pulseaudio=False
qt/*:with_x11=False
[tool_requires]
*: swpt_build_env_armv5te/2019@swpt/stable
[conf]
tools.meson.mesontoolchain:extra_machine_files=['/home/wdobbe/.conan2/meson_sys_root_empty.ini']

Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=17
compiler.libcxx=libstdc++11
compiler.version=13
os=Linux
os.distro=Suse15
[options]
qt/*:opengl=desktop
qt/*:qtdeclarative=True
qt/*:qtshadertool=True
qt/*:qtshadertools=True
qt/*:qtsvg=True
qt/*:qttools=True
qt/*:qttranslations=True
qt/*:qtwebengine=False
qt/*:shared=True
qt/*:with_odbc=False
[conf]
tools.build:compiler_executables={'c': '/usr/bin/gcc-13', 'cpp': '/usr/bin/g++-13'}


======== Computing dependency graph ========
Graph root
    cli
Requirements
    libmount/2.40.2#8d2e62f11a27503f5c787e11def19603 - Cache
Build requirements
    swpt_build_env_armv5te/2019@swpt/stable#dd3798bd050bbed7fe3052c8359d3805 - Cache

======== Computing necessary packages ========
libmount/2.40.2: Forced build from source
Requirements
    libmount/2.40.2#8d2e62f11a27503f5c787e11def19603:9fe5d898bb6bffc655a81713278595dbd06f4b7a - Build
Build requirements
    swpt_build_env_armv5te/2019@swpt/stable#dd3798bd050bbed7fe3052c8359d3805:cd34a1f72d7d5dd2c159e451ab9063cc2c01073b#ab1aff610b6dfb3a95aa37f13f386445 - Cache

======== Installing packages ========
swpt_build_env_armv5te/2019@swpt/stable: Already installed! (1 of 2)

-------- Installing package libmount/2.40.2 (2 of 2) --------
libmount/2.40.2: Building from source
libmount/2.40.2: Package libmount/2.40.2:9fe5d898bb6bffc655a81713278595dbd06f4b7a
libmount/2.40.2: Copying sources to build folder
libmount/2.40.2: Building your package in /home/wdobbe/.conan2/p/b/libmobb01738c624ad/b
libmount/2.40.2: Calling generate()
libmount/2.40.2: Generators folder: /home/wdobbe/.conan2/p/b/libmobb01738c624ad/b/build-release/conan
libmount/2.40.2: Generating aggregated env files
libmount/2.40.2: Generated aggregated env files: ['conanbuild.sh', 'conanrun.sh']
libmount/2.40.2: Calling build()
libmount/2.40.2: RUN: "/home/wdobbe/.conan2/p/b/libmobb01738c624ad/b/src/configure" --disable-shared --enable-static --prefix=/ '--bindir=${prefix}/bin' '--sbindir=${prefix}/bin' '--libdir=${prefix}/lib' '--includedir=${prefix}/include' '--oldincludedir=${prefix}/include' --host=armv5-linux-gnu --build=x86_64-linux-gnu --disable-all-programs --enable-libmount --enable-libblkid 
configure: loading site script /usr/share/site/x86_64-unknown-linux-gnu
checking for armv5-linux-gnu-gcc... arm-swarco-linux-gnueabi-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether arm-swarco-linux-gnueabi-gcc accepts -g... yes
checking for arm-swarco-linux-gnueabi-gcc option to enable C11 features... none needed
checking whether arm-swarco-linux-gnueabi-gcc understands -c and -o together... yes
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for wchar.h... yes
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether _XOPEN_SOURCE should be defined... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for armv5-linux-gnu-strip... arm-swarco-linux-gnueabi-strip
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports the include directive... yes (GNU style)
checking whether make supports nested variables... yes
checking how to create a pax tar archive... gnutar
checking dependency style of arm-swarco-linux-gnueabi-gcc... gcc3
checking whether make supports nested variables... (cached) yes
checking for armv5-linux-gnu-ar... arm-swarco-linux-gnueabi-ar
checking the archiver (arm-swarco-linux-gnueabi-ar) interface... ar
checking for armv5-linux-gnu-gcc... (cached) arm-swarco-linux-gnueabi-gcc
checking whether the compiler supports GNU C... (cached) yes
checking whether arm-swarco-linux-gnueabi-gcc accepts -g... (cached) yes
checking for arm-swarco-linux-gnueabi-gcc option to enable C11 features... (cached) none needed
checking whether arm-swarco-linux-gnueabi-gcc understands -c and -o together... (cached) yes
checking for bison... bison -y
checking for a sed that does not truncate output... /usr/bin/sed
checking for flex... /usr/bin/flex
checking for bison... /usr/bin/bison
checking build system type... x86_64-pc-linux-gnu
checking host system type... armv5-unknown-linux-gnu
checking for an ANSI C-conforming const... yes
checking for working volatile... yes
checking how to run the C preprocessor... arm-swarco-linux-gnueabi-gcc -E
checking whether compiler handles -fno-common... yes
checking whether compiler handles -Wall... yes
checking whether compiler handles -Wextra... yes
checking whether compiler handles -Waddress-of-packed-member... yes
checking whether compiler handles -Wdiscarded-qualifiers... yes
checking whether compiler handles -Wembedded-directive... no
checking whether compiler handles -Wextra-semi... no
checking whether compiler handles -Wformat-security... no
checking whether compiler handles -Wimplicit-function-declaration... yes
checking whether compiler handles -Wmissing-declarations... yes
checking whether compiler handles -Wmissing-parameter-type... yes
checking whether compiler handles -Wmissing-prototypes... yes
checking whether compiler handles -Wnested-externs... yes
checking whether compiler handles -Wno-missing-field-initializers... yes
checking whether compiler handles -Wold-style-definition... yes
checking whether compiler handles -Wpointer-arith... yes
checking whether compiler handles -Wredundant-decls... yes
checking whether compiler handles -Wsign-compare... yes
checking whether compiler handles -Wstrict-prototypes... yes
checking whether compiler handles -Wtype-limits... yes
checking whether compiler handles -Wuninitialized... yes
checking whether compiler handles -Wunused-but-set-parameter... yes
checking whether compiler handles -Wunused-but-set-variable... yes
checking whether compiler handles -Wunused-parameter... yes
checking whether compiler handles -Wunused-result... yes
checking whether compiler handles -Wunused-variable... yes
checking whether compiler handles -Wvla... yes
checking whether compiler handles -Walloca... yes
checking whether compiler handles -Werror=sequence-point... yes
checking whether compiler handles -Wno-clobbered... yes
checking whether compiler handles -Wno-cast-function-type... yes
checking whether the compiler supports GNU C++... yes
checking whether arm-swarco-linux-gnueabi-g++ accepts -g... yes
checking for arm-swarco-linux-gnueabi-g++ option to enable C++11 features... none needed
checking dependency style of arm-swarco-linux-gnueabi-g++... gcc3
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by arm-swarco-linux-gnueabi-gcc... /home/wdobbe/.conan2/p/b/swpt_e5deddf670422/p/arm-swarco-linux-gnueabi/bin/ld
checking if the linker (/home/wdobbe/.conan2/p/b/swpt_e5deddf670422/p/arm-swarco-linux-gnueabi/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... arm-swarco-linux-gnueabi-nm
checking the name lister (arm-swarco-linux-gnueabi-nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to armv5-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /home/wdobbe/.conan2/p/b/swpt_e5deddf670422/p/arm-swarco-linux-gnueabi/bin/ld option to reload object files... -r
checking for armv5-linux-gnu-file... no
checking for file... file
configure: WARNING: using cross tools not prefixed with host triplet
checking for armv5-linux-gnu-objdump... arm-swarco-linux-gnueabi-objdump
checking how to recognize dependent libraries... pass_all
checking for armv5-linux-gnu-dlltool... no
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for armv5-linux-gnu-ar... (cached) arm-swarco-linux-gnueabi-ar
checking for archiver @FILE support... @
checking for armv5-linux-gnu-strip... (cached) arm-swarco-linux-gnueabi-strip
checking for armv5-linux-gnu-ranlib... arm-swarco-linux-gnueabi-ranlib
checking command to parse arm-swarco-linux-gnueabi-nm output from arm-swarco-linux-gnueabi-gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for armv5-linux-gnu-mt... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if arm-swarco-linux-gnueabi-gcc supports -fno-rtti -fno-exceptions... no
checking for arm-swarco-linux-gnueabi-gcc option to produce PIC... -fPIC -DPIC
checking if arm-swarco-linux-gnueabi-gcc PIC flag -fPIC -DPIC works... yes
checking if arm-swarco-linux-gnueabi-gcc static flag -static works... yes
checking if arm-swarco-linux-gnueabi-gcc supports -c -o file.o... yes
checking if arm-swarco-linux-gnueabi-gcc supports -c -o file.o... (cached) yes
checking whether the arm-swarco-linux-gnueabi-gcc linker (/home/wdobbe/.conan2/p/b/swpt_e5deddf670422/p/arm-swarco-linux-gnueabi/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... arm-swarco-linux-gnueabi-g++ -E
checking for ld used by arm-swarco-linux-gnueabi-g++... /home/wdobbe/.conan2/p/b/swpt_e5deddf670422/p/arm-swarco-linux-gnueabi/bin/ld
checking if the linker (/home/wdobbe/.conan2/p/b/swpt_e5deddf670422/p/arm-swarco-linux-gnueabi/bin/ld) is GNU ld... yes
checking whether the arm-swarco-linux-gnueabi-g++ linker (/home/wdobbe/.conan2/p/b/swpt_e5deddf670422/p/arm-swarco-linux-gnueabi/bin/ld) supports shared libraries... yes
checking for arm-swarco-linux-gnueabi-g++ option to produce PIC... -fPIC -DPIC
checking if arm-swarco-linux-gnueabi-g++ PIC flag -fPIC -DPIC works... yes
checking if arm-swarco-linux-gnueabi-g++ static flag -static works... yes
checking if arm-swarco-linux-gnueabi-g++ supports -c -o file.o... yes
checking if arm-swarco-linux-gnueabi-g++ supports -c -o file.o... (cached) yes
checking whether the arm-swarco-linux-gnueabi-g++ linker (/home/wdobbe/.conan2/p/b/swpt_e5deddf670422/p/arm-swarco-linux-gnueabi/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking linker version script flag... --version-script
checking if version scripts can use complex wildcards... yes
checking for armv5-linux-gnu-pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking whether to build gtk-doc documentation... no
checking for gtkdoc-check... no
checking for xsltproc... /usr/bin/xsltproc
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... 64
checking whether to enable assertions... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for arm-swarco-linux-gnueabi-gcc options needed to detect all undeclared functions... none needed
checking for struct tm.tm_zone... yes
checking for arm-swarco-linux-gnueabi-gcc option for timestamps after 2038... support not detected
configure: error: in `/home/wdobbe/.conan2/p/b/libmobb01738c624ad/b/build-release':
configure: error: could not enable timestamps after mid-January 2038.
This package recommends support for these later
timestamps. However, to proceed with signed 32-bit
time_t even though it will fail then, configure with
'--disable-year2038'.
See `config.log' for more details

libmount/2.40.2: ERROR: 
Package '9fe5d898bb6bffc655a81713278595dbd06f4b7a' build failed
libmount/2.40.2: WARN: Build folder /home/wdobbe/.conan2/p/b/libmobb01738c624ad/b/build-release
ERROR: libmount/2.40.2: Error in build() method, line 66
        autotools.configure()
        ConanException: Error 1 while executing

@uilianries
Copy link
Member

@wdobbe Thank you for providing more details—your scenario is much clearer now.

I see your case as very specific for cross-building and very reserved for your build. In Conan Center Index, we try to avoid adding new recipe options unless they reflect a well-used variant or add an extra dependency when building. This is because the CI does not validate extra options, and it is not only a further review, including local build, but also affects the package ID, resulting in a cascade effect over other packages that are consuming the specific package.

Talking about the --disable-year2038 variant, I did not find any other package manager using it, or giving it as a build option:

Plus, I did not find a quorum in ConanCenterIndex, based on opened issues, asking for the same option.

Based on that, I'm not inclined to accept this change, but this does not mean you will be blocked. Here are some options that you can adopt to fix your situation:

  • Upcoming Feature: Conan 2.17 will introduce a new configuration to allow extra configure arguments without modifying the recipe. Right now, there is an open PR with the feature: Add support for extra configure arguments conan#18333

    Once it's merged, you can use it directly from the develop2 branch, and add the conf:
    tools.gnu:extra_configure_args=['--disable-year2038']

  • Use a forked version of that recipe on GitHub or any other code platform.

  • Use Local Recipes Index Repository with your changed recipe.

  • Use Artifactory to store your changed package and consume it from your own remote.

I hope these suggestions help. Please feel free to share your thoughts or ask further questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants