Skip to content

php-ctypes: cannot build (Do not inherit LC_CTYPE from environment [tests/lc_ctype_inheritance.phpt]) #398486

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

Closed
3 tasks done
pan93412 opened this issue Apr 14, 2025 · 15 comments · Fixed by #398521
Closed
3 tasks done
Labels
0.kind: bug Something is broken

Comments

@pan93412
Copy link
Contributor

Nixpkgs version

  • Unstable (25.05)

Describe the bug

php-ctypes could not be built, preventing the installation of PHP-related packages like laravel.

For reference, the working version is nixpkgs version 18dd725, while version afb73c8 does not work.

Steps to reproduce

Run nix shell nixpkgs#laravel on my macOS (arm64) and this error can be just reproduced.

Expected behaviour

It should be built.

Screenshots

Image

Relevant log output

Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking source archive /nix/store/x2xyxvj40s992fm2589i44x6liwh1wg4-php-8.3.20.tar.bz2
source root is php-8.3.20
setting SOURCE_DATE_EPOCH to timestamp 1744143678 of file "php-8.3.20/win32/wsyslog.c"
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: genfiles
@nix { "action": "setPhase", "phase": "genfiles" }
genfiles: bison version 3.8.2 (ok)
genfiles: re2c version 4.0.2 (ok)
genfiles: Generating Zend parser and lexer files
make: 「Zend/zend_language_parser.c」已是最新。
make: 「Zend/zend_language_scanner.c」已是最新。
make: 「Zend/zend_ini_parser.c」已是最新。
make: 「Zend/zend_ini_scanner.c」已是最新。
genfiles: Generating phpdbg parser and lexer files
make: 「sapi/phpdbg/phpdbg_parser.c」已是最新。
make: 「sapi/phpdbg/phpdbg_lexer.c」已是最新。
genfiles: Generating json extension parser and lexer files
make: 「ext/json/json_parser.tab.c」已是最新。
make: 「ext/json/json_scanner.c」已是最新。
genfiles: Generating PDO lexer file
make: 「ext/pdo/pdo_sql_parser.c」已是最新。
genfiles: Generating standard extension lexer files
make: 「ext/standard/var_unserializer.c」已是最新。
make: 「ext/standard/url_scanner_ex.c」已是最新。
genfiles: Generating phar extension lexer file
make: 「ext/phar/phar_path_check.c」已是最新。
Running phase: cdToExtensionRootPhase
@nix { "action": "setPhase", "phase": "cdToExtensionRootPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: configurePhase
@nix { "action": "setPhase", "phase": "configurePhase" }
Configuring for:
PHP Api Version:         20230831
Zend Module Api No:      20230831
Zend Extension Api No:   420230831
fixing libtool script ./build/ltmain.sh
patching script interpreter paths in ./configure
./configure: interpreter directive changed from "#! /bin/sh" to "/nix/store/3z1jypscq2ld48kl089ywgwd8ri2rjxq-bash-5.2p37/bin/sh"
configure flags: --disable-static --prefix=/nix/store/26x9yfmgb6f74hcbfparg6pxzbhlfpwk-php-ctype-8.3.20 --bindir=/nix/store/26x9yfmgb6f74hcbfparg6pxzbhlfpwk-php-ctype-8.3.20/bin --sbindir=/nix/store/26x9yfmgb6f74hcbfparg6pxzbhlfpwk-php-ctype-8.3.20/sbin --includedir=/nix/store/fc5pplccfdlxlsisn53drmfrmfzi1j0h-php-ctype-8.3.20-dev/include --mandir=/nix/store/26x9yfmgb6f74hcbfparg6pxzbhlfpwk-php-ctype-8.3.20/share/man --infodir=/nix/store/26x9yfmgb6f74hcbfparg6pxzbhlfpwk-php-ctype-8.3.20/share/info --docdir=/nix/store/26x9yfmgb6f74hcbfparg6pxzbhlfpwk-php-ctype-8.3.20/share/doc/php-ctype --libdir=/nix/store/26x9yfmgb6f74hcbfparg6pxzbhlfpwk-php-ctype-8.3.20/lib --libexecdir=/nix/store/26x9yfmgb6f74hcbfparg6pxzbhlfpwk-php-ctype-8.3.20/libexec --localedir=/nix/store/26x9yfmgb6f74hcbfparg6pxzbhlfpwk-php-ctype-8.3.20/share/locale --enable-ctype
checking for grep that handles long lines and -e... /nix/store/zdx9494j3rsg81makrh09v8ln5f16gjr-gnugrep-3.11/bin/grep
checking for egrep... /nix/store/zdx9494j3rsg81makrh09v8ln5f16gjr-gnugrep-3.11/bin/grep -E
checking for a sed that does not truncate output... /nix/store/pj9bj4cczgxwzgvgzjlgz5kzifwsh4ky-gnused-4.9/bin/sed
checking pkg-config is at least version 0.9.0... yes
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 clang accepts -g... yes
checking for clang option to enable C11 features... none needed
checking how to run the C preprocessor... clang -E
checking for egrep -e... (cached) /nix/store/zdx9494j3rsg81makrh09v8ln5f16gjr-gnugrep-3.11/bin/grep -E
checking for icc... no
checking for suncc... no
checking for system library directory... lib
checking if compiler supports -Wl,-rpath,... yes
checking build system type... aarch64-apple-darwin24.4.0
checking host system type... aarch64-apple-darwin24.4.0
checking target system type... aarch64-apple-darwin24.4.0
checking for PHP prefix... /nix/store/0h0biya27w18av9zaf4na43ggby7bhzb-php-8.3.20
checking for PHP includes... -I/nix/store/ag1qwqxbjd2gxxlsywd18v6l58f802dq-php-8.3.20-dev/include/php -I/nix/store/ag1qwqxbjd2gxxlsywd18v6l58f802dq-php-8.3.20-dev/include/php/main -I/nix/store/ag1qwqxbjd2gxxlsywd18v6l58f802dq-php-8.3.20-dev/include/php/TSRM -I/nix/store/ag1qwqxbjd2gxxlsywd18v6l58f802dq-php-8.3.20-dev/include/php/Zend -I/nix/store/ag1qwqxbjd2gxxlsywd18v6l58f802dq-php-8.3.20-dev/include/php/ext -I/nix/store/ag1qwqxbjd2gxxlsywd18v6l58f802dq-php-8.3.20-dev/include/php/ext/date/lib
checking for PHP extension directory... /nix/store/0h0biya27w18av9zaf4na43ggby7bhzb-php-8.3.20/lib/php/extensions
checking for PHP installed headers prefix... /nix/store/ag1qwqxbjd2gxxlsywd18v6l58f802dq-php-8.3.20-dev/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... gawk
checking whether to enable ctype functions... yes, shared
checking for a sed that does not truncate output... /nix/store/pj9bj4cczgxwzgvgzjlgz5kzifwsh4ky-gnused-4.9/bin/sed
checking for ld used by clang... ld
checking if the linker (ld) is GNU ld... no
checking for ld option to reload object files... -r
checking for BSD-compatible nm... nm
checking whether ln -s works... yes
checking how to recognize dependent libraries... (cached) pass_all
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 dlfcn.h... yes
checking the maximum length of command line arguments... 786432
checking command to parse nm output from clang object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking for dsymutil... dsymutil
checking for nmedit... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking if clang supports -fno-rtti -fno-exceptions... yes
checking for clang option to produce PIC... -fno-common
checking if clang PIC flag -fno-common works... yes
checking if clang static flag -static works... no
checking if clang supports -c -o file.o... yes
checking whether the clang linker (ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin24.4.0 dyld
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... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
checking whether the clang++ linker (ld) supports shared libraries... no
checking for clang++ option to produce PIC... 
checking if clang++ static flag  works... yes
checking if clang++ supports -c -o file.o... yes
checking whether the clang++ linker (ld) supports shared libraries... no
checking dynamic linker characteristics... darwin24.4.0 dyld
(cached) (cached) checking how to hardcode library paths into programs... immediate
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
Running phase: buildPhase
@nix { "action": "setPhase", "phase": "buildPhase" }
build flags: -j16 SHELL=/nix/store/3z1jypscq2ld48kl089ywgwd8ri2rjxq-bash-5.2p37/bin/bash
/nix/store/3z1jypscq2ld48kl089ywgwd8ri2rjxq-bash-5.2p37/bin/bash /private/tmp/nix-build-php-ctype-8.3.20.drv-0/php-8.3.20/ext/ctype/libtool --tag=CC --mode=compile clang -I. -I/private/tmp/nix-build-php-ctype-8.3.20.drv-0/php-8.3.20/ext/ctype -I/private/tmp/nix-build-php-ctype-8.3.20.drv-0/php-8.3.20/ext/ctype/include -I/private/tmp/nix-build-php-ctype-8.3.20.drv-0/php-8.3.20/ext/ctype/main -I/private/tmp/nix-build-php-ctype-8.3.20.drv-0/php-8.3.20/ext/ctype -I/nix/store/ag1qwqxbjd2gxxlsywd18v6l58f802dq-php-8.3.20-dev/include/php -I/nix/store/ag1qwqxbjd2gxxlsywd18v6l58f802dq-php-8.3.20-dev/include/php/main -I/nix/store/ag1qwqxbjd2gxxlsywd18v6l58f802dq-php-8.3.20-dev/include/php/TSRM -I/nix/store/ag1qwqxbjd2gxxlsywd18v6l58f802dq-php-8.3.20-dev/include/php/Zend -I/nix/store/ag1qwqxbjd2gxxlsywd18v6l58f802dq-php-8.3.20-dev/include/php/ext -I/nix/store/ag1qwqxbjd2gxxlsywd18v6l58f802dq-php-8.3.20-dev/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2 -D_GNU_SOURCE    -DZEND_COMPILE_DL_EXT=1 -c /private/tmp/nix-build-php-ctype-8.3.20.drv-0/php-8.3.20/ext/ctype/ctype.c -o ctype.lo  -MMD -MF ctype.dep -MT ctype.lo
mkdir .libs
 clang -I. -I/private/tmp/nix-build-php-ctype-8.3.20.drv-0/php-8.3.20/ext/ctype -I/private/tmp/nix-build-php-ctype-8.3.20.drv-0/php-8.3.20/ext/ctype/include -I/private/tmp/nix-build-php-ctype-8.3.20.drv-0/php-8.3.20/ext/ctype/main -I/private/tmp/nix-build-php-ctype-8.3.20.drv-0/php-8.3.20/ext/ctype -I/nix/store/ag1qwqxbjd2gxxlsywd18v6l58f802dq-php-8.3.20-dev/include/php -I/nix/store/ag1qwqxbjd2gxxlsywd18v6l58f802dq-php-8.3.20-dev/include/php/main -I/nix/store/ag1qwqxbjd2gxxlsywd18v6l58f802dq-php-8.3.20-dev/include/php/TSRM -I/nix/store/ag1qwqxbjd2gxxlsywd18v6l58f802dq-php-8.3.20-dev/include/php/Zend -I/nix/store/ag1qwqxbjd2gxxlsywd18v6l58f802dq-php-8.3.20-dev/include/php/ext -I/nix/store/ag1qwqxbjd2gxxlsywd18v6l58f802dq-php-8.3.20-dev/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -DZEND_COMPILE_DL_EXT=1 -c /private/tmp/nix-build-php-ctype-8.3.20.drv-0/php-8.3.20/ext/ctype/ctype.c -MMD -MF ctype.dep -MT ctype.lo  -fno-common -DPIC -o .libs/ctype.o
/nix/store/3z1jypscq2ld48kl089ywgwd8ri2rjxq-bash-5.2p37/bin/bash /private/tmp/nix-build-php-ctype-8.3.20.drv-0/php-8.3.20/ext/ctype/libtool --tag=CC --mode=link clang -shared -I/private/tmp/nix-build-php-ctype-8.3.20.drv-0/php-8.3.20/ext/ctype/include -I/private/tmp/nix-build-php-ctype-8.3.20.drv-0/php-8.3.20/ext/ctype/main -I/private/tmp/nix-build-php-ctype-8.3.20.drv-0/php-8.3.20/ext/ctype -I/nix/store/ag1qwqxbjd2gxxlsywd18v6l58f802dq-php-8.3.20-dev/include/php -I/nix/store/ag1qwqxbjd2gxxlsywd18v6l58f802dq-php-8.3.20-dev/include/php/main -I/nix/store/ag1qwqxbjd2gxxlsywd18v6l58f802dq-php-8.3.20-dev/include/php/TSRM -I/nix/store/ag1qwqxbjd2gxxlsywd18v6l58f802dq-php-8.3.20-dev/include/php/Zend -I/nix/store/ag1qwqxbjd2gxxlsywd18v6l58f802dq-php-8.3.20-dev/include/php/ext -I/nix/store/ag1qwqxbjd2gxxlsywd18v6l58f802dq-php-8.3.20-dev/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2 -D_GNU_SOURCE    -o ctype.la -export-dynamic -avoid-version -prefer-pic -module -rpath /private/tmp/nix-build-php-ctype-8.3.20.drv-0/php-8.3.20/ext/ctype/modules  ctype.lo 
clang ${wl}-undefined ${wl}dynamic_lookup -o .libs/ctype.so -bundle  .libs/ctype.o  
dsymutil .libs/ctype.so || :
creating ctype.la
(cd .libs && rm -f ctype.la && ln -s ../ctype.la ctype.la)
/nix/store/3z1jypscq2ld48kl089ywgwd8ri2rjxq-bash-5.2p37/bin/bash /private/tmp/nix-build-php-ctype-8.3.20.drv-0/php-8.3.20/ext/ctype/libtool --tag=CC --mode=install cp ./ctype.la /private/tmp/nix-build-php-ctype-8.3.20.drv-0/php-8.3.20/ext/ctype/modules
cp ./.libs/ctype.so /private/tmp/nix-build-php-ctype-8.3.20.drv-0/php-8.3.20/ext/ctype/modules/ctype.so
cp ./.libs/ctype.lai /private/tmp/nix-build-php-ctype-8.3.20.drv-0/php-8.3.20/ext/ctype/modules/ctype.la
----------------------------------------------------------------------
Libraries have been installed in:
   /private/tmp/nix-build-php-ctype-8.3.20.drv-0/php-8.3.20/ext/ctype/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
     during execution

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

Running phase: checkPhase
@nix { "action": "setPhase", "phase": "checkPhase" }

Build complete.
Don't forget to run 'make test'.


=====================================================================
PHP         : /nix/store/0h0biya27w18av9zaf4na43ggby7bhzb-php-8.3.20/bin/php 
PHP_SAPI    : cli
PHP_VERSION : 8.3.20
ZEND_VERSION: 4.3.20
PHP_OS      : Darwin - Darwin panmac2.local 24.4.0 Darwin Kernel Version 24.4.0: Wed Mar 19 21:17:37 PDT 2025; root:xnu-11417.101.15~1/RELEASE_ARM64_T6031 arm64
INI actual  : /private/tmp/nix-build-php-ctype-8.3.20.drv-0/php-8.3.20/ext/ctype/tmp-php.ini
More .INIs  :  
---------------------------------------------------------------------
PHP         : /nix/store/0h0biya27w18av9zaf4na43ggby7bhzb-php-8.3.20/bin/php-cgi 
PHP_SAPI    : cgi-fcgi
PHP_VERSION : 8.3.20
ZEND_VERSION: 4.3.20
PHP_OS      : Darwin - Darwin panmac2.local 24.4.0 Darwin Kernel Version 24.4.0: Wed Mar 19 21:17:37 PDT 2025; root:xnu-11417.101.15~1/RELEASE_ARM64_T6031 arm64
INI actual  : /private/tmp/nix-build-php-ctype-8.3.20.drv-0/php-8.3.20/ext/ctype/tmp-php.ini
More .INIs  : 
--------------------------------------------------------------------- 
---------------------------------------------------------------------
PHP         : /nix/store/0h0biya27w18av9zaf4na43ggby7bhzb-php-8.3.20/bin/phpdbg 
PHP_SAPI    : phpdbg
PHP_VERSION : 8.3.20
ZEND_VERSION: 4.3.20
PHP_OS      : Darwin - Darwin panmac2.local 24.4.0 Darwin Kernel Version 24.4.0: Wed Mar 19 21:17:37 PDT 2025; root:xnu-11417.101.15~1/RELEASE_ARM64_T6031 arm64
INI actual  : /private/tmp/nix-build-php-ctype-8.3.20.drv-0/php-8.3.20/ext/ctype/tmp-php.ini
More .INIs  : 
---------------------------------------------------------------------
CWD         : /private/tmp/nix-build-php-ctype-8.3.20.drv-0/php-8.3.20/ext/ctype
Extra dirs  : 
VALGRIND    : Not used
=====================================================================
TIME START 2025-04-14 01:35:25
=====================================================================
TEST 1/49 [tests/001.phpt]
�[1;32mPASS�[0m ctype on integers [tests/001.phpt] 
TEST 2/49 [tests/002.phpt]
�[1;32mPASS�[0m ctype on strings [tests/002.phpt] 
TEST 3/49 [tests/bug25745.phpt]
�[1;32mPASS�[0m Bug #25745 (ctype functions fail with non-ascii characters) [tests/bug25745.phpt] 
TEST 4/49 [tests/bug34645.phpt]
�[1;32mPASS�[0m Bug #34645 (ctype corrupts memory when validating large numbers) [tests/bug34645.phpt] 
TEST 5/49 [tests/ctype_alnum_basic.phpt]
�[1;32mPASS�[0m Test ctype_alnum() function : basic functionality [tests/ctype_alnum_basic.phpt] 
TEST 6/49 [tests/ctype_alnum_variation1.phpt]
�[1;32mPASS�[0m Test ctype_alnum() function : usage variations - Different data types as $c arg [tests/ctype_alnum_variation1.phpt] 
TEST 7/49 [tests/ctype_alnum_variation2.phpt]
�[1;32mPASS�[0m Test ctype_alnum() function : usage variations - different integers [tests/ctype_alnum_variation2.phpt] 
TEST 8/49 [tests/ctype_alnum_variation3.phpt]
�[1;32mPASS�[0m Test ctype_alnum() function : usage variations - different string values [tests/ctype_alnum_variation3.phpt] 
TEST 9/49 [tests/ctype_alpha_basic.phpt]
�[1;32mPASS�[0m Test ctype_alpha() function : basic functionality [tests/ctype_alpha_basic.phpt] 
TEST 10/49 [tests/ctype_alpha_variation1.phpt]
�[1;32mPASS�[0m Test ctype_alpha() function : usage variations - different data types as $c arg [tests/ctype_alpha_variation1.phpt] 
TEST 11/49 [tests/ctype_alpha_variation2.phpt]
�[1;32mPASS�[0m Test ctype_alpha() function : usage variations - different integers [tests/ctype_alpha_variation2.phpt] 
TEST 12/49 [tests/ctype_alpha_variation3.phpt]
�[1;32mPASS�[0m Test ctype_alpha() function : usage variations - different strings [tests/ctype_alpha_variation3.phpt] 
TEST 13/49 [tests/ctype_cntrl_basic.phpt]
�[1;32mPASS�[0m Test ctype_cntrl() function : basic functionality [tests/ctype_cntrl_basic.phpt] 
TEST 14/49 [tests/ctype_cntrl_variation1.phpt]
�[1;32mPASS�[0m Test ctype_cntrl() function : usage variations - Different data types as $c arg [tests/ctype_cntrl_variation1.phpt] 
TEST 15/49 [tests/ctype_cntrl_variation2.phpt]
�[1;32mPASS�[0m Test ctype_cntrl() function : usage variations - different integers [tests/ctype_cntrl_variation2.phpt] 
TEST 16/49 [tests/ctype_cntrl_variation3.phpt]
�[1;32mPASS�[0m Test ctype_cntrl() function : usage variations - Different strings [tests/ctype_cntrl_variation3.phpt] 
TEST 17/49 [tests/ctype_digit_basic.phpt]
�[1;32mPASS�[0m Test ctype_digit() function : basic functionality [tests/ctype_digit_basic.phpt] 
TEST 18/49 [tests/ctype_digit_variation1.phpt]
�[1;32mPASS�[0m Test ctype_digit() function : usage variations - different data types as $c arg [tests/ctype_digit_variation1.phpt] 
TEST 19/49 [tests/ctype_digit_variation2.phpt]
�[1;32mPASS�[0m Test ctype_digit() function : usage variations - different integers [tests/ctype_digit_variation2.phpt] 
TEST 20/49 [tests/ctype_digit_variation3.phpt]
�[1;32mPASS�[0m Test ctype_digit() function : usage variations - different strings [tests/ctype_digit_variation3.phpt] 
TEST 21/49 [tests/ctype_graph_basic.phpt]
�[1;32mPASS�[0m Test ctype_graph() function : basic functionality [tests/ctype_graph_basic.phpt] 
TEST 22/49 [tests/ctype_graph_variation1.phpt]
�[1;32mPASS�[0m Test ctype_graph() function : usage variations - different data types as $c arg [tests/ctype_graph_variation1.phpt] 
TEST 23/49 [tests/ctype_graph_variation2.phpt]
�[1;32mPASS�[0m Test ctype_graph() function : usage variations - different integers [tests/ctype_graph_variation2.phpt] 
TEST 24/49 [tests/ctype_graph_variation3.phpt]
�[1;32mPASS�[0m Test ctype_graph() function : usage variations - different strings [tests/ctype_graph_variation3.phpt] 
TEST 25/49 [tests/ctype_lower_basic.phpt]
�[1;32mPASS�[0m Test ctype_lower() function : basic functionality [tests/ctype_lower_basic.phpt] 
TEST 26/49 [tests/ctype_lower_variation1.phpt]
�[1;32mPASS�[0m Test ctype_lower() function : usage variations - different data types as $c arg [tests/ctype_lower_variation1.phpt] 
TEST 27/49 [tests/ctype_lower_variation2.phpt]
�[1;32mPASS�[0m Test ctype_lower() function : usage variations - different integers [tests/ctype_lower_variation2.phpt] 
TEST 28/49 [tests/ctype_lower_variation3.phpt]
�[1;32mPASS�[0m Test ctype_lower() function : usage variations - different strings [tests/ctype_lower_variation3.phpt] 
TEST 29/49 [tests/ctype_print_basic.phpt]
�[1;32mPASS�[0m Test ctype_print() function : basic functionality [tests/ctype_print_basic.phpt] 
TEST 30/49 [tests/ctype_print_variation1.phpt]
�[1;32mPASS�[0m Test ctype_print() function : usage variations - different data types as $c arg [tests/ctype_print_variation1.phpt] 
TEST 31/49 [tests/ctype_print_variation2.phpt]
�[1;32mPASS�[0m Test ctype_print() function : usage variations - different integers [tests/ctype_print_variation2.phpt] 
TEST 32/49 [tests/ctype_print_variation3.phpt]
�[1;32mPASS�[0m Test ctype_print() function : usage variations - different strings [tests/ctype_print_variation3.phpt] 
TEST 33/49 [tests/ctype_punct_basic.phpt]
�[1;32mPASS�[0m Test ctype_punct() function : basic functionality [tests/ctype_punct_basic.phpt] 
TEST 34/49 [tests/ctype_punct_variation1.phpt]
�[1;32mPASS�[0m Test ctype_punct() function : usage variations - different data types as $c argument [tests/ctype_punct_variation1.phpt] 
TEST 35/49 [tests/ctype_punct_variation2.phpt]
�[1;32mPASS�[0m Test ctype_punct() function : usage variations - different integers [tests/ctype_punct_variation2.phpt] 
TEST 36/49 [tests/ctype_punct_variation3.phpt]
�[1;32mPASS�[0m Test ctype_punct() function : usage variations - different punctuation [tests/ctype_punct_variation3.phpt] 
TEST 37/49 [tests/ctype_space_basic.phpt]
�[1;32mPASS�[0m Test ctype_space() function : basic functionality [tests/ctype_space_basic.phpt] 
TEST 38/49 [tests/ctype_space_variation1.phpt]
�[1;32mPASS�[0m Test ctype_space() function : usage variations - different data types as $c argument [tests/ctype_space_variation1.phpt] 
TEST 39/49 [tests/ctype_space_variation2.phpt]
�[1;32mPASS�[0m Test ctype_space() function : usage variations - different integers [tests/ctype_space_variation2.phpt] 
TEST 40/49 [tests/ctype_space_variation3.phpt]
�[1;32mPASS�[0m Test ctype_space() function : usage variations - different strings [tests/ctype_space_variation3.phpt] 
TEST 41/49 [tests/ctype_upper_basic.phpt]
�[1;32mPASS�[0m Test ctype_upper() function : basic functionality [tests/ctype_upper_basic.phpt] 
TEST 42/49 [tests/ctype_upper_variation1.phpt]
�[1;32mPASS�[0m Test ctype_upper() function : usage variations - different data types [tests/ctype_upper_variation1.phpt] 
TEST 43/49 [tests/ctype_upper_variation2.phpt]
�[1;32mPASS�[0m Test ctype_upper() function : usage variations - different integers [tests/ctype_upper_variation2.phpt] 
TEST 44/49 [tests/ctype_upper_variation3.phpt]
�[1;32mPASS�[0m Test ctype_upper() function : usage variations - different strings [tests/ctype_upper_variation3.phpt] 
TEST 45/49 [tests/ctype_xdigit_basic.phpt]
�[1;32mPASS�[0m Test ctype_xdigit() function : basic functionality [tests/ctype_xdigit_basic.phpt] 
TEST 46/49 [tests/ctype_xdigit_variation1.phpt]
�[1;32mPASS�[0m Test ctype_xdigit() function : usage variations - different data typse as $c arg [tests/ctype_xdigit_variation1.phpt] 
TEST 47/49 [tests/ctype_xdigit_variation2.phpt]
�[1;32mPASS�[0m Test ctype_xdigit() function : usage variations - different integers [tests/ctype_xdigit_variation2.phpt] 
TEST 48/49 [tests/ctype_xdigit_variation3.phpt]
�[1;32mPASS�[0m Test ctype_xdigit() function : usage variations - Different strings [tests/ctype_xdigit_variation3.phpt] 
TEST 49/49 [tests/lc_ctype_inheritance.phpt]
�[1;31mFAIL�[0m Do not inherit LC_CTYPE from environment [tests/lc_ctype_inheritance.phpt] 
=====================================================================
TIME END 2025-04-14 01:35:27

=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped    :     0
Exts tested     :    12
---------------------------------------------------------------------

Number of tests :    49                49
Tests skipped   :     0 (  0.0%) --------
Tests warned    :     0 (  0.0%) (  0.0%)
Tests failed    :     1 (  2.0%) (  2.0%)
Tests passed    :    48 ( 98.0%) ( 98.0%)
---------------------------------------------------------------------
Time taken      :     2 seconds
=====================================================================

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Do not inherit LC_CTYPE from environment [tests/lc_ctype_inheritance.phpt]
=====================================================================
make: *** [Makefile:139: test] 錯誤 1

Additional context

No response

System metadata

  • system: "aarch64-darwin"
  • host os: Darwin 24.4.0, macOS 15.4
  • multi-user?: yes
  • sandbox: no
  • version: nix-env (Nix) 2.26.2
  • nixpkgs: /nix/store/0cic1diia69573akxcmqr4vd9jx86yf3-source

Notify maintainers

@aanderse @drupol @Ma27 @piotrkwiecinski @talyz


Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)

I assert that this issue is relevant for Nixpkgs

Is this issue important to you?

Add a 👍 reaction to issues you find important.

@pan93412 pan93412 added the 0.kind: bug Something is broken label Apr 14, 2025
@pan93412 pan93412 changed the title PACKAGENAME: BUG TITLE php-ctypes: cannot build (Do not inherit LC_CTYPE from environment [tests/lc_ctype_inheritance.phpt]) Apr 14, 2025
@cornedor
Copy link
Contributor

Installing PHP from github:nixos/nixpkgs/nixpkgs-unstable and github:nixos/nixpkgs/nixpkgs-24.11-darwin is also failing.
Building PHP from source following the steps using https://github.com/php/php-src (but using nix for packages) also fails with the same error.

@drupol
Copy link
Contributor

drupol commented Apr 14, 2025

Is there an issue opened upstream about this issue? Perhaps @nielsdos knows something?

edit: in the meantime, I made a PR to disable that test to unblock the situation.

@nielsdos
Copy link

Neither on my Linux machine or on the macOS Ventura machine do I get a failure.
It's possible that the test is assuming something about the environment or that some locale data has changed.
It would be useful to see the output and environment variables. The output can be obtained by running ./sapi/cli/php ./run-tests.php --show-diff --show-out ext/ctype

@drupol
Copy link
Contributor

drupol commented Apr 14, 2025

Sadly I don't have such a machine so I won't be able to do that. Perhaps @pan93412 or @cornedor ?

@cornedor
Copy link
Contributor

cornedor commented Apr 14, 2025

@nielsdos here you go:

tests-output.txt

edit: and my env:

Details

TERM_SESSION_ID=w0t0p0:B7401D96-829F-4ED7-BBCB-BF79268AA878
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.vt1WJhSBbH/Listeners
LC_TERMINAL_VERSION=3.5.13
COLORFGBG=11;15
ITERM_PROFILE=Default
XPC_FLAGS=0x0
LANG=nl_NL.UTF-8
PWD=/Users/corne/Development/php-src
SHELL=/bin/zsh
__CFBundleIdentifier=com.googlecode.iterm2
SECURITYSESSIONID=186b1
TERM_FEATURES=T3CwLrMSc7UUw9Ts3BFGsSyHNoSxF
TERM_PROGRAM_VERSION=3.5.13
TERM_PROGRAM=iTerm.app
PATH=/nix/store/dfq0dqrvym1cwnfvxq3pnvgipr9n94as-zplug-2.4.2/share/zplug/bin:/Users/corne/.local/bin:/Users/corne/.nix-profile/bin:/etc/profiles/per-user/corne/bin:/run/current-system/sw/bin:/nix/var/nix/profiles/default/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
LC_TERMINAL=iTerm2
COLORTERM=truecolor
COMMAND_MODE=unix2003
TERM=xterm-256color
TERMINFO_DIRS=/Users/corne/.nix-profile/share/terminfo:/etc/profiles/per-user/corne/share/terminfo:/run/current-system/sw/share/terminfo:/nix/var/nix/profiles/default/share/terminfo:/usr/share/terminfo
HOME=/Users/corne
TMPDIR=/var/folders/lc/jm9nmwz93pb66vwrth7sd6v40000gn/T/
USER=corne
XPC_SERVICE_NAME=0
LOGNAME=corne
LaunchInstanceID=3D6B40C4-9012-421E-9657-77712212C47D
__CF_USER_TEXT_ENCODING=0x0:0:0
ITERM_SESSION_ID=w0t0p0:B7401D96-829F-4ED7-BBCB-BF79268AA878
SHLVL=1
OLDPWD=/Users/corne/Development
__NIX_DARWIN_SET_ENVIRONMENT_DONE=1
EDITOR=nano
NIX_PATH=nixpkgs=flake:nixpkgs:/nix/var/nix/profiles/per-user/root/channels
NIX_SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
PAGER=less -R
XDG_CONFIG_DIRS=/Users/corne/.nix-profile/etc/xdg:/etc/profiles/per-user/corne/etc/xdg:/run/current-system/sw/etc/xdg:/nix/var/nix/profiles/default/etc/xdg
XDG_DATA_DIRS=/Users/corne/.nix-profile/share:/etc/profiles/per-user/corne/share:/run/current-system/sw/share:/nix/var/nix/profiles/default/share
NIX_USER_PROFILE_DIR=/nix/var/nix/profiles/per-user/corne
NIX_PROFILES=/nix/var/nix/profiles/default /run/current-system/sw /etc/profiles/per-user/corne /Users/corne/.nix-profile
__HM_SESS_VARS_SOURCED=1
__HM_ZSH_SESS_VARS_SOURCED=1
ZPLUG_HOME=/Users/corne/.zplug
ZPLUG_ROOT=/nix/store/dfq0dqrvym1cwnfvxq3pnvgipr9n94as-zplug-2.4.2/share/zplug
PERIOD=30
FPATH=/nix/store/dfq0dqrvym1cwnfvxq3pnvgipr9n94as-zplug-2.4.2/share/zplug/autoload:/nix/store/dfq0dqrvym1cwnfvxq3pnvgipr9n94as-zplug-2.4.2/share/zplug/misc/completions:/nix/store/dfq0dqrvym1cwnfvxq3pnvgipr9n94as-zplug-2.4.2/share/zplug/base/sources:/nix/store/dfq0dqrvym1cwnfvxq3pnvgipr9n94as-zplug-2.4.2/share/zplug/base/utils:/nix/store/dfq0dqrvym1cwnfvxq3pnvgipr9n94as-zplug-2.4.2/share/zplug/base/job:/nix/store/dfq0dqrvym1cwnfvxq3pnvgipr9n94as-zplug-2.4.2/share/zplug/base/log:/nix/store/dfq0dqrvym1cwnfvxq3pnvgipr9n94as-zplug-2.4.2/share/zplug/base/io:/nix/store/dfq0dqrvym1cwnfvxq3pnvgipr9n94as-zplug-2.4.2/share/zplug/base/core:/nix/store/dfq0dqrvym1cwnfvxq3pnvgipr9n94as-zplug-2.4.2/share/zplug/base/base:/nix/store/dfq0dqrvym1cwnfvxq3pnvgipr9n94as-zplug-2.4.2/share/zplug/autoload/commands:/nix/store/dfq0dqrvym1cwnfvxq3pnvgipr9n94as-zplug-2.4.2/share/zplug/autoload/options:/nix/store/dfq0dqrvym1cwnfvxq3pnvgipr9n94as-zplug-2.4.2/share/zplug/autoload/tags:/Users/corne/.nix-profile/share/zsh/site-functions:/Users/corne/.nix-profile/share/zsh/5.9/functions:/Users/corne/.nix-profile/share/zsh/vendor-completions:/etc/profiles/per-user/corne/share/zsh/site-functions:/etc/profiles/per-user/corne/share/zsh/5.9/functions:/etc/profiles/per-user/corne/share/zsh/vendor-completions:/run/current-system/sw/share/zsh/site-functions:/run/current-system/sw/share/zsh/5.9/functions:/run/current-system/sw/share/zsh/vendor-completions:/nix/var/nix/profiles/default/share/zsh/site-functions:/nix/var/nix/profiles/default/share/zsh/5.9/functions:/nix/var/nix/profiles/default/share/zsh/vendor-completions:/usr/local/share/zsh/site-functions:/usr/share/zsh/site-functions:/usr/share/zsh/5.9/functions
ZPLUG_THREADS=16
ZPLUG_PROTOCOL=HTTPS
ZPLUG_FILTER=fzf-tmux:fzf:peco:percol:fzy:zaw
ZPLUG_LOADFILE=/Users/corne/.zplug/packages.zsh
ZPLUG_USE_CACHE=true
ZPLUG_ERROR_LOG=/Users/corne/.zplug/.error_log
ZPLUG_BIN=/Users/corne/.zplug/bin
ZPLUG_CACHE_DIR=/Users/corne/.zplug/cache
ZPLUG_REPOS=/Users/corne/.zplug/repos
_ZPLUG_VERSION=2.4.2
_ZPLUG_URL=https://github.com/zplug/zplug
_ZPLUG_OHMYZSH=robbyrussell/oh-my-zsh
_ZPLUG_PREZTO=sorin-ionescu/prezto
_ZPLUG_AWKPATH=/nix/store/dfq0dqrvym1cwnfvxq3pnvgipr9n94as-zplug-2.4.2/share/zplug/misc/contrib
_ZPLUG_CONFIG_SUBSHELL=:
ZSH=/Users/corne/.zplug/repos/robbyrussell/oh-my-zsh
ZSH_CACHE_DIR=/Users/corne/.zplug/repos/robbyrussell/oh-my-zsh/cache/
STARSHIP_SHELL=zsh
STARSHIP_SESSION_KEY=###################
ATUIN_SESSION=###################
ATUIN_HISTORY_ID=###################
_=/etc/profiles/per-user/corne/bin/env

@nielsdos
Copy link

@cornedor Can you please run the following PHP script and share its output?

<?php
var_dump(setlocale(LC_CTYPE, "0"));
var_dump(ctype_lower("\xe4"));

@cornedor
Copy link
Contributor

cornedor commented Apr 14, 2025

@nielsdos

php-src on  master [✘?] via 🐘
❯ ./sapi/cli/php ./test.php
string(7) "C.UTF-8"
bool(true)

@nielsdos
Copy link

I don't understand this. So that would mean the C locale on your system somehow considers "\xe4" as lowercase, which seems wrong to me. Is this something that maybe changed in more recent macOS versions?
What's the output of running the locale program in a terminal?

@cornedor
Copy link
Contributor

@nielsdos

❯ locale
LANG="nl_NL.UTF-8"
LC_COLLATE="nl_NL.UTF-8"
LC_CTYPE="nl_NL.UTF-8"
LC_MESSAGES="nl_NL.UTF-8"
LC_MONETARY="nl_NL.UTF-8"
LC_NUMERIC="nl_NL.UTF-8"
LC_TIME="nl_NL.UTF-8"
LC_ALL=

@cornedor
Copy link
Contributor

cornedor commented Apr 14, 2025

I tried to do the same using C++ with my very limited knowledge of the language and this setup, but it seems to have the same behavior if I set the locale to C.UTF-8.

#include <iostream>
#include <clocale>
#include <cctype>
#include <cstring>

int main() {
    // Create a string with the character \xe4 (ä)
    const unsigned char test_char = '\xe4';

    const char* result = std::setlocale(LC_CTYPE, "C");
    std::cout << "setlocale(LC_CTYPE, \"C\") returned: " << (result ? result : "NULL") << std::endl;

    // Check if the character is lowercase using ctype
    bool is_lower = islower(test_char);
    std::cout << "islower(\"\\xe4\") returned: " << (is_lower ? "true" : "false") << std::endl;

    const char* result2 = std::setlocale(LC_CTYPE, "C.UTF-8");
    std::cout << "setlocale(LC_CTYPE, \"C.UTF-8\") returned: " << (result2 ? result2 : "NULL") << std::endl;

    // Check if the character is lowercase using ctype
    bool is_lower2 = islower(test_char);
    std::cout << "islower(\"\\xe4\") returned: " << (is_lower2 ? "true" : "false") << std::endl;

    return 0;
}
setlocale(LC_CTYPE, "C") returned: C
islower("\xe4") returned: false
setlocale(LC_CTYPE, "C.UTF-8") returned: C.UTF-8
islower("\xe4") returned: true

EDIT: This looks fine, ä is lower case.

@drupol
Copy link
Contributor

drupol commented Apr 14, 2025

(I decided to merge the patch removing the test only for aarch64-darwin to unblock the situation, we can improve the situation if upstream decide to publish a patch to fix it)

@nielsdos
Copy link

I've opened php/php-src#18324

@cornedor
Copy link
Contributor

@drupol The test is still being run, and thus still failing. This should be available on unstable by now right?

Details

❯ nix shell github:nixos/nixpkgs/nixpkgs-unstable#php84
error: builder for '/nix/store/aqs5pvir19i6i1m3rcz9cjd5c90hkzz3-php-ctype-8.4.6.drv' failed with exit code 2;
       last 25 log lines:
       > =====================================================================
       > TIME END 2025-04-15 13:15:09
       >
       > =====================================================================
       > TEST RESULT SUMMARY
       > ---------------------------------------------------------------------
       > Exts skipped    :     0
       > Exts tested     :    12
       > ---------------------------------------------------------------------
       >
       > Number of tests :    49                49
       > Tests skipped   :     0 (  0.0%) --------
       > Tests warned    :     0 (  0.0%) (  0.0%)
       > Tests failed    :     1 (  2.0%) (  2.0%)
       > Tests passed    :    48 ( 98.0%) ( 98.0%)
       > ---------------------------------------------------------------------
       > Time taken      : 0.447 seconds
       > =====================================================================
       >
       > =====================================================================
       > FAILED TEST SUMMARY
       > ---------------------------------------------------------------------
       > Do not inherit LC_CTYPE from environment [tests/lc_ctype_inheritance.phpt]
       > =====================================================================
       > make: *** [Makefile:133: test] Error 1
       For full logs, run:
         nix log /nix/store/aqs5pvir19i6i1m3rcz9cjd5c90hkzz3-php-ctype-8.4.6.drv
error: 1 dependencies of derivation '/nix/store/jh61f3n5dbr7058gsrnxcyj9b7l8f1mm-php-extra-init-8.4.6.ini.drv' failed to build
error: 1 dependencies of derivation '/nix/store/zglwkqfkaivfvsc0pi823gdgic9a5022-php-with-extensions-8.4.6.drv' failed to build

@drupol
Copy link
Contributor

drupol commented Apr 15, 2025

@cornedor
Copy link
Contributor

@drupol thanks for the link.

Using master indeed works now 👌

❯ nix shell github:nixos/nixpkgs/master#php84


nix on  main [!]
❯ php --version
PHP 8.4.6 (cli) (built: Apr  8 2025 19:55:31) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.4.6, Copyright (c) Zend Technologies
    with Zend OPcache v8.4.6, Copyright (c), by Zend Technologies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants