Skip to content

Commit 9d7c94d

Browse files
committed
libiconv: make default on Darwin
The Darwin libiconv tries to be compatible with GNU libiconv, but it’s not. Recent versions of Autoconf and gnulib include checks for issues in Darwin’s libiconv implementation, which has effectively turned `autoreconfHook` into `autoBreakDarwinHook` due to failing to link libiconv. Instead of continuing to work around it, make GNU libiconv the default. With the UTF-8-MAC patch, it should be a drop-in replacement.
1 parent 628f3d5 commit 9d7c94d

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

pkgs/stdenv/darwin/default.nix

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ let
277277
sdkPackages = prevStage: {
278278
inherit (prevStage)
279279
bashNonInteractive
280+
libiconvReal
280281
libpng
281282
libxml2
282283
libxo
@@ -291,7 +292,6 @@ let
291292
Csu
292293
adv_cmds
293294
copyfile
294-
libiconv
295295
libresolv
296296
libsbuf
297297
libutil
@@ -557,16 +557,16 @@ assert bootstrapTools.passthru.isFromBootstrapFiles or false; # sanity check
557557
# Use this stage’s CF to build CMake. It’s required but can’t be included in the stdenv.
558558
cmake = self.cmakeMinimal;
559559

560-
# Use libiconvReal with gettext to break an infinite recursion.
561-
gettext = super.gettext.override { libiconv = super.libiconvReal; };
562-
563560
# Disable grep’s tests for now due to impure locale updates in
564561
# macOS 15.4 breaking them in the bootstrap.
565562
gnugrep = super.gnugrep.overrideAttrs { doCheck = false; };
566563

567564
# Disable tests because they use dejagnu, which fails to run.
568565
libffi = super.libffi.override { doCheck = false; };
569566

567+
# Avoid an infinite recursion where a stdenv with libiconv is used to build libiconv.
568+
libiconvReal = super.libiconvReal.override { stdenv = super.darwin.bootstrapStdenv; };
569+
570570
# Avoid pulling in a full python and its extra dependencies for the llvm/clang builds.
571571
libxml2 = super.libxml2.override { pythonSupport = false; };
572572

@@ -1050,6 +1050,7 @@ assert bootstrapTools.passthru.isFromBootstrapFiles or false; # sanity check
10501050
ld64.lib
10511051
ld64.out
10521052
libffi.out
1053+
libiconv.out
10531054
libxml2.out
10541055
ncurses.dev
10551056
ncurses.man
@@ -1076,7 +1077,6 @@ assert bootstrapTools.passthru.isFromBootstrapFiles or false; # sanity check
10761077
binutils
10771078
binutils.bintools
10781079
libcxx
1079-
libiconv.out
10801080
libresolv.out
10811081
libsbuf.out
10821082
libSystem
@@ -1192,8 +1192,8 @@ assert bootstrapTools.passthru.isFromBootstrapFiles or false; # sanity check
11921192
assert isFromNixpkgs prevStage.binutils-unwrapped.src;
11931193
assert isBuiltByNixpkgsCompiler prevStage.curl;
11941194

1195-
# libiconv should be an alias for darwin.libiconv
1196-
assert prevStage.libiconv == prevStage.darwin.libiconv;
1195+
# libiconv should be an alias for libiconvReal
1196+
assert prevStage.libiconv == prevStage.libiconvReal;
11971197

11981198
{
11991199
inherit (prevStage) config overlays stdenv;

pkgs/top-level/all-packages.nix

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6676,8 +6676,6 @@ with pkgs;
66766676
]
66776677
then
66786678
libcIconv pkgs.libc
6679-
else if stdenv.hostPlatform.isDarwin then
6680-
darwin.libiconv
66816679
else
66826680
libiconvReal;
66836681

0 commit comments

Comments
 (0)