Skip to content

stubs: match ICU signature for unorm2_normalize (NFC) #14734

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

Merged
merged 1 commit into from
Feb 26, 2018

Conversation

compnerd
Copy link
Member

Adjust the signature to match the ICU declaration for
unorm2_normalize. This was adjusted to allow building against ICU
59.1. The shim type definition for the UChar ensures that the signature
is correct on all the targets. NFC.

Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.

Resolves SR-NNNN.

@compnerd
Copy link
Member Author

@swift-ci please test and merge

@compnerd
Copy link
Member Author

@milseman suggestion on how to deal with this API change? Seems that older revisions used a different signature.

@milseman
Copy link
Member

I have no idea why this decl even changed. @lancep do you know?

@lancep
Copy link
Contributor

lancep commented Feb 20, 2018

Because I was hitting the same failure that this just hit

@milseman
Copy link
Member

milseman commented Feb 20, 2018

So it seems UChar changed in ICU version 59: http://icu-project.org/apiref/icu4c/umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac

That builder is using ICU-55 (ancient). Long term, we're considering just bundling an ICU with Swift on Linux instead of using Ubuntu's pre-Swift versions of ICU.

edit: We could try to condition it based on http://icu-project.org/apiref/icu4c/uvernum_8h.html#a3f14ba8e1513e47458e2b285d777529a. The issue is that the shim header doesn't necessarily have access to this. We might want to define an ICU_VERSION which we set to 55 on old Ubuntu

@compnerd
Copy link
Member Author

@milseman how about being absolutely unhygienic here? Technically, the signature is compatible, the difference is that we use a well specified type rather than an underspecified type. We could do a #if ICU_VERSION-0 < 55 which would allow us to detect the version at build time for the shims. But, we always use the newer definition on use of the shims. Since the interface is completely compatible, I think that we could get away with it, even though this is absolutely terrible.

@milseman
Copy link
Member

I'm fine with utterly unhygienic solutions for back-compat with old ICUs, preferably with the unsanitary parts touching the old and not the new.

@compnerd
Copy link
Member Author

@swift-ci please test and merge

Adjust the signature to match the ICU declaration for
`unorm2_normalize`.  This was adjusted to allow building against ICU
59.1.  The shim type definition for the UChar ensures that the signature
is correct on all the targets.  NFC.
@compnerd
Copy link
Member Author

@swift-ci please test and merge

@swift-ci swift-ci merged commit ac54fec into swiftlang:master Feb 26, 2018
@compnerd compnerd deleted the icu-signature branch February 26, 2018 21:40
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.

4 participants