Data build for MacOSX broken

Description

The symptoms are that the build appears to be successful (return code 0) but the icudata dylib has no data inside it. All the ICU commands that require data return error codes instead.

1. Checkout ICU from https://github.com/unicode-org/icu
2. Run:

$ ./runConfigureICU MacOSX --enable-debug --disable-release --prefix=/path/to/install
export CPP= CC= CXX= CPPFLAGS= CFLAGS=-O2 CXXFLAGS=-O2 LDFLAGS= MAKE=
Running ./configure --enable-debug --disable-release --prefix=/path/to/install for MacOS X (Darwin) using the default compiler

checking for ICU version numbers... release 64.1, library 64.1, unicode version 12.0
checking build system type... x86_64-apple-darwin18.5.0
checking host system type... x86_64-apple-darwin18.5.0
checking whether to build debug libraries... yes
[snip]
config.status: creating samples/cal/Makefile
config.status: creating samples/layout/Makefile
Spawning Python to generate data/rules.mk...
Spawning Python to generate test/testdata/rules.mk...

ICU for C/C++ 64.1 is ready to be built.
[snip]

$ gnumake install
/Applications/Xcode.app/Contents/Developer/usr/bin/gnumake[0]: Making `install' in `stubdata'
/bin/sh ../mkinstalldirs /path/to/install/lib
mkdir /path/to/install/lib
/usr/bin/install -c libicudata.64.1.dylib /path/to/install/lib
[snip]
echo timestamp > build-local
DYLD_LIBRARY_PATH=../stubdata:../tools/ctestfw:../lib:$DYLD_LIBRARY_PATH ../bin/pkgdata -O ../data/icupkg.inc -q -c -s /path/to/source/data/out/build/icudt64l -d ../lib -e icudt64 -T ./out/tmp -p icudt64l -m dll -r 64.1 -L icudata ./out/tmp/icudata.lst
pkgdata: clang -DU_ATTRIBUTE_DEPRECATED= -DU_DEBUG=1 -DU_HAVE_STRTOD_L=1 -DU_HAVE_XLOCALE_H=1 -O2 -std=c11 -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Qunused-arguments -Wno-parentheses-equality -fno-common -c -I../common -I../common -dynamic -o ./out/tmp/icudt64l_dat.o ./out/tmp/icudt64l_dat.S
pkgdata: clang -dynamiclib -dynamic -O2 -std=c11 -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Qunused-arguments -Wno-parentheses-equality -o ../lib/libicudata.64.1.dylib ./out/tmp/icudt64l_dat.o -Wl,-compatibility_version -Wl,64 -Wl,-current_version -Wl,64.1 -install_namelibicudata.64.dylib
clang: error: unknown argument: '-install_namelibicudata.64.dylib'
– return status = 256
Error generating library file. Failed command: clang -dynamiclib -dynamic -O2 -std=c11 -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Qunused-arguments -Wno-parentheses-equality -o ../lib/libicudata.64.1.dylib ./out/tmp/icudt64l_dat.o -Wl,-compatibility_version -Wl,64 -Wl,-current_version -Wl,64.1 -install_namelibicudata.64.dylib
Error generating assembly code for data.
echo timestamp > packagedata
/bin/sh ../mkinstalldirs /path/to/install/lib
DYLD_LIBRARY_PATH=../stubdata:../tools/ctestfw:../lib:$DYLD_LIBRARY_PATH ../bin/pkgdata -O ../data/icupkg.inc -q -c -s /path/to/source/data/out/build/icudt64l -d ../lib -m dll -r 64.1 -e icudt64 -T ./out/tmp -s ./out/build/icudt64l -p icudt64l -L icudata ./out/tmp/icudata.lst -I /path/to/source/install/lib
pkgdata: clang -DU_ATTRIBUTE_DEPRECATED= -DU_DEBUG=1 -DU_HAVE_STRTOD_L=1 -DU_HAVE_XLOCALE_H=1 -O2 -std=c11 -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Qunused-arguments -Wno-parentheses-equality -fno-common -c -I../common -I../common -dynamic -o ./out/tmp/icudt64l_dat.o ./out/tmp/icudt64l_dat.S
pkgdata: clang -dynamiclib -dynamic -O2 -std=c11 -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Qunused-arguments -Wno-parentheses-equality -o ../lib/libicudata.64.1.dylib ./out/tmp/icudt64l_dat.o -Wl,-compatibility_version -Wl,64 -Wl,-current_version -Wl,64.1 -install_namelibicudata.64.dylib
clang: error: unknown argument: '-install_namelibicudata.64.dylib'
– return status = 256
Error generating library file. Failed command: clang -dynamiclib -dynamic -O2 -std=c11 -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Qunused-arguments -Wno-parentheses-equality -o ../lib/libicudata.64.1.dylib ./out/tmp/icudt64l_dat.o -Wl,-compatibility_version -Wl,64 -Wl,-current_version -Wl,64.1 -install_namelibicudata.64.dylib
Error generating assembly code for data.
/Applications/Xcode.app/Contents/Developer/usr/bin/gnumake[0]: Making `install' in `extra'
/Applications/Xcode.app/Contents/Developer/usr/bin/gnumake[1]: Making `install' in `uconv'

Activity

Show:
Peter Edberg
April 5, 2019, 4:25 PM
Edited

Verified the associated PR-579/PR-582 fix the errors with getting e.g. the following in a make check build for MacOS

which I first e-mailed about on Feb 4, and which I have been working around since then by explicitly setting ICU_DATA.

Steven R. Loomis
April 3, 2019, 7:46 PM

Mysterious to me how or when this had regressed… has this been a long standing issue?!

Steven R. Loomis
April 3, 2019, 7:45 PM
Steven R. Loomis
April 3, 2019, 6:19 PM

OK the cause here is that `LD_SONAME` is extracted from `mh-darwin` for mac by running a little makefile. However, I think the space at the end is getting trimmed out when the file is generated and/or read. Then, ${LD_SONAME} is concatenated together with the argument.

I will look into how the space at the end can be preserved.

Steven R. Loomis
April 3, 2019, 5:50 PM

Repro'ed.

There's another problem,

the timestamp shouldn't be set on failure!

Fixed

Assignee

Steven R. Loomis

Reporter

Myles C. Maxfield

Components

Priority

blocks-progress

Time Needed

Minutes

Fix versions