Skip to content
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

libunistring: 1.2 -> 1.3 #349697

Merged
merged 1 commit into from
Dec 7, 2024
Merged

libunistring: 1.2 -> 1.3 #349697

merged 1 commit into from
Dec 7, 2024

Conversation

trofi
Copy link
Contributor

@trofi trofi commented Oct 19, 2024

Changes: https://savannah.gnu.org/news/?id=10682

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/4862

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/4881

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/4909

Copy link
Member

@jopejoe1 jopejoe1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build a few packages with this.

@jopejoe1 jopejoe1 merged commit d09af63 into NixOS:staging Dec 7, 2024
44 checks passed
@trofi trofi deleted the libunistring-update branch December 7, 2024 13:34
@ofalvai
Copy link
Contributor

ofalvai commented Dec 10, 2024

FYI guile is broken on staging on Darwin with this error:

guile> checking whether libunistring was built with iconv support... no
guile> configure: error: No iconv support.  Please recompile libunistring with iconv enabled.

and git bisect confirmed that this PR caused it.

@trofi
Copy link
Contributor Author

trofi commented Dec 10, 2024

Thank you for the report! Looking.

@paparodeo
Copy link
Contributor

paparodeo commented Dec 11, 2024

this test in guile is failing with libunistring 1.3 but passes with 1.2

#include <uniconv.h>
#include <unistring/iconveh.h>
int
main (int argc, char *argv[])
{
size_t result_size;
return (NULL == u32_conv_from_encoding ("ASCII", iconveh_question_mark,
                                        "a", 1,
                                        NULL, NULL, &result_size));
}

@trofi
Copy link
Contributor Author

trofi commented Dec 11, 2024

Is it a build failure or runtime failure?

@paparodeo
Copy link
Contributor

paparodeo commented Dec 11, 2024

Is it a build failure or runtime failure?

runtime failure. 1.3 added a check for macOS 14 libiconv bugs which fails and thus it doesn't link in or use libiconv
https://lists.gnu.org/archive/html/bug-gnulib/2024-05/msg00375.html
see also some discussion in the matrix macOS channel.

@trofi
Copy link
Contributor Author

trofi commented Dec 11, 2024

There were not that many changes between 1.2 and 1.3: https://git.savannah.gnu.org/gitweb/?p=libunistring.git;a=shortlog . It's probably autotools changes or gnulib changes.

@paparodeo
Copy link
Contributor

paparodeo commented Dec 11, 2024

There were not that many changes between 1.2 and 1.3: https://git.savannah.gnu.org/gitweb/?p=libunistring.git;a=shortlog . It's probably autotools changes or gnulib changes.

it is a change in gnulib-m4/iconv.m4

|   /* Test against macOS 14.4 bug: Failures are not distinguishable from
|      successful returns.
|      POSIX:2018 says: "The iconv() function shall ... return the number of
|      non-identical conversions performed."
|      But here, the conversion always does transliteration (the suffixes
|      "//TRANSLIT" and "//IGNORE" have no effect, nor does iconvctl()) and
|      does not report when it does a non-identical conversion.  */
|   {
|     iconv_t cd_utf8_to_88591 = iconv_open ("ISO-8859-1", "UTF-8");
|     if (cd_utf8_to_88591 != (iconv_t)(-1))
|       {
|         static ICONV_CONST char input[] = "\305\202"; /* LATIN SMALL LETTER L WITH STROKE */
|         char buf[10];
|         ICONV_CONST char *inptr = input;
|         size_t inbytesleft = strlen (input);
|         char *outptr = buf;
|         size_t outbytesleft = sizeof (buf);
|         size_t res = iconv (cd_utf8_to_88591,
|                             &inptr, &inbytesleft,
|                             &outptr, &outbytesleft);
|         /* Here:
|            With glibc, GNU libiconv (including macOS up to 13): res == (size_t)-1, errno == EILSEQ.
|            With musl libc, NetBSD 10, Solaris 11: res == 1.
|            With macOS 14.4: res == 0, output is "l".  */
|         if (res == 0)
|           result |= 2;
|         iconv_close (cd_utf8_to_88591);
|       }
|   }

@trofi
Copy link
Contributor Author

trofi commented Dec 11, 2024

Aha, nice! Thank you! Does passing am_cv_lib_iconv=no to configureFlags help by chance?

@trofi
Copy link
Contributor Author

trofi commented Dec 11, 2024

Sorry, should probably be am_cv_func_iconv_works=no.

@paparodeo
Copy link
Contributor

Sorry, should probably be am_cv_func_iconv_works=no.

am_cv_func_iconv_works=yes works I assume am_cv_func_iconv_works=no has the same effect as the configure test failing.

doCheck = false; so we don't notice that the tests fail with the macOS 15 libiconv.

@paparodeo
Copy link
Contributor

FWIW when `doCheck = true;` these are the failing tests.
.. contents:: :depth: 2

FAIL: test-striconveh
=====================

test-striconveh.c:256: assertion 'retval == -1 && errno == EILSEQ' failed
FAIL test-striconveh (exit status: 134)

FAIL: test-striconveha
======================

test-striconveha.c:108: assertion 'retval == -1 && errno == EILSEQ' failed
FAIL test-striconveha (exit status: 134)

FAIL: test-u16-conv-to-enc
==========================

uniconv/test-u16-conv-to-enc.c:106: assertion 'result == NULL' failed
FAIL test-u16-conv-to-enc (exit status: 134)

FAIL: test-u16-strconv-to-enc
=============================

uniconv/test-u16-strconv-to-enc.c:70: assertion 'result == NULL && errno == EILSEQ' failed
FAIL test-u16-strconv-to-enc (exit status: 134)

FAIL: test-u32-conv-to-enc
==========================

uniconv/test-u32-conv-to-enc.c:106: assertion 'result == NULL' failed
FAIL test-u32-conv-to-enc (exit status: 134)

FAIL: test-u32-strconv-to-enc
=============================

uniconv/test-u32-strconv-to-enc.c:69: assertion 'result == NULL && errno == EILSEQ' failed
FAIL test-u32-strconv-to-enc (exit status: 134)

FAIL: test-u8-conv-to-enc
=========================

uniconv/test-u8-conv-to-enc.c:106: assertion 'result == NULL' failed
FAIL test-u8-conv-to-enc (exit status: 134)

FAIL: test-u8-strconv-to-enc
============================

uniconv/test-u8-strconv-to-enc.c:61: assertion 'result == NULL && errno == EILSEQ' failed
FAIL test-u8-strconv-to-enc (exit status: 134)

@paparodeo
Copy link
Contributor

#364495 uses gnu libiconv for darwin. if tests were enabled they would pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants