Opened 18 months ago

Closed 18 months ago

Last modified 18 months ago

#67475 closed defect (fixed)

diffutils @3.10_0+universal: error: this system appears to support timestamps after mid-January 2038, but no mechanism for enabling wide 'time_t' was detected. Did you mean to build a 64-bit binary?

Reported by: RobK88 Owned by: RobK88
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: Cc:
Port: diffutils

Description (last modified by RobK88)

diffutils fails to configure on High Sierra.

It looks like either CC="/usr/bin/clang -m64" or --disable-year2038 needs to be added as flags.

See below:

--->  Configuring diffutils
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_diffutils/diffutils/work/diffutils-3.10" && ./configure --prefix=/opt/local --disable-dependency-tracking --program-prefix=g --infodir=/opt/local/share/info --mandir=/opt/local/share/man 
checking for a BSD-compatible install... /usr/bin/install -c
checking whether sleep supports fractional seconds... true
checking the filesystem timestamp resolution... 0.7
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /opt/local/bin/gmkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking xargs -n works... yes
checking for gawk... (cached) gawk
checking for gcc... /usr/bin/clang
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... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether /usr/bin/clang accepts -g... yes
checking for /usr/bin/clang option to enable C11 features... none needed
checking whether /usr/bin/clang understands -c and -o together... yes
checking whether the compiler is clang... yes
checking for compiler option needed when checking for declarations... -Werror=implicit-function-declaration
checking whether make supports the include directive... yes (GNU style)
checking dependency style of /usr/bin/clang... none
checking for ranlib... ranlib
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 for sys/socket.h... yes
checking for error.h... no
checking for fnmatch.h... yes
checking for getopt.h... yes
checking for sys/cdefs.h... yes
checking for sys/time.h... yes
checking for threads.h... no
checking for iconv.h... yes
checking for limits.h... yes
checking for crtdefs.h... no
checking for wctype.h... yes
checking for langinfo.h... yes
checking for xlocale.h... yes
checking for sys/mman.h... yes
checking for sys/param.h... yes
checking for malloc.h... no
checking for stdbool.h... yes
checking for stdckdint.h... no
checking for sys/random.h... yes
checking for sys/wait.h... yes
checking for features.h... no
checking for arpa/inet.h... yes
checking for netdb.h... yes
checking for netinet/in.h... yes
checking for sys/select.h... yes
checking for pthread.h... yes
checking for sys/ioctl.h... yes
checking for sys/uio.h... yes
checking for vfork.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether _XOPEN_SOURCE should be defined... no
checking build system type... x86_64-apple-darwin17.7.0
checking host system type... x86_64-apple-darwin17.7.0
checking how to run the C preprocessor... /usr/bin/clang -E
checking for egrep -e... /usr/bin/grep -E
checking for Minix Amsterdam compiler... no
checking for ar... ar
checking for /usr/bin/clang option to enable large file support... none needed
checking for /usr/bin/clang option for timestamps after 2038... support not detected
configure: error: in '/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_diffutils/diffutils/work/diffutils-3.10':
configure: error: this system appears to support timestamps after
mid-January 2038, but no mechanism for enabling wide
'time_t' was detected. Did you mean to build a 64-bit
binary? (E.g., 'CC="/usr/bin/clang -m64"'.) To proceed with
32-bit time_t, configure with '--disable-year2038'.
See 'config.log' for more details
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_diffutils/diffutils/work/diffutils-3.10" && ./configure --prefix=/opt/local --disable-dependency-tracking --program-prefix=g --infodir=/opt/local/share/info --mandir=/opt/local/share/man 
Exit code: 1
Error: Failed to configure diffutils: consult /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_diffutils/diffutils/work/diffutils-3.10/config.log
Error: Failed to configure diffutils: configure failure: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_diffutils/diffutils/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.

see attached main.log

Attachments (1)

main.log (14.7 KB) - added by RobK88 18 months ago.

Download all attachments as: .zip

Change History (11)

Changed 18 months ago by RobK88

Attachment: main.log added

comment:1 Changed 18 months ago by RobK88

