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

adjustment and workaround for macOS iconv #805

Merged
merged 2 commits into from
Feb 20, 2024
Merged

Conversation

mflatt
Copy link
Contributor

@mflatt mflatt commented Feb 19, 2024

Intended to address #797.

History note: the iconv library in macOS 14.0 was especially broken. By 14.2.1, it has been mostly fixed, but I think the Chez Scheme test suite uncovers a remaining problem. That problem persists in 14.3.1.

The two different failing cases have different reasons:

  • The test at line 1004 fails because iconv encodes a BOM to UTF-8 as 0 bytes. That's arguably correct behavior (a BOM encoding isn't supposed to appear in UTF-8), and the test suite can accommodate it by just avoiding a BOM.

  • The test at line 710 fails due to behavior that seems to be a lingering bug in iconv, where the library incorrectly reports too little decoding success (by not advancing the output pointer) than it should when failing to convert a lambda character to a Chinese encoding. The commit here works around that by not trusting the pointer advances when an a specific error is reported. Unless I have it wrong, the change is ok for a working iconv, too, in part due to the way the workaround is specific to an E2BIG result.

I'm not sure the bug-workaround change is a good idea. Workarounds for OS bugs are sometimes necessary, but it's usually easier to get a sense of the bug's extent so that a workaround feels worthwhile. This workaround is fairly specific to a random corner of a library, and I can't help thinking there are likely other random corners with bugs. Still, I lean toward having the workaround, for now. An alternative is to disable the failing test on macOS.

@mflatt
Copy link
Contributor Author

mflatt commented Feb 19, 2024

Forgot to mention: with the workaround in place, there's a commit here to enable arm64osx in the CI action.

Copy link
Contributor

@burgerrg burgerrg left a comment

Choose a reason for hiding this comment

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

Thanks for figuring this out!

@mflatt mflatt merged commit 64cf30a into cisco:main Feb 20, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants