-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
gettext: 0.21.1 -> 0.22.4 #279197
gettext: 0.21.1 -> 0.22.4 #279197
Conversation
@ofborg build gettext gettext.passthru.tests |
This comment was marked as resolved.
This comment was marked as resolved.
27182c2
to
28067b0
Compare
5cc404d
to
70f6bab
Compare
ee48bd5
to
a1e9b35
Compare
It looks like it’s going to require Darwin bootstrap changes to have gettext use CoreServices. I made some progress tonight, but I’ll need to work on it some more tomorrow. |
The following patch allows the Darwin stdenv to eval. I’ll kick off a build overnight, but I wanted to post it for feedback. The patch breaks the infinite recursion by conditionally linking CoreServices. Early in the bootstrap, CoreServices is not linked. This should be safe because the set of programs is finite. We don’t have to worry about accidentally linking gettext against something that will crash (such as aria2, which motivated the change). At the end of the bootstrap when everything is rebuilt against the final libraries, gettext is linked against CoreServices from a previous stage. That should be safe to do because CoreServices is a system framework. diff --git a/pkgs/development/libraries/gettext/default.nix b/pkgs/development/libraries/gettext/default.nix
index 4f81df001cc0..906edc0b446e 100644
--- a/pkgs/development/libraries/gettext/default.nix
+++ b/pkgs/development/libraries/gettext/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, libiconv, xz, bash
+{ stdenv, lib, fetchurl, libiconv, xz, bash, darwin
}:
# Note: this package is used for bootstrapping fetchurl, and thus
@@ -19,6 +19,7 @@ stdenv.mkDerivation rec {
# fix reproducibile output, in particular in the grub2 build
# https://savannah.gnu.org/bugs/index.php?59658
./0001-msginit-Do-not-use-POT-Creation-Date.patch
+ ] ++ lib.optionals (darwin.apple_sdk.frameworks.CoreServices == null) [
# prevent infinite recursion for the darwin stdenv
./0002-Revert-Avoid-crash-on-macOS-14.patch
];
@@ -62,6 +63,9 @@ stdenv.mkDerivation rec {
++ lib.optionals (!stdenv.isLinux && !stdenv.hostPlatform.isCygwin) [
# HACK, see #10874 (and 14664)
libiconv
+ ]
+ ++ lib.optionals (stdenv.isDarwin && darwin.apple_sdk.frameworks.CoreServices != null) [
+ darwin.apple_sdk.frameworks.CoreServices
];
setupHooks = [
diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix
index c94c56daae1c..b4b0cdf3e7a0 100644
--- a/pkgs/stdenv/darwin/default.nix
+++ b/pkgs/stdenv/darwin/default.nix
@@ -452,6 +452,9 @@ in
curl = super.curlMinimal;
+ # Don’t link CoreServices during the bootstrap to prevent an infinite recursion.
+ gettext = super.gettext.override { darwin.apple_sdk.frameworks.CoreServices = null; };
+
# Disable tests because they use dejagnu, which fails to run.
libffi = super.libffi.override { doCheck = false; };
@@ -1082,6 +1085,13 @@ in
inherit (prevStage) fetchurl;
};
+ # Use CoreServices from the previous stage to avoid an infinite recursion.
+ gettext = super.gettext.override {
+ darwin.apple_sdk.frameworks = {
+ inherit (prevStage.darwin.apple_sdk.frameworks) CoreServices;
+ };
+ };
+
libyaml = super.libyaml.override {
inherit (prevStage) fetchFromGitHub;
}; |
It took longer than expected, but I can confirm I was able to bootstrap the Darwin stdenv with the above patch on both aarch64- and x86_64-darwin. $ ./result-aarch64/bin/gettext --version
gettext (GNU gettext-runtime) 0.22.4
Copyright (C) 1995-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 Ulrich Drepper.
$ otool -L ./result-aarch64/bin/gettext
./result-aarch64/bin/gettext:
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1770.255.0)
/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 1122.11.0)
/nix/store/k36qfqm8qplpp7ay8q7kq3yi17jfb4bk-gettext-0.22.4/lib/libintl.8.dylib (compatibility version 13.0.0, current version 13.0.0)
/nix/store/nz4fff34byj1jjy1hka717rhpi7ma2i9-libiconv-50/lib/libiconv.dylib (compatibility version 7.0.0, current version 7.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1)
$ otool -L ./result-x86_64/bin/gettext
./result-x86_64/bin/gettext:
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1349.8.0)
/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 775.19.0)
/nix/store/c8ajzwdwr3drjjri6cyd2jx9prd5jy0v-gettext-0.22.4/lib/libintl.8.dylib (compatibility version 13.0.0, current version 13.0.0)
/nix/store/jbbxab2nl7hs56rxlr16a64ik1rcm8sn-libiconv-50/lib/libiconv.dylib (compatibility version 7.0.0, current version 7.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.60.2) |
a1e9b35
to
5e8fa5e
Compare
I haven't tested on x86_64-darwin, but feel free to take the commits. |
I’ll merge into |
The PR's base branch is set to llvm-19, but 49 commits from the haskell-updates branch are included. Make sure you know the right base branch for your changes, then:
|
Description of changes
https://savannah.gnu.org/news/?group=gettext
On Linux,
gettext
requires a working iconv, which breaks the build ofxgcc
in stage1.5. A workaround is to pass--disable-nls
to the derivation ofxgcc
, then buildgettext
again in stage3, where a freshglibc
has been built.Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.