Description: modified (diff)

comment:2 Changed 18 months ago by ryandesign (Ryan Carsten Schmidt)

Summary: diffutils@3.10_0 Fails to Configure on High Sierradiffutils @3.10_0+universal: error: this system appears to support timestamps after mid-January 2038, but no mechanism for enabling wide 'time_t' was detected. Did you mean to build a 64-bit binary?

This is happening because you are using the universal variant, thus requesting both a 32-bit and 64-bit build. The 32-bit build is the one producing this complaint. The suggestion to use -m64, to cause a 64-bit build to be performed, is thus inapplicable. If you wanted a 64-bit-only build you wouldn't use the universal variant.

This complaint is part of gnulib, which diffutils uses. Other ports that use gnulib also need to work around this complaint for 32-bit builds. gnulib has already twice changed the mechanism by which the complaint can be disabled. When diffutils updates to a newer gnulib, it will need to have the complaint suppression method updated as well. See #55643 for the initial method we used in the coreutils port. See #65457 for how coreutils had to be adapted after gnulib changed the first time. (Although the error message you showed is different, this fix looks like it will be the one to use for the version of gnulib diffutils currently uses.) See #67277 for how coreutils needed to be changed after the second gnulib change.

Last edited 18 months ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:3 Changed 18 months ago by RobK88

Thanks Ryan for all the info! When I get a chance, I will see what can do to fix the bug in the Portfile. Right Now I am trying to finish 4 other ports. Once that is done, I will take a look at this port.

comment:4 Changed 18 months ago by RobK88

@ryandesign - Ryan, I tried the latest workaround used in the coreutils port -- (i.e adding ac_year2038_required=no to config.args-append) but it did not work for this port - diffutils. See

Executing:  cd "/opt/local/var/macports/build/_Users_grinch_Development_MacPorts_local-repo_ports_sysutils_diffutils/diffutils/work/diffutils-3.10" && ./configure --prefix=/opt/local --disable-dependency-tracking --program-prefix=g --infodir=/opt/local/share/info --mandir=/opt/local/share/man --disable-silent-rules ac_year2038_required=no 
checking for a BSD-compatible install... /usr/bin/install -c
checking whether sleep supports fractional seconds... true
checking the filesystem timestamp resolution... 0.7
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /opt/local/bin/gmkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking xargs -n works... yes
checking for gawk... (cached) gawk
checking for gcc... /usr/bin/clang
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... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether /usr/bin/clang accepts -g... yes
checking for /usr/bin/clang option to enable C11 features... none needed
checking whether /usr/bin/clang understands -c and -o together... yes
checking whether the compiler is clang... yes
checking for compiler option needed when checking for declarations... -Werror=implicit-function-declaration
checking whether make supports the include directive... yes (GNU style)
checking dependency style of /usr/bin/clang... none
checking for ranlib... ranlib
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 for sys/socket.h... yes
checking for error.h... no
checking for fnmatch.h... yes
checking for getopt.h... yes
checking for sys/cdefs.h... yes
checking for sys/time.h... yes
checking for threads.h... no
checking for iconv.h... yes
checking for limits.h... yes
checking for crtdefs.h... no
checking for wctype.h... yes
checking for langinfo.h... yes
checking for xlocale.h... yes
checking for sys/mman.h... yes
checking for sys/param.h... yes
checking for malloc.h... no
checking for stdbool.h... yes
checking for stdckdint.h... no
checking for sys/random.h... yes
checking for sys/wait.h... yes
checking for features.h... no
checking for arpa/inet.h... yes
checking for netdb.h... yes
checking for netinet/in.h... yes
checking for sys/select.h... yes
checking for pthread.h... yes
checking for sys/ioctl.h... yes
checking for sys/uio.h... yes
checking for vfork.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether _XOPEN_SOURCE should be defined... no
checking build system type... x86_64-apple-darwin17.7.0
checking host system type... x86_64-apple-darwin17.7.0
checking how to run the C preprocessor... /usr/bin/clang -E
checking for egrep -e... /usr/bin/grep -E
checking for Minix Amsterdam compiler... no
checking for ar... ar
checking for /usr/bin/clang option to enable large file support... none needed
checking for /usr/bin/clang option for timestamps after 2038... support not detected
configure: error: in '/opt/local/var/macports/build/_Users_grinch_Development_MacPorts_local-repo_ports_sysutils_diffutils/diffutils/work/diffutils-3.10':
configure: error: this system appears to support timestamps after
mid-January 2038, but no mechanism for enabling wide
'time_t' was detected. Did you mean to build a 64-bit
binary? (E.g., 'CC="/usr/bin/clang -m64"'.) To proceed with
32-bit time_t, configure with '--disable-year2038'.
See 'config.log' for more details
Command failed:  cd "/opt/local/var/macports/build/_Users_grinch_Development_MacPorts_local-repo_ports_sysutils_diffutils/diffutils/work/diffutils-3.10" && ./configure --prefix=/opt/local --disable-dependency-tracking --program-prefix=g --infodir=/opt/local/share/info --mandir=/opt/local/share/man --disable-silent-rules ac_year2038_required=no 
Exit code: 1
Error: Failed to configure diffutils: consult /opt/local/var/macports/build/_Users_grinch_Development_MacPorts_local-repo_ports_sysutils_diffutils/diffutils/work/diffutils-3.10/config.log
Error: Failed to configure diffutils: configure failure: command execution failed
Error: See /opt/local/var/macports/logs/_Users_grinch_Development_MacPorts_local-repo_ports_sysutils_diffutils/diffutils/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Last edited 18 months ago by RobK88 (previous) (diff)

comment:5 Changed 18 months ago by RobK88

But using --disable-year2038 does work. (see Below).

Maybe we can add a pre-configure{} code block which checks whether the +universal variant is being built. If so, add --disable-year2038 to configure.args-append

Grinchs-MBP:~ grinch$ /opt/local/bin/gdiff --version
diff (GNU diffutils) 3.10
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Paul Eggert, Mike Haertel, David Hayes,
Richard Stallman, and Len Tower.
Grinchs-MBP:~ grinch$ 
Grinchs-MBP:~ grinch$ file /opt/local/bin/gdiff
/opt/local/bin/gdiff: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [i386:Mach-O executable i386]
/opt/local/bin/gdiff (for architecture x86_64):	Mach-O 64-bit executable x86_64
/opt/local/bin/gdiff (for architecture i386):	Mach-O executable i386
Last edited 18 months ago by RobK88 (previous) (diff)

comment:6 Changed 18 months ago by RobK88

How would one test in a Portfile if the +universal variant has been selected? Is there a global variable available?

comment:7 Changed 18 months ago by RobK88

I figured it out.

Here is the code I added to the Portfile that works for me:

pre-configure {
                   if [variant_isset "universal"] {
                          configure.args-append       --disable-year2038
                   }
}

P.S. I also had to change the existing configure.args in the Portfile to configure.args-append.

If you want, I can submit a Pull Request.

Last edited 18 months ago by RobK88 (previous) (diff)

comment:8 Changed 18 months ago by RobK88

I submitted a Pull Request to fix this issue with the +universal variant.

See https://github.com/macports/macports-ports/pull/18787

comment:9 Changed 18 months ago by RobK88

Owner: set to RobK88
Resolution: fixed
Status: newclosed

In 61627c173eca8ad53deeff95453e491b35744c2e/macports-ports (master):

diffutils: fix bug with +universal variant (https://github.com/macports/macports-ports/pull/18787)

Closes: #67475

  • Bump revision number
  • Add pre-configure{} code block to add the "--disable-year2038" configure flag for +universal builds
  • Change "configure.args" to "configure.args-append"
  • Add "--disable-silent-rules" flag to "configure.args-append"
  • Reformat Portfile

comment:10 Changed 18 months ago by RobK88

FYI -- I submitted another PR to fix 32-builds as noted by @ryandesign

See https://github.com/macports/macports-ports/pull/18890

Note: See TracTickets for help on using tickets